Introduction: Thermometer With Temperature Relative Colour on a 2" TFT Display and Multiple Sensors

I have made a display showing the measurements of several temperature sensors. The cool thing is that the colour of the values changes with the temperature:

> 75 degrees Celcius = RED
> 60 > 75 = ORANGE
> 40 < 60 = YELLOW
> 30 < 40 = LIGHTBLUE
< 40 = DARKBLUE

Step 1: The Reason

Our house is heated with central heating. The system is fed by a woordburning stove in the kitchen that feeds a 1000 liter buffer tank. From here the warm water is pumped to the floor heating and the radiators.

This works fine when at home but can be troublesome when I am away for a longer period. So we decided to add a automatic pellet burning heater which is also hooked up to the buffer tank in such a way that both systems can work together. It is important to know when to stop burning logs in the stove because overheating the buffer tank can occur. Obviously there are all kind of safety valves, but to prevent is always better.

I wanted a screen which measures the temperature in the tank at several levels so that we can see how much heat we have stored. Utimately the colour of the temperature should change with the value: red for very hot (> 75 degrees celcius to dark blue for cold, < 30 degrees.

Step 2: Materials Used

Arduino Uno
Four DS18b20 temperature sensors
1 4.7k Ohm resistor
A colour TFT display, I used this 2" display from Aliexpress
Wiring etc.

Step 3: Hooking It All Up

The four DS18b20 sensors are adressed through the one wire system. This saves a lot of connections to the Arduino and is pretty simple, see the picture. The resistor is added here.

Hooking up the display took more effort. It should (should....) work by clicking it as a shield, but this did not work. Some research showed me how to connect it through SPI ( no idea what that means though) using the following scheme:

VCC 5v
GND Ground
CLK D13
SDA D11
RS D9
RST D8
CS D10

Is used the ILI9225 library as this was mentioned on the packaging of the display. You can find the library here on Github.

All set I ran the samples from the library, all fine. Yeehaa!!!

Step 4: The Code

It took me a while to figure out how to draw text, lines etc. on a TFT screen. This turned out to be pretty simple. The code to make the text colour relative to the temperature was something else so I turned to the Arduino forums where a chap called "Wild Bill" helped me out. Kudo's!!

You can find the code here.

Step 5: Final Thoughts

This was a really cool project. I will now have to find a nice casing to make the thing look smart. I am not good at this. Any help / suggestions how to do this much appreciated

Wishlist:

- Add WIFI, should be simple with a ESP288 or Nodemcu; I have them laying around