From GPS to Pi

A project log for GPS (or not) chime clock

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

Nick SayerNick Sayer 03/09/2020 at 03:210 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.