Login / Register

Networked Temperature Monitor – Part III

This is a 5″ 800×480 Graphic LCD with resistive touchscreen.

Got the monitor section working the way I want it, now on to SSR control.

The LCD and adapter shield are from Itead Studios, the EtherMega and protoshield from Freetronics via EpicTinker. The protoshield is used to re-position pins and house the DS18B20 interface and connector.

Some caveats:
Make sure you have a power supply capable of supplying at least 1 amp, power from the USB alone may not be sufficient, which caused the ethernet hookup to fail sporadically.

The software checks the on-board EEPROM for an initialized sensor array, and creates one if non-existent. Subsequent restarts use the EEPROM to initialize the sensor array. The EEPROM is also updated whenever you add a DS18B20 to the array, or modify the sensor name or temperature range.

This uses the same networked setup as previous versions, and has been setup for 12 sensors. You can modify the “high” and “wide” constants in the code (multiples of 8 work best) and the code will try to work out a “best fit” number of windows. Make sure you modify the “maxSensors” constant, and the sensor structures array to match the new count, and erase the EEPROM prior to the first run of the code.

This setup definitely requires a Mega2560 board or equivalent. I use the EtherMega, which has the W5100 baked right into the board, and uses the arduino ethernet library out of the box. This solves stacking problems caused by trying to add in a standard ethernet shield.

I mechanically moved the pins for the touchscreen from D2-D6 to D42-D46, and disconnected the pins for the on-board SD card on the LCD shield when I thought it was causing a conflict with the ethernet setup (turns out it was a power supply problem). My software reflects those changes, but may not be required.

The LCD shield requires plugging into all of the mega pins, and the 2×20 connector for the LCD board offers very little support, so some sort of support for the LCD board is suggested.

The 1.0.1 version of the Arduino IDE has a nifty String object library that has a major problem: the destructor doesn’t properly remove unneeded Strings, and has massive memory leaks, This quickly consumes all available SRAM and causes really weird problems. This is avoided by doing everything the old fashioned way with character arrays and direct supervision. Use String objects at you own risk if modifying this code.

The UTFT library is available here. I’ve added code to the DefaultFonts.c file that adds a minus sign to the SevenSegment font for temperatures below zero. Because of the way that the font structure is set up, this added 3000 bytes of code that is unused yet unavailable. My copy is available here

The EEPROMWriteAnything library is here

You may see some commented-out code and references to the touchscreen. This code will not work properly if compiled, as it requires a modified library that I’m still working on.

Finally here’s the code:
ITDB50_TempMonitor code.

1 comment to Networked Temperature Monitor – Part III

Leave a Reply