Close
0%
0%

GPS (or not) chime clock

A 5 note chiming clock that gets time from either GPS or WiFi/NTP (via Raspberry Pi)

Similar projects worth following
Starting from
$15.00
nsayer has 2293 orders / 162reviews
Ships from United States of America
This is yet another GPS clock project, but in this case, there is no display. All the clock does is play Westminster Quarters on 4 chimes using solenoids, and strikes out the hours using a fifth chime - more or less like the famous Tower Clock in Westminster with all of the modern conveniences.

This clock borrows quite heavily from my GPS Clock project - specifically the v3 hardware. Instead of the Maxim display mux chip, 5 pins of the ATTiny841 simply drive N channel MOSFETs that in turn drive solenoids to strike physical chimes.

Like the talking clock project, because this is an aural clock, the standards for accuracy are quite relaxed. Really all you get from this being GPS driven is not ever having to set the time.

A lot of the firmware from both projects is carried over to this one - the time zone manipulation, DST code and GPS chip management code, specifically. All of that code is very mature and functions the same way here. All we really have to do is strike the hour chime solenoid immediately after the PPS pulse on the correct second.

Unlike the talking clock, the rules for the quarters are more strictly copied from the real Tower Clock. The quarters are timed so that they end before the end of the 59th minute and the first hour chime is actually synchronized to the top of the hour.

The firmware has code for all 4 of the quarter hours, but all but the top-of-hour behavior are disabled by default (I found it to be just too annoying every 15 minutes). The clock also has support for quiet hours, when the clock will remain silent to avoid disturbing sleep. The timezone parameters and quiet hours can be adjusted via EEPROM, but the clock as designed has no user interface at all.

The primary power supply is 15 volts with enough current capacity to drive one solenoid at a time (15 watts is plenty). 15 volts is a bit higher than the 12 volts the solenoids are rated for, but this makes the solenoids operate faster, which makes the chiming sound better. The logic system runs at 3.3 volts because the GPS chip requires it and there's no reason not to run the 841 at that voltage. 3.3 volts is supplied by a beefy LDO. The LDO has to handle a rather large power dissipation due to the relatively high voltage drop. Whether to use an LDO or a buck converter is kind of a borderline call in this situation, but I went for an LDO just for reduced noise on the 3.3 volt rail. There's also a bulk cap on the input power just to take some of the edge of the surge current the solenoids are apt to demand, and to absorb any coil collapse power that makes its way back through the flyback diodes.

Pulsing the solenoids for about 20 ms with 15 volt power makes for a pretty good strike. The solenoids and chimes are mounted on a 3D printed frame. There's also a 3D printed head for the solenoids, since using plastic instead of metal makes for a more pleasant sound from the chimes.

Alternatively, instead of using GPS and a microcontroller for the chimes, one can use a Raspberry Pi Zero W. In this configuration, you just use 5 of the GPIO lines to control the solenoid MOSFETs. The Pi runs NTP over WiFi to get good time and runs a python script from cron to do the chiming. This time the daughterboard has an AP63205UW buck converter to generate 5 volts from the incoming 15 volts. The buck converter is used because the Pi Zero draws enough current to make the power dissipation of an LDO much more of a concern. For convenience there's also a console terminal interface on the board to provide console access over serial if necessary (though recent versions of Raspbian have the ability to bootstrap WiFi configuration and SSH access through the FAT boot partition, so there's much less necessity for this anymore).

Adobe Portable Document Format - 72.04 kB - 02/22/2020 at 19:24

Preview
Download

sch - 356.93 kB - 02/22/2020 at 19:23

Download

brd - 93.03 kB - 02/22/2020 at 19:22

Download

Adobe Portable Document Format - 51.69 kB - 02/22/2020 at 19:24

Preview
Download

- 256.97 kB - 02/22/2020 at 19:23

Download

View all 6 files

  • From GPS to Pi

    Nick Sayer03/09/2020 at 03:21 0 comments

    The 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

    Nick Sayer02/22/2020 at 18:49 0 comments

    I 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

    Nick Sayer02/22/2020 at 18:42 0 comments

    I 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

    Nick Sayer02/22/2020 at 18:23 0 comments

    This 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

    Nick Sayer02/21/2020 at 18:05 0 comments

    It 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.

View all 5 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates