Introduction

Nowadays, all air-conditioning systems contain temperature management systems to maintain a constant temperature inside the room. This system measures the temperature with the help of a temperature sensor. This sensor works like a thermometer.
In this article, you will learn about how to create a digital thermometer using the Arduino microcontroller board.
Prerequisites for developing this system
Hardware requirements
Hardwares Nos
Arduino UNO 1
DHT11 Temperature sensor 1
10k ohm potentiometer 1
10k ohm Resistor 1
LCD crystal display 1
220-ohm resistor 1
Breadboard -
Connecting wires -
Software requirements
In this experiment, we can do three stages of work for creating Digital Room Thermometer:
1. Connect all hardware
2. Write & upload code to Arduino board
3. Test our developed system
Stage 1 [Connecting all hardware’s]

Step 1
First, we can connect the LCD crystal display with the Arduino UNO board using Jumper wires. I am using a breadboard to extend power terminals for making this system.
Refer to the below LCD crystal Pin diagram for making an easy connection with Arduino

Place a 10K ohm potentiometer near the LCD crystal display. It can adjust the contrast of the LCD screen and create a power connection from Arduino +5V and GND right and left end of the potentiometer. Make a connection from the center terminal of the potentiometer to VEE (contrast control) LCD crystal display. (Refer to the connection diagram)
Pin Configuration
Arduino Breadboard LCD Crystal Display
Pin 3 ---------------------------------------------------------------------------> Data pin 4
Pin 4 ---------------------------------------------------------------------------> Data pin 5
Pin 5 ---------------------------------------------------------------------------> Data pin 6
Pin 6 ----------------------------------------------------------------------------> Data pin 7
Pin 8 ----------------------------------------------------------------------------> Register select
Pin 7 ----------------------------------------------------------------------------> Enable
+ 5V -----------------> Potentiometer Right Terminal-------------------->Potentiometer Centre terminal ----> VEE (Contrast Control) LCD crystal
+5V ---------------------------> 220-ohm Resistor -------------------------> LED +5V pin [LCD Crystal]
GND ------------------------------------------------------------------------------->Potentiometer Left terminal, Ground pin & LED - Ground pin [Connect to both pin]
Step 2
Next, DHT11 Temperature sensor to Arduino board as per below pin Configuration.
Pin Configuration
DHT11 temperature sensor Arduino
VCC ----------------------------------------------------------------> +5V
DATA <------------------------- 10 K ohm ---------------------- +5V
DATA --------------------------------------------------------------> Pin2
GND ----------------------------------------------------------------> GND
Stage 2 [Write & upload code to Arduino]
In this step, write code for Arduino using the Arduino IDE.
  1. Download Arduino software using this link here.
  2. Install and open an Arduino IDE in your PC/Laptop
  3. Connect your Arduino board to your computer using a USB data cable
  4. Copy and paste below the code into the Arduino IDE
    1. #include "LiquidCrystal.h"
    2. #define DHTPIN 2
    3. #define DHTTYPE DHT11
    4. #define LCD_PIN_RS 8
    5. #define LCD_PIN_E 7
    6. #define LCD_PIN_DB4 3
    7. #define LCD_PIN_DB5 4
    8. #define LCD_PIN_DB6 5
    9. #define LCD_PIN_DB7 6
    10. LiquidCrystal lcd(LCD_PIN_RS,LCD_PIN_E,LCD_PIN_DB4,LCD_PIN_DB5,LCD_PIN_DB6,LCD_PIN_DB7);
    11. #include "DHT.h"
    12. DHT dht(DHTPIN, DHTTYPE);
    13. void setup() {
    14. Serial.begin(9600);
    15. dht.begin();
    16. lcd.begin(16, 2);
    17. lcd.print("C#corner");
    18. lcd.setCursor(0,1);
    19. lcd.print("Humid Temp Sys");
    20. delay(2000);
    21. }
    22. void loop() {
    23. delay(2000);
    24. float h = dht.readHumidity();
    25. float t = dht.readTemperature();
    26. float f = dht.readTemperature(true);
    27. if (isnan(h) || isnan(t) || isnan(f)) {
    28. lcd.print(F("Failed to read from DHT sensor!"));
    29. return;
    30. }
    31. lcd.clear();
    32. lcd.setCursor(0,0);
    33. lcd.print("Temp: ");
    34. lcd.print(t);
    35. lcd.print(F(" °C "));
    36. }
Save and upload this code to the Arduino UNO board. After Code upload is completed, our digital thermometer starts to read the temperature :).
Stage 3 [Test our developed system]
Our developed digital thermometer using Arduino is working perfectly. Now, this digital thermometer displays a normal room temperature.
Next, I am placing a DHT11 temperature sensor near the laptop cooling vent, and the temperature has drastically increased.

Conclusion

In this article, we studied how to create a digital room thermometer using Arduino UNO R3.