In Part I of this series, we demonstrated how to display analog sensor data (value), such as POT or LM35, on a TFT LCD. A TFT is a thin-film transistor display (typically, a television screen or computer monitor) that’s of much higher quality than a regular LCD display.
In this article, we’ll explain how to display the temperature, humidity, and soil moisture on a TFT LCD. We’ll use a digital humidity and temperature (DHT) sensor for measurement. It’s a smart sensor that detects room temperature and humidity and provides digital readings and value outputs. Arduino will then attain these digital values from the sensor and displays them on the TFT LCD.
The soil moisture sensor we’ve chosen is also an analog sensor. It provides an analog voltage output from 0 to 5V as moisture changes in the soil. Arduino will read the analog voltage and convert it into a digital value to display.
Ultimately, the three parameters — temperature, humidity, and soil moisture — are displayed simultaneously on the TFT LCD.
Circuit connections
The soil moisture sensor has three interfacing pins: VCC, GND, and A0. Arduino provides the VCC pin with 5V. The GND pin connects to the common ground. The A0 pin is the sensor output pin’s analog voltage. It connects to Arduino’s A0 pin.
The DHT11 also has three interfacing pins: VCC, GND, and OP. Arduino provides the VCC pin with 5V. The GND pin connects to the common ground. The OP pin connects to Arduino’s D2 pin. The 10K pull-up resistor connects with the VCC and OP pins (as shown).
The TFT LCD has eight pins in total and works on the SPI protocol. Its pins connect with Arduino’s SPI pins.
The circuit is fully powered by Arduino 5V supply output. Arduino receives power from a computer’s USB port, so no additional power supply is needed.
Circuit operation
The soil moisture sensor’s probe detects the soil moisture content. If there’s an increase in moisture content, its resistance decreases. The sensor module provides an analog voltage output corresponding to any change in this resistance (which reflects a change in soil moisture).
This analog voltage output is read by Arduino and converted into a digital value from 0 to 1023, and then into a percentage between 0 to 100% and an integer number. Next, it’s converted into a string and then an array of characters because the TFT LCD can only display characters.
The DHT sensor provides direct digital values of the room’s humidity and temperature. Both values are also converted into a string and then an array of characters.
All three values are displayed on the TFT LCD as:
- Temperature in oC
- Humidity in % RH (relative humidity)
- Moisture in %.
Again, the values are displayed as characters on the TFT LCD.
Arduino has a TFT library (“TFT.h”), which is used along with two other libraries (“SPI.h” and “wire.h”).
The Arduino TFT library has direct functions to display the TEXT, graphics, images, etc. It can also display various colors on the TFT LCD. As the TFT LCD works on an SPI, an SPI and wire library are also required.
Software program
An overview of the circuit…
A YouTube video link for this article is available here.
In the next article of this tutorial series, we’ll learn how to measure and display the distance on a TFT LCD using the UDM sensor, HC SR04.
You may also like:
Filed Under: Electronic Projects, Sensors
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.