I found a glockenspiel in the local recycling centre and decided to have a go at automating it after seeing details on the Raspberry Pi forum and also on the PICAXE website.
It’s quite a straightforward design, using motors to rotate the hammers downwards and then using a rubber band to lift the hammer upwards one the chime has been struck.
Programming this in Python is relatively straightforward – just allocate most of the GPIO outputs to controlling the motors and then trigger them sequentially. The motors are connected to the GPIO outputs using a pair of ULN2803 darlington driver IC’s. It’s quick but as we’ll see, not the best solution.
I haven’t yet found out how to make the software do a clean exit when CTRL-C is pressed – something to do with creating an exception and then using this to shut down the GPIO outputs. Without this, it’s possible to exit while the motors are energised meaning that the peak stall current is passed through the darlington drivers. I’ve had to replace a couple already.
When I design a PCB for this, I think I’ll use a bunch of discrete darlington transistors (BCX38C) along with a current limiting device.
Overall, the sound is pleasant to listen to. I’d like to refine the software and also include the possibility of using RTTTL ringtones. I’ll probably need to filter out sharps/flats and add some kind of a transpose function. Probably a challenge for later!