-
From GPS to Pi
03/09/2020 at 03:21 • 0 commentsThe GPS variant of the clock worked, but for me, WiFi works better than GPS. And when I need to connect up to the network, I invariably reach for a Raspberry Pi Zero W. They're cheap and small, but powerful.
For the GPS variant, I used an LDO to derive 3.3 volts from the 15 volt power input. That was ok because the current requirements for the ATTiny and GPS chip were small enough that the high voltage drop didn't make for too much power dissipation. But for a Pi Zero, that's no longer a reasonable assertion. In the past, most of the buck converters I had used either had a low maximum input voltage, or were just controllers, and required external diodes and in some cases MOSFETs. However, for this project, I discovered the AP63205WU buck converter. It has a spectacularly wide input voltage range and a synchronous rectifier, so it only requires input and output capacitance, an inductor, and a single, small bootstrap cap. The result powers the Pi perfectly, so far as I can tell.
The MOSFET circuitry is almost the same as the GPS version, but I added pull-down resistors to the gates because most of the time the GPIO pins are in a high-impedance state and it was important to anchor the gates to the inactive state.
There's also a console interface that breaks out the serial pins on the Pi, including a diode-resistor level shifter to allow the RX pin to be 5v TTL safe.
Python support for Raspberry Pi GPIOs is particularly mature, so I wrote a little python script to actually do the chiming. It runs out of cron, and the script is set up to run in the minute before the quarter (so, 14,29,44,59). The script waits carefully for the correct second and then exercises the GPIOs to chime the same way as the embedded variant.
-
Mechanical arrangement
02/22/2020 at 18:49 • 0 commentsI thought long and hard about how to mount everything. The big issue is that the solenoid throw is parallel to its longest dimension. Unless I wanted to try and make some sort of hinged hammer this meant mounting the solenoids at a right angle to the chimes, meaning the whole arrangement was going to be quite wide. I wound up designing a 3D printed unit that had a shelf for mounting the solenoid and two arms from which to hang the chime. This meant the chimes were about 3 inches apart, so the whole thing wound up being about 17 inches wide. I went with a 20 x 8 inch piece of acrylic to which to mount them all along with the electronics (I couldn't 3D print everything as a single unit because of build area constraints).
-
Chimes selection
02/22/2020 at 18:42 • 0 commentsI made a bit of a mistake early on and bought a set of wind chimes pre-tuned for Westminster quarters. This was rather costly, and I threw away a lot of the value-add of the wind chime set (the wooden frame, sail and striker and stuff) and just kept the chimes themselves. Instead, the smart play would have just been to go the hardware store and buy a couple of lengths of half-inch copper tubing from the plumbing department and trim them to the correct lengths for tuning. Oh well.
You need 5 chimes to emulate the tower clock at Westminster. The notes traditionally are in the key of E, so E, F♯, G♯ and the B from the lower octave. Mine is more like E flat, so the notes are E♭, F, G and lower B♭. The fifth note is from the bell whose traditional name is "Big Ben" (the name refers to the hour bell itself, not the entire clock or tower). Big Ben is the E below the B, though my chime set has it as middle C for some reason.
The chimes I bought hang from holes drilled equidistant from one end, but that's not ideal. You'd preferably hang them from one of the nodes in the harmonic sequence for the note. One bit of advice I've seen is roughly 25% in from one end. To hang them evenly, you'd simply use different lengths of string so that the top ends line up. There is probably an optimal position to strike them as well, but I haven't bothered to try and research or optimize that, as that would require a more sophisticated method of mounting the solenoids.
-
Solenoid selection
02/22/2020 at 18:23 • 0 commentsThis is a bit of a retrospective log, since the project is basically finished at this point.
I didn't give a whole lot of thought to solenoid selection. I just brought up Adafruit and searched. There I found a 12 volt model with a spring return and just went with it.
One issue with bells and chimes is that you want to strike them with force, but you want the hammer to rebound after striking - that is, you don't want the hammer to dwell after the strike. So you really want to actuate the solenoid until the hammer is just about to strike the chime, let the momentum finish the stroke and let the rebound and spring return carry the hammer back.
Most school bells, in fact, have a switch in line with the solenoid coil power, and the switch is turned on when the hammer is back. The solenoid is thus energized long enough to move the hammer forward, which breaks the contact. The magnetic field and momentum are enough to have the hammer strike, but then return, whereupon the switch is closed and the cycle repeats.
I don't have the luxury of any feedback in the current design, so it's a matter of trial and error to get a pulse long enough for a proper throw, but short enough to let the hammer rebound and not continue to be driven forward.
For my mechanical design, that appears to be around 25-30 ms or so.
Unfortunately, these solenoids have a distinctive click-clack noise to them. I haven't really addressed that as of yet. One hope is that simply by adding a cover (my wife wants me to hide all the ugly wiring anyway) the clicking will be muffled somewhat while the chimes will still sound, as they'll extend out of the bottom of the box into free air.
-
An alternate way to go
02/21/2020 at 18:05 • 0 commentsIt only occurred to me way, way too late that another way to approach this project is with a Raspberry Pi Zero W. The add-on board would simply provide 5 volt power from the 15 volt primary supply and use 5 GPIO pins to drive the MOSFETs in the same way as the existing project.
The advantage to this would be that the lack of a user interface is less of a handicap (since you could ssh in), you could use WiFi and NTP instead of GPS, and the whole thing could be done with Python scripts.
Cost-wise it would be a wash, since the GPS hardware is about the same price as the Pi Zero W.