When I was sent the BeagleBone Blue board my first thought was what could I build that needed 8 servos. I'd seen some fun examples in the MusicTech challenge so a music player seemed like a good idea. I bought some small servos, a glockenspiel (which has metal bars vs a xylophone which has wooden bars) and some wooden balls.
The balls were drilled and mounted on some short dowels made from lollipop sticks. These were attached to the servos using rubber bands, this has two reasons firstly it allows me to undershoot on positioning the servos causing the beater to hit the bar and recoil. It also reduces the risk of the servo stalling if there is a software problem.
I initially tried mounting the servos on a block of wood. This proved troublesome and it was not possible to adjust the position or angle of the servos. So a bracket was designed to support the servos. @PiTutorials suggested adding slot for the cable into my design but I found that was not necessary because of the way I was mounting the servos.
For the software, I thought I'd try out MQTT as an approach for getting the commands from the UI to the board. This turned out to be very straight forward, I installed Mosca on the BeagleBone and then wrote a client using Paho to communicate to that via WebSockets.
So that I did not need to run all of my code as root, I wrote a "ServoDaemon" that listened for servo positions on a named pipe.
https://github.com/Workshopshed/musicController
The power to the servos caused me an issue, the board could not supply enough current to all of the servos. People have reported that the board won't even boot if you try to power more than 6. On the recommendation of the forum, I decided to power the servos from an external supply. This was done by building a small adapter that mimiced the servo pins. Two sockets slid over the outer pins to connect GND and Signal, the middle pins were connected together and isolated from the board with some hot glue. The glue also held the 3 connectors together.
There's a fault with one of the servos but here's my attempt to make something sound a bit musical with the remaining notes. It's not a recognisable tune!
Top Comments