chipKIT® Development Platform

Inspired by Arduino™

HVhACk (the h is silent) -- Max32 based Thermostat

Created Fri, 09 Mar 2012 09:03:33 +0000 by owendelong


Fri, 09 Mar 2012 09:03:33 +0000

Project updates are usually posted to Facebook. Photos of some of the progress are here:

[color=#0000FF] [/color]

Unfortunately, the project suffered a setback last night when my Max32 went infant mortality (no, i didn't short anything, but, yes, a small amount of the magic blue stuff escaped and the VR became a short. I am not sure of the order of those events, they were in close temporal proximity and not being carefully observed at the time).

I've returned the board to Amazon and the replacement should arrive tomorrow.

The electronic design and validation is 99%+ complete. The only thing remaining is to get hardware flow control working on the serial port I'm using to talk to the Bluetooth modem. (minor library surgery and possibly some hardware debugging to do). The microSD Card reader needs to be tested with the Max32, but, it's SPI and is working with the Arduino, so I don't anticipate any problems there. Everything else is running on the proto-board.

The Max32 at the heart of this will be stacked with an Ethernet Phy board and an additional custom-design board that will hold almost all of the additional components. The Bluetooth module and the MicroSD board will connect via header connectors (and possibly cables).

The physical housing is not yet designed.

The software is approximately 75% complete for version 1.0 and is complete enough to provide basic thermostat capabilities. It lacks any protections for short/long run times and the WatchDog is not yet operational, so, it should not run a real HVAC in unattended operation.

To do for version 1.0 of the software:

Scheduling Web control/config/programming interface SD Storage of control/config/programming information Watchdog timer Short/Long runtime safeties Circulate mode

Completed so far:

TFTLCD library ported to Max32 and operational Touchscreen library ported to Max32 and operational SoftButton library ported to Max32 and operational Hard Button library ported to Max32 and operational Basic UI is complete Clock is complete RTC integration is complete for Chronodot. DS1672 is written, will get tested after PCB is developed (unless I can find an old-fashioned large-form 32.768Khz crystal with sturdy pins appropriate for a breadboard) Ethernet Link state detection is working Ethernet time synchronization is working Setting RTC from ethernet time is working (Chronodot, DS1672 is written, but not tested) DHT22 Temperature/Humidity library ported and operational DHT22 Temperature/Humidity reads are working Temperature and Humidity displays are 95% working (small chroma problem to be addressed, not a blocking or critical bug) Hardware Failure monitors are fully functional for RTC, NET, SENSor, and BATtery (Battery backup for RTC) DOW is fully functional millis() wrap handling is written (not tested yet) The main loop() is generally complete and functioning.

Throughout the code, time is represented as Seconds Since Epoch (SSE) with an Epoch of midnight, 1 January, 1970 UTC. The Chronodot management routine does a BCD->SSE conversion when reading the Chronodot. Time in the Chronodot is stored as UTC. There is a #define for UTC Offest which will later become an SD configuration parameter.

DST is not handled, the UTC Offset must be manually updated.

When first ported to the Max32, the Arduino frame rate was between 250-1750 ms per frame. The Max32 was a pretty consistent 30 ms per frame. After the latest round of bug-fixes, optimizations and the like, the frame rate is now a pretty consistent 9ms with spikes to about 12ms when moving the clock hands or doing certain other tasks. The occasional read of the temperature sensor takes slightly longer.