The GPS clock is a powerful feature not found on even the most expensive commercial thermostats. The extreme convenience of Bluetooth remote control is also not available commercially. To put this project in perspective, the total bill of materials cost (in single system quantity) is significantly lower than the cost of a high end, high volume commercial thermostat, and yet it implements a suite of features which are not matched by commercial systems. I'm not pretending this is a competitor for commercial systems, but it is definitely an accomplishment that could not have been achieved a couple of years ago. The latest version of PSoC Creator in conjunction with a critical mass of example applications has provided a quantum leap in productivity and accessibility to cost effective rapid development.

 

GPS Clock Video Demo

The following video shows the GPS clock on the right LCD and I have my Galaxy Note set to display the time from the local cell network for comparison.

http://www.element14.com/community/videos/10810/l/the-henrietta-project--gps-clock


This next video is an update to show the clock displayed with a large font. It is quite rare to see a digital wall clock with a font other than seven segments or some dot-matrix variant of seven segments. Little features like this can take significant effort but they help make the project more unique and hopefully more impressive. In my first attempt to implement this large font, I did not have enough RAM to make a frame buffer, and in the second attempt I did not have enough FLASH to store the font as bitmap images. Currently I have been able to reduce FLASH and RAM usage to 65% and 40% respectively. The program seamlessly switches to the smaller font when displaying sensor data and the full time and date.




Why does this thermostat project include GPS?

The Henrietta Project uses GPS to provide an accurate real time clock that never needs to be set. And it doesn't need batteries which always have a limited lifespan.

The thermostat does not need to keep track of time during a power outage as the furnace cannot turn on without mains power to run the fan.

 

Implementation

To make the u-blox GPS output time strings I send this command string to the GPS at 9600 baud:

$PMTK314,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0*36

 

The time string is sent from the GPS every second and it has this format:

$GPRMC,hhmmss.dd,S,xxmm.dddd,<N|S>,yyymm.dddd,<E|W>,s.s,h.h,ddmmyy

 

I am interested in hhmmss which are chars 7-12 and ddmmyy which are chars 60-65.

These correspond to hours, minutes, seconds and day, month, year Greenwich Mean Time.

So I have to subtract 5 hours to obtain my local time.

 

Conclusions

It takes a bit of research to figure out how to get the GPS to do what you want, and a little effort to parse the data and ensure it is valid, but the GPS I used has no trouble obtaining a GPS clock signal indoors, so the effort was well worth it. The first time gets sent about 15 seconds after power up, which is about the same time Henrietta gets through her wakeup blinking and winking exercise.

The GPS clock feature was the largest technical risk with the Henrietta project, but this also makes it the most satisfying accomplishment.

 

Next Steps

I expect my next update to cover the servo motor and door mechanism in more detail.

 

For more info on the Henrietta Project, which is entered in the Smarter Life Challenge, check these logs:

http://www.element14.com/community/videos/10631/l/smarter-life-challenge--the-henrietta-project-intro

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2013/12/15/smarter-life-challenge--the-henrietta-project

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2013/12/17/smarter-life-challenge--the-henrietta-project--touch-screen-subsystem

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2013/12/23/smarter-life-challenge--the-henrietta-project--personality-infusion

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2013/12/29/smarter-life-challenge--the-henrietta-project--wire-wrap-versus-jumpers

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2014/01/01/smarter-life-challenge--the-henrietta-project--bluetooth-operation

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2014/01/02/smarter-life-challenge--the-henrietta-project--furnace-interface

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2014/01/02/smarter-life-challenge--the-henrietta-project--light-sensor