LAB 4 - MINI PROJECT - TEMPERATURE SCANNING SYSTEM
LAB 4 - MINI PROJECT
TEMPERATURE SCANNING SYSTEM
Introduction
The main idea of this project is to develop an automatic temperature scanning system. The system is targeted to be set up at the front of a premise or business establishment. When a customer come, they have to measure their own body temperature using the system before stepping inside of the premise. If their temperature is below threshold, they may be given the permission to enter the premise without any restriction. However, if their body temperature exceeds the threshold, they may not enter the premise. The device is connected to a dashboard device on a smartphone via Wi-Fi connection to enable us to monitor the temperature reading.
Methodology
Components :
1 x ESP32 DEVKIT V1
1 x MLX90614 IR Temperature Sensor
1 x HC-SRO4 Ultrasonic Sensor
2 x LEDs (Green & Red)
1 x Piezoelectric Buzzer
2 x 220Ω Resistor
1 x 200Ω Resistor
1 x Breadboard
Software :
Blynk
Schematic
Figure 1: Temperature Scanning System Schematic |
Figure 2 : Temperature Scanning System Circuit |
Figure 3: Serial Monitor |
#include <Wire.h>#include <Adafruit_MLX90614.h>#define BLYNK_PRINT Serial#include <WiFi.h>#include <WiFiClient.h>#include <BlynkSimpleEsp32.h>
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
const int triggerPin=5;const int echoPin=18;const int greenLED=17;const int redLED=16;const int buzzer=4;
double temperature;long duration;int distance=0;
char auth[] = "xxx";char ssid[] = "xxx";char pass[] = "xxx"; BlynkTimer timer;
void PushTime() { Blynk.virtualWrite(V1, temperature);}
void setup() { pinMode(triggerPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(greenLED, OUTPUT); pinMode(redLED, OUTPUT); pinMode(buzzer, OUTPUT); Serial.begin(115200); mlx.begin();
delay(10); Serial.print("Connecting to "); Serial.println(ssid);
Blynk.begin(auth, ssid, pass); timer.setInterval(750L, PushTime);}
void loop() { Blynk.run(); timer.run(); digitalWrite(triggerPin, HIGH); delayMicroseconds(10); digitalWrite(triggerPin, LOW); duration=pulseIn(echoPin, HIGH); distance=duration*0.034/2; Serial.print("Temperature: "); Serial.print(mlx.readObjectTempC()+4); Serial.println("*C"); Serial.print("Distance: "); Serial.println(distance); temperature=mlx.readObjectTempC()+4; if(distance <= 8) { if(temperature > 38) { digitalWrite(redLED, HIGH); digitalWrite(buzzer,HIGH); delay(100); digitalWrite(redLED, LOW); digitalWrite(buzzer, LOW); delay(100); digitalWrite(redLED, HIGH); digitalWrite(buzzer,HIGH); delay(100); digitalWrite(redLED, LOW); digitalWrite(buzzer, LOW); delay(100); digitalWrite(redLED, HIGH); digitalWrite(buzzer,HIGH); delay(100); digitalWrite(redLED, LOW); digitalWrite(buzzer, LOW); delay(100); digitalWrite(redLED, HIGH); digitalWrite(buzzer,HIGH); delay(100); digitalWrite(redLED, LOW); digitalWrite(buzzer, LOW); delay(100); digitalWrite(redLED, HIGH); digitalWrite(buzzer,HIGH); delay(100); digitalWrite(redLED, LOW); digitalWrite(buzzer, LOW); delay(100); digitalWrite(redLED, HIGH); digitalWrite(buzzer,HIGH); delay(100); digitalWrite(redLED, LOW); digitalWrite(buzzer, LOW); delay(100); digitalWrite(redLED, HIGH); digitalWrite(buzzer,HIGH); delay(100); digitalWrite(redLED, LOW); digitalWrite(buzzer, LOW); } else { digitalWrite(greenLED, HIGH); digitalWrite(buzzer,HIGH); delay(200); digitalWrite(greenLED, LOW); digitalWrite(buzzer, LOW); delay(200); digitalWrite(greenLED, HIGH); digitalWrite(buzzer,HIGH); delay(200); digitalWrite(greenLED, LOW); digitalWrite(buzzer, LOW); delay(200); digitalWrite(greenLED, HIGH); digitalWrite(buzzer,HIGH); delay(200); digitalWrite(greenLED, LOW); digitalWrite(buzzer, LOW); } }delay(750);}
#include <Wire.h>#include <Adafruit_MLX90614.h>#define BLYNK_PRINT Serial#include <WiFi.h>#include <WiFiClient.h>#include <BlynkSimpleEsp32.h>
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
const int triggerPin=5;const int echoPin=18;const int greenLED=17;const int redLED=16;const int buzzer=4;
double temperature;long duration;int distance=0;
char auth[] = "xxx";char ssid[] = "xxx";char pass[] = "xxx"; BlynkTimer timer;
void PushTime() { Blynk.virtualWrite(V1, temperature);}
void setup() { pinMode(triggerPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(greenLED, OUTPUT); pinMode(redLED, OUTPUT); pinMode(buzzer, OUTPUT); Serial.begin(115200); mlx.begin();
delay(10); Serial.print("Connecting to "); Serial.println(ssid);
Blynk.begin(auth, ssid, pass); timer.setInterval(750L, PushTime);}
void loop() { Blynk.run(); timer.run(); digitalWrite(triggerPin, HIGH); delayMicroseconds(10); digitalWrite(triggerPin, LOW); duration=pulseIn(echoPin, HIGH); distance=duration*0.034/2; Serial.print("Temperature: "); Serial.print(mlx.readObjectTempC()+4); Serial.println("*C"); Serial.print("Distance: "); Serial.println(distance); temperature=mlx.readObjectTempC()+4; if(distance <= 8) { if(temperature > 38) { digitalWrite(redLED, HIGH); digitalWrite(buzzer,HIGH); delay(100); digitalWrite(redLED, LOW); digitalWrite(buzzer, LOW); delay(100); digitalWrite(redLED, HIGH); digitalWrite(buzzer,HIGH); delay(100); digitalWrite(redLED, LOW); digitalWrite(buzzer, LOW); delay(100); digitalWrite(redLED, HIGH); digitalWrite(buzzer,HIGH); delay(100); digitalWrite(redLED, LOW); digitalWrite(buzzer, LOW); delay(100); digitalWrite(redLED, HIGH); digitalWrite(buzzer,HIGH); delay(100); digitalWrite(redLED, LOW); digitalWrite(buzzer, LOW); delay(100); digitalWrite(redLED, HIGH); digitalWrite(buzzer,HIGH); delay(100); digitalWrite(redLED, LOW); digitalWrite(buzzer, LOW); delay(100); digitalWrite(redLED, HIGH); digitalWrite(buzzer,HIGH); delay(100); digitalWrite(redLED, LOW); digitalWrite(buzzer, LOW); delay(100); digitalWrite(redLED, HIGH); digitalWrite(buzzer,HIGH); delay(100); digitalWrite(redLED, LOW); digitalWrite(buzzer, LOW); } else { digitalWrite(greenLED, HIGH); digitalWrite(buzzer,HIGH); delay(200); digitalWrite(greenLED, LOW); digitalWrite(buzzer, LOW); delay(200); digitalWrite(greenLED, HIGH); digitalWrite(buzzer,HIGH); delay(200); digitalWrite(greenLED, LOW); digitalWrite(buzzer, LOW); delay(200); digitalWrite(greenLED, HIGH); digitalWrite(buzzer,HIGH); delay(200); digitalWrite(greenLED, LOW); digitalWrite(buzzer, LOW); } }delay(750);}
Comments
Post a Comment