Building a Temperature and Humidity Monitoring System with Arduino and Bluetooth Connectivity
In today’s world of smart devices and interconnected systems, the Internet of Things (IoT) is playing an increasingly prominent role in various aspects of our lives. From smart homes to industrial applications, IoT technology enables us to monitor and control our environment remotely with ease..
In this article, we’ll explore how to build a temperature and humidity monitoring system using an Arduino board, an LCD 16×2 display, and Bluetooth connectivity.
Just a temperature meter - Understanding the Components
- Arduino Board: Arduino serves as the brain of our project. It’s a microcontroller platform that allows us to write and upload code to control various electronic components.
- DHT11 or DHT22 Sensor: This sensor is capable of measuring both temperature and humidity with reasonable accuracy. It communicates with the Arduino board using a digital protocol.
- Bluetooth Module: We’ll use a Bluetooth module (such as HC-05 or HC-06) to establish a wireless connection between the Arduino and a smartphone.
Connect the Components

The DHT Library
The Code!
#include <SoftwareSerial.h> SoftwareSerial bt(8, 9); // RX, TX #include "dht.h" #define dataPin A0 dht DHT; int temp; int hum; void setup() { Serial.begin(9600); bt.begin(9600); } void loop(){ int readData = DHT.read11(dataPin); hum = DHT.humidity; temp = DHT.temperature; bt.print(temp); //send distance to MIT App bt.print(";"); bt.print(hum); //send distance to MIT App bt.println(";"); delay(500); }
The Application!
About this app
With this application you can connect an Arduino with temperature sensor and display Humidity and Temperature over your android phone or tablet. The connection diagram and the code are included
The Arduino sends through the Bluetooth serial the e temperature and the humidity with a string of numbers divided by comma. The application splits the received string and displays it on the screen. There is a button to convert the Celsius to Fahrenheit degrees and vice versa.
This project is about my 6th grade science project. An Arduino project that reads data from a DHT sensor (either DHT11 or DHT22) and displays temperature and humidity on a 16×2 I2C LCD screen. Additionally, there is a toggle button to switch between Celsius and Fahrenheit units. To enhance the system, there are two LEDs: a green LED for temperatures below 30°C and a red LED for temperatures above 30°C. Finally, the device cis equipped with a Bluetooth module (HC-05) to allow communication with a mobile app that displays the readings.
Arduino Uno
Breadboard
DHT 11 sensor
LCD 2x16 i2c
Bluetooth Module HC-05
Leds x 2
Tactile Button
Cables
#include <SoftwareSerial.h> SoftwareSerial bt(8, 9); // RX, TX #include "dht.h" #include <Wire.h> // Library for I2C communication #include <LiquidCrystal_I2C.h> // Library for LCD LiquidCrystal_I2C lcd = LiquidCrystal_I2C(0x3F, 16, 2); // Change if needed #define BUTTON_PIN 5 #define dataPin 10 dht DHT; int greenled = 4; int redled = 3; int temp; int hum; int buttonstate=0; int fahrenheit; int toggle =0; void setup() { lcd.init(); lcd.backlight(); Serial.begin(9600); bt.begin(9600); pinMode(redled, OUTPUT); pinMode(greenled, OUTPUT); pinMode(BUTTON_PIN, INPUT_PULLUP); digitalWrite(redled, HIGH); digitalWrite(greenled, HIGH); } void loop(){ buttonstate =digitalRead(BUTTON_PIN); int readData = DHT.read11(dataPin); hum = DHT.humidity; temp = DHT.temperature; fahrenheit = ((temp * 9) + 3) / 5 + 32; lcd.setCursor(0, 0); // Set the cursor on the first column and first row. if (buttonstate == LOW) { if (toggle == 0){ toggle =1; } else if (toggle == 1){ toggle =0; } } else { } if (toggle==0){ lcd.print("Temperature "); lcd.print(temp); lcd.print((char) 223);lcd.print("C"); } else if (toggle==1) { lcd.print("Temperature "); lcd.print(fahrenheit); lcd.print(" ");lcd.print("F"); } lcd.setCursor(0, 1); //Set the cursor on the third column and the second row (counting starts at 0!). lcd.print("Humidity "); lcd.print(hum); lcd.print("%"); bt.print(temp); //send distance to MIT App bt.print(";"); bt.print(hum); //send distance to MIT App bt.println(";"); Serial.print("Humidity: "); Serial.print(hum); Serial.print(" %, Temp: "); Serial.print(temp); Serial.print(" Celsius"); Serial.print(" "); Serial.print(fahrenheit); Serial.println(" fahrenheit"); if (temp > 30){ digitalWrite(redled, HIGH); digitalWrite(greenled, LOW); } else if (temp < 30){ digitalWrite(redled, LOW); digitalWrite(greenled, HIGH); } delay(500); }