WAZIRI UMARU FEDERAL POLYTECHNIC
BRINNI KEBBI,KEBBI STATE
DEPARTMENT OF COMPUTER ENGINEERING
INTRODUCTION TO MICRO AND ASSEMBLY LANGUAGE
LAB MANUAL (CTE 241)
TEMPERATURE AND HUMIDITY SENSOR
BY:
Engr. Umar Yahaya
Department of Computer Engineering
Name of the Studen:_________________________________________
Matric No:______________________________________________________
Year/Sem/Class:_________________________________________________
OBJECTIVE:
To simulate the operation of a temperature and humidity sensor (such as
DHT11/DHT22 or LM35) using the Proteus software and visualize sensor
readings on a display module or via serial communication.
SOFTWARE USED:
Proteus Design Suite (ISIS)
(Optional) Arduino IDE for writing and uploading code to a simulated
microcontroller
COMPONENTS USED (VIRTUAL - IN PROTEUS):
Microcontroller (e.g., Arduino UNO or ATmega328)
Temperature and Humidity Sensor (e.g., DHT11/DHT22 or LM35)
LCD (16x2) Display or Serial Monitor
Resistors (if needed)
Power Source (5V DC)
Virtual Terminal (if using UART/Serial output)
THEORY:
Temperature and humidity sensors like DHT11 and DHT22 are widely used in
weather monitoring systems. These sensors measure the surrounding air
temperature and relative humidity and send the data digitally. LM35 is another
popular sensor that provides analog output proportional to temperature.
Proteus Simulation allows designers to simulate embedded circuits before
physically implementing them. It supports simulation of Arduino and sensor
modules through HEX files or direct .ino (Arduino) code uploads.
CIRCUIT DIAGRAM:
(Include or describe the schematic here.)
Connections (Example: DHT11 with Arduino UNO):
DHT11 VCC → 5V
DHT11 GND → GND
DHT11 DATA → Arduino Pin 2
LCD RS → Pin 7
LCD EN → Pin 6
LCD D4–D7 → Pins 5–2 respectively
Potentiometer for contrast (if used)
PROCEDURE:
1. Write the Code
Use the Arduino IDE to write code to read temperature and humidity
from the sensor and display it on an LCD or serial monitor.
2. Compile and Generate HEX File
o Export the compiled .hex file from Arduino IDE (Sketch > Export
compiled Binary).
3. Create the Circuit in Proteus
o Place all components (Arduino, sensor, LCD).
o Connect them as per the schematic.
o Double-click on the Arduino module and load the .hex file.
4. Run the Simulation
o Click the 'Play' button in Proteus.
o Observe the LCD or virtual terminal displaying real-time
temperature and humidity values.
Sample Arduino Code (for DHT11 with LCD):
cpp
CopyEdit
#include <DHT.h>
#include <LiquidCrystal.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
void setup() {
lcd.begin(16, 2);
dht.begin();
}
void loop() {
float h = dht.readHumidity();
float t = dht.readTemperature();
lcd.setCursor(0, 0);
lcd.print("Temp: ");
lcd.print(t);
lcd.print("C");
lcd.setCursor(0, 1);
lcd.print("Hum: ");
lcd.print(h);
lcd.print("%");
delay(2000);
}
Observation / Results:
The Proteus simulation showed real-time changes in temperature and
humidity readings on the LCD.
The sensor provided stable and accurate digital outputs when simulated
properly.
Virtual input (if supported) can be used to vary temperature and humidity
values manually during simulation.
Conclusion:
The simulation successfully demonstrated how to interface a temperature and
humidity sensor with a microcontroller and visualize the readings. Proteus
provides a powerful platform for testing embedded systems before hardware
implementation.
CIRCUIT DIAGRAM
CODE