Building a sound based toy

I have been a bit busy lately at work so I did not work a lot on my different projects. But after a discussion with my sister who was complaining about  the fact that there was no “good” music based toy for her 18 months old child, I was wondering what I could do about it.

Wandering around, I discovered a few things like a “wall Piano” based on a PICAXE-08M2 microcontroller and an ultrasonic Range Finder (see here). But nothing really nice and fun for a very young child. I finally discovered a very very nice project : monome. Ok… a bit complex for a child and surely to expensive ! Looking for some monome clone, I finally stumbled upon Sugarcube Midi Controller. Small enough, nice illuminated buttons, some fun features using accellerometers…

But… it is a midi controller, meaning that it does not play music by itself but controls a midi player like a PC. So I need to make it more autonomous. So my next project is there : build an easy to use & fun sound box, based on Amanda Ghassaei‘s Sugarcube project with specific features like RGB leds, embedded MP3 player and MIDI player, and make it fun for a child !

Still thinking about it…

Getting XBee to work with Arduino SoftSerial

But… what is XBee…

Yes… you’re right, first things first. XBees are small wireless modules which implement, depending on the model, several RF protocols, the “major” one being ZigBee (thus the name !) You can find details here on Digi’s website.

XBee & Uno

Take care, there are several modules. I’ll be using XBee ZB Series 2 modules. You’ll find an XBee RF modules comparison here. As there are quite a few sites describing XBees , I won’t get into details in this post but rather refer to Sparkfun’s XBee buying guide which is covering XBee, ZigBee and Bumblebee 🙂

XBee & SoftwareSerial

Using XBee module with an Arduino is quite well documented… but examples often use the hardware UART making it not simple to program or debug because the UART is shared by the Arduino IDE and XBee chip.

So I thought I use SofwareSerial instead just as I did for one of my Wifridge version.

I used an XBee breakout board from www.droids.it I bought from Lextronic. It is handy as you can use it with 2.52mm pitch headers (XBee won’t fit directly into a breadboard !) and it has 2 operation LEDs.

Connection is quite straightforward :

  • 3.3V on Vin
  • GND on… GND
  • Tx on pin 7
  • Rx on pin 8

Rx and Tx pins can easily be changed in the program anyway.

Then, upload an AT firmware onto XBee module, upload this program onto the Arduino… and you should get something like that on your Serial Monitor into Arduino IDE :

You now have an XBee module talking to an Arduino using Software Serial port, leaving the hardware one for debugging and programming !