Saturday 23 February 2019

GPS clock

Date of completion: 2018

This GPS clock was designed to replace the radio controlled clock mentioned in another blog post. The radio signal from Cumbria was rather weak and unpredictable, whereas the GPS signal near a window is much more dependable. I enhanced it a few years later to incorporate the church alarm receiver, also mentioned in an earlier post. Not only does it indicate if the church alarm is sounding (by lighting a green LED in the side of the device - the red LED flashes every 2 seconds to indicate a signal has been received from the church tower 100 yards away), but also how close to the hour the church bell rings. (e.g. the "-9s" in the photo indicates that the bell last sounded just 9 seconds late - not bad for a church clock built in 1850!)

Photos

Design

The design of the church alarm receiver is described in an earlier post, but suffice it to say it uses a cheap 433MHz receiver and HT12D decoder with a 17.3 cm aerial (a bit bent in the photo.)
The GPS unit came from Ebay and its 3 volt RS232 signal (at a baud rate of 9600 bps) is connected to a PIC 16F628A microprocessor (running at 5V), which drives a 16 character LCD display. The PIC decodes the data from the GPS unit to display the time in hours, minutes and seconds, and the current date. Like my earlier radio-controlled clock, the PIC can continue to display the correct date and time for a short while, even if the GPS signal is lost. I have included a table to switch between Greenwich mean time and British Summer Time on the correct dates each year. I think it should currently run correctly until 2026 or so. After that I will need to program the PIC with new data for future dates!
The church bell signal is compared to the GPS time every hour between 4 minutes before and 4 minutes after the hour. This reduces possible confusion with  spurious sounds due to the church alarm sounding (a rare event) or the bell ringers practising (a regular event!)

Circuit Diagrams


Tiny CAD (.dsn) files: GPSClock

Source code and other files

GPSClockX.asm  All files (.zip)

No comments:

Post a Comment