OEL Microprocessor Systems
OEL Microprocessor Systems
OEL Microprocessor Systems
Components:
Arduino Uno R3: The microcontroller that controls the entire system.
DHT11 Sensor: A low-cost sensor that measures temperature and humidity.
16x2 LCD Display: Used to display the measured temperature and humidity values.
Resistors and Jumpers: Used to connect the components together.
Circuit Description:
1. Power Supply: The Arduino Uno R3 and the DHT11 sensor are powered by a 5V power
supply.
2. DHT11 Connection: The DHT11 sensor is connected to the Arduino's digital pin 2. The
DHT11 requires a 10kΩ pull-up resistor connected between the data pin and VCC.
3. LCD Connection: The LCD display is connected to the Arduino's digital pins according
to the standard LCD connection.
4. Communication: The Arduino communicates with the DHT11 sensor through the digital
pin 2 using a specific protocol.
5. Data Processing: The Arduino reads the temperature and humidity data from the DHT11
sensor, processes the data, and then sends it to the LCD display.
6. Display: The LCD displays the measured temperature and humidity values in a user-
friendly format.
Functionality:
1. The Arduino initializes the DHT11 sensor and the LCD display.
2. The Arduino sends a request to the DHT11 sensor to start a measurement.
3. The DHT11 sensor measures the temperature and humidity and sends the data back to the
Arduino.
4. The Arduino receives the data, processes it, and stores the values in variables.
5. The Arduino sends the temperature and humidity values to the LCD display.
6. The LCD displays the received values.
7. The process repeats continuously to provide real-time temperature and humidity readings.
Arduino Uno R3
54
EE-416 Microprocessor Systems
Department of Electrical Engineering | The University of Faisalabad
DHT11 sensor
16x2 LCD display
10kΩ resistor
Power supply
Jumpers
Read the temperature and humidity from the DHT sensor using
dht.readTemperature() and dht.readHumidity().
Check if the readings are valid. If not, display an error message on the LCD.
Clear the LCD and display the temperature and humidity values in a formatted
manner.
Add a suitable delay to control the refresh rate.
3. Simulation in Proteus:
Copy the Arduino code into the Arduino microcontroller in the Proteus workspace.
Power on the circuit in Proteus.
Observe the LCD display. The temperature and humidity values should be displayed.
Test the circuit by checking if the readings are accurate and updated periodically.
55
EE-416 Microprocessor Systems
Department of Electrical Engineering | The University of Faisalabad
Repeat the simulation and testing process until the circuit functions correctly.
Note:
Make sure to install the DHT.h and LiquidCrystal.h libraries in the Arduino IDE if they
are not already installed.
You can adjust the delay in the loop() function to control how often the temperature
and humidity are read and displayed.
This procedure provides a general guideline. The specific steps and code may vary
depending on the exact requirements and implementation details.
By following these steps, you should be able to successfully design, simulate, and implement
the temperature and humidity monitoring circuit using Proteus and Arduino.
56
EE-416 Microprocessor Systems
Department of Electrical Engineering | The University of Faisalabad
void setup() {
// Initialize LCD
lcd.begin(16, 2);
void loop() {
// Read temperature and humidity from DHT sensor
float tempC = dht.readTemperature();
float hum = dht.readHumidity();
57