Colour graphic displays add a new dimension to how information gathered by an Arduino from sensors can be displayed. The TFT displays are also remarkably cheap compared to the LCD type.
In the Arduino sketch presented here the temperature and pressure values from a BMP180 (or BMP085) sensor are displayed in different colours according to the temperature and pressure, this means that not only do we become aware of the numerical value, but also the colour provides us with another direct visual indication.
In this example sketch as the temperature varies over the range 0 to 30 deg. C the font colour changes from blue through the colours of the rainbow to red. Similarly for pressure changes over the range 970 to 1030 millibars. Values below the set limits all appear blue and above the limit stay red.
The sketch could easily be adapted so the colour changes over a different range, or displays the temperature and pressure in different units.
Step 1: Libraries Needed and Connecting Up
I used an Arduino UNO and connected it to the display as described in my Instructable here:
The two libraries from that instructable also need to be loaded into your Arduino IDE. These libraries support the 1.8" TFT display with the Samsung S6D02A1 driver chip. A new library was added on 2/2/15 so the 2.2" TFT display with the ILI9341 chip can also be used.
The BMP180 (or BMP085) is an atmospheric pressure and temperature sensor. They are available cheaply via internet retailers, just search for "Arduino BMP180".
You will also need a library that supports the BMP085 or BMP180, I used the "Adfruit_BMP085" library, this is available from the Adafruit website but, for convenience, I have attached it here.
If the UNO has been used to run other sketches then it is a good idea to load the "Blink" example so that pins A4 and A5 are not driven to +5V by a resident sketch, this is because the BMP180 signal lines SDA and SCL should not be driven by an output set to +5V (logic 1).
The connections from the UNO to the sensor board are:
- UNO +5V to sensor board VCC
- UNO GND to sesnor board GND
- UNO pin A4 to sensor board SDA
- UNO pin A5 to sensor board SCL
Step 2: Loading the Sketch
The Arduino sketch needed is attached to this step.
In future I would like to create new screens that show graphical representations such as a thermometer and pressure dial. If I manage this then I will update this instructable at a future date.