The robot I have created is Xylo Tunez: a music robot that plays the song Jingle Bells on a set of 5 xylophone keys. It utilizes two servo motors as the main functioning parts in its design. On startup, the red LED blinks on and off to show that the robot is indeed on and the code is working. Then the button is pressed for one second to initiate the song. To hit each key, the bottom servo moves to the correct position/angle of the specified note. The keys are laid out in 30  increments around a semi-circle shape to make the positioning and accuracy of hitting the keys more consistent. Once the bottom servo is at the correct angle for the key, the top servo hammers the mallet down on the key with a short delay between movements to allow the key to vibrate and create sound. Once the robot has reached the end of the song, the bottom servo moves to its reset position, 0 , to signify that the song is over and it is ready to play again, similar to how the needle on a record player swivels off to the side when not in use.
Below is the bill of materials for Xylo Tunez:
The coding of this robot was a large focus for me. From the beginning, I wanted to code my robot in a way that would be simple, easy to edit and iterate, and also easy to understand and explain to people unfamiliar with my project or coding itself. Below is the complete code for Xylo Tunez:
Back to Top