Lab Evaluation 2 Process Finall
Lab Evaluation 2 Process Finall
Lab Evaluation 2 Process Finall
3 Working 12
4 Reference 14
PAGE 1
Chapter 1: Introduction
In this project, we have to create a room monitoring system. In which , our
target is to measure the average temperature and humidity in the room.
Also to count the number of persons entered in the room and left the room
that is to count the total number of persons in the room.
PAGE 2
Figure 1ESP32
PAGE 3
Figure 5BREADBOARD
PAGE 4
# DHT11 Sensor
#ESP32 Board
PAGE 5
.
Fig 1 ESP32 with Its Pin Function
ULTRASONIC:
The basic theory behind the operation of an ultrasonic sensor involves the
emission of high-frequency sound waves from a transmitter, which then
bounce off an object and return to a receiver. The time taken for the sound
wave to travel to the object and back is used to calculate the distance
between the sensor and the object.
There are various types of ultrasonic sensors available, including single- and
multi-element transducers, and sensors with different beam patterns. The
choice of sensor depends on the specific application, such as distance
measurement, obstacle detection, or level sensing.
PAGE 6
Overall, ultrasonic sensors are widely used in automation, robotics,
automotive, and security industries, among others, due to their non-contact
nature, high accuracy, and reliability.
PAGE 7
CODE:
#include <WiFi.h>
#include <DHT.h>
#define LED 2
uint32_t distance;
pinMode(trig,OUTPUT);
pinMode(echo,INPUT);
digitalWrite(trig,LOW);
delayMicroseconds(2);
digitalWrite(trig,HIGH);
delayMicroseconds(15);
digitalWrite(trig,LOW);
T = timetofly*0.034/2;
PAGE 8
int s1 = 0;
int s2 = 0;
unsigned long In = 0;
void setup() {
Serial.begin(115200);
delay(30);
pinMode(LED,OUTPUT);
dht[i].begin();
Serial.println();
void loop() {
float h=0;
float t=0;
h+= (dht[i].readHumidity()/3);
t+= (dht[i].readTemperature()/3);
PAGE 9
distance(13, 12, dist1);
delay(5);
delay(5);
s1=1;
if(s2==0){
Total = Total+1;
In = In + 1;
digitalWrite(LED,HIGH);
delay(150);
digitalWrite(LED,LOW);
delay(100);
s2=1;
if(s1==0){
Total = Total-1;
Out = Out + 1;
digitalWrite(LED,HIGH);
delay(150);
digitalWrite(LED,LOW);
PAGE 10
s1=0, s2=0;
delay(1000);
Serial.print(t);
Serial.print(h);
Serial.print(In);
Serial.print(Out);
Serial.print(Total);
delay(100);
PAGE 11
PAGE 7
PAGE 8
PAGE 9
Chapter 3 : Working
1. The code is written in C++ and runs on a microcontroller board
ESP32.
4. The PIR motion sensor is used to detect human motion within the
room.
6. The code then enters the main loop where it reads the sensor values
and publishes them to the Adafruit IO server. The PIR sensor is used to
determine if there is any human presence in the room. If there is, the
ultrasonic sensors are used to determine whether someone is entering or
leaving the room. The number of people entering and leaving the room is
tracked and the total number of people in the room is calculated.
PAGE 19
#Output :
PAGE 20
References:
2) ESP32 : https://en.wikipedia.org/wiki/ESP32 3) Fig 1 ESP32 with Its Pin
Functions : https://www.mischianti.org/wp-content/uploads/2021/07/ESP32-DEV
4) https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.javatpoint.com
%2Fmqttprotocol&psig=AOvVaw0VpmnHYAjXkMOyW8LM966C&ust=1682011
055300000&source=images&cd=vfe&ved=0CBEQjRxqFwoTCLCWsbq7tv4CFQA
AAAAdAAAAABAE
5) https://youtu.be/tQmXWNd1pNk
6)
7) Arduino ide examples
8) https://www.sciencedirect.com/topics/computer-science/passive-
infraredsensor#:~:text=A%20PIR%20sensor%20is%20an,in%20the%20form%20of%20r
adiation.
9) https://wokwi.com/projects/322410731508073042
PAGE 21