XBee + Metronome – Birthday Box

 

Have your own birthday accompaniment with the Birthday Box!

1.

The introduction to the XBees for our first assignment was exciting for me, as I enjoy being introduced to different ways to connect/network with low-fidelity setup. It felt as “magical” as using pub-nub in terms of seeing its potential used in many instances that require devices to talk to one another.

In testing the chat through radio, I had a bit of a challenge setting up the XBee due to problems with the serial port installation. I swapped my radio kit to the Lilypad but CoolTerm still had problems recognizing my usb port. Soon after I realized that I had to install an older FTDI drive for my Mac OSX. It was a miss-step on my part (Always remember to check your operating system!) and once that was set up, the chat worked, albeit with some missing letters when it appeared on my peer’s screen. Using this as primarily a chatting tool might prove to be faulty. Regardless of the overlap when typing simultaneously with another person, it was simple and straightforward to use. I can see myself preferring to use this in future connectivity projects.

NOTES:
ATRE – to RESET configuration.
ATID – to determine the radio channel.
ATMY – to determine your radio ID.
ATDL – to set the ID of the radio you are sending information to.

2.

Before jumping into the output sensor for the experiment, I had to make sure that my XBee can send and receive data from other radios. We all sat together and made sure that we can accomplish connections between our radios by changing the atdl configuration. After multiple tests, I realized that there was a problem with my XBee, as it can send values but cannot receive. Even with my Arduino uploaded with the changed “PhysicalPixel” example, (adding 1 after Serial) it would not activate the LED. I tried debugging it multiple ways from resetting my settings on CoolTerm to changing the circuit and trying my XBee on different breakout boards.

What turned out to be the problem was my soldering technique. I was rather sloppy in soldering the pins to my XBee breakout board and had some solder connecting pins next to each other. After fixing the problem, it was Finally able to receive values from another, with “H” turning on the LED while “L” turned it off.

img_7263
Breakout board after fixing the soldering

To complete this experiment, I decided to use the speaker as I am quite familiar with it from previous projects. I wanted to look for a tune that is more familiar with others and can be used for social events. As a result, I found a tune for the Happy Birthday song and implemented that in the toneMelody code. The Arduino code for this experiment can be found here: https://github.com/antariksacp/Birthday-Box. When the XBee receives an H, the speaker will play the Happy Birthday tune.

In regards to testing it with the metronome coordinator Kate provided, the potentiometer can be used to set how frequently the song will play. Once the values are sent, the song will play until it completes and once it receives another “H”, it will then play again. The slowest duration would be it repeating every few seconds, and the longest would have a delay of about 5-10 seconds.

In forming the circuit, I had first placed the components on the breadboard but managed to place it in the box with a smaller one. A few things I had to note were to make sure that the GND on the Arduino connected to ground, otherwise the circuit would not work(!) I tested a variety of ways to place the breadboard in the box to make sure that when closed, the radio can still receive the signal. I found that by placing it nearer to the lid proved to work (as shown in the video), as opposed to just placing it in the bottom of the box. I also used a different 8 ohm speaker than the one provided the kit as it had a slightly louder volume.

img_7267
Using the normal breadboard
box-01
Placing the smaller breadboard inside the box

There were also other possibilities to play around with the “H” and “L” values in terms of controlling the Happy Birthday melody. Perhaps once the “L” value is sent, the tune can stop instead of playing until the end, or as the potentiometer is turned to the slower values, the speed of the song can be altered instead of the frequency. For now at least, we have the traditional Birthday Box.

 

Leave a Reply