Boyler88
Published © GPL3+

Counting and taking temperatures for You

Counting people coming in and out of a room with a traffic light system and taking their temperatures

IntermediateFull instructions provided1,764
Counting and taking temperatures for You

Things used in this project

Hardware components

Breadboard (generic)
Breadboard (generic)
×1
Resistor 100 ohm
Resistor 100 ohm
×2
Resistor 221 ohm
Resistor 221 ohm
×1
5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Green
5 mm LED: Green
×1
PIR Sensor, 7 m
PIR Sensor, 7 m
×2
RGB LCD Shield Kit, 16x2 Character Display
RGB LCD Shield Kit, 16x2 Character Display
×1
Female/Female Jumper Wires
Female/Female Jumper Wires
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Rotary Potentiometer, 10 kohm
Rotary Potentiometer, 10 kohm
×1
Buzzer
Buzzer
×1
MLX90614 non-contact sensor 3.3 V
×1
Arduino UNO
Arduino UNO
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
This needed to solder the MLX Temp sensor

Story

Read more

Schematics

Counter on TinkerCad

this is a diagram of the counter minus the MLX temp sensor wired in

Add this to the Tinker Cad diagram and get it working with Code

Code

Counting for You

Arduino
Read Understand and make it your own
#include <LiquidCrystal.h>
#include <Wire.h>
#include <Adafruit_MLX90614.h>
int in = 15;// Analog Pin A1 Signal for Sensor 
int inpr = 16;// Analog Pin A2 Power for Sensor
int out = 14;// Analog Pin A0 Signal for Sensor
int outpr = 17;// Analog Pin A3 Power for Sensor
int ppl = 0;// declare ppl false
int buzzer = 9;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
bool pplin = 0;// false 
bool pplout = 0;// false
int temp = 0;// temp starting point 
const float alert_temp = 38.0;// alarm setpoint
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
void setup() {
  Serial.begin(9600);
  Serial.println("B00123587 Project");  /// display on serial monitor
  pinMode(15, INPUT);// Analog Pin A1 Signal for Sensor
  pinMode(14, INPUT);// Analog Pin A0 Signal for Sensor
  pinMode(16, OUTPUT);// Analog Pin A2 Power for Sensor
  pinMode(17, OUTPUT);// Analog Pin A3 Power for Sensor
  pinMode(6, OUTPUT);//LED entry
  pinMode(7, OUTPUT);//LED no entry
  lcd.begin(16, 2);
  mlx.begin();  
}

void loop() {
  digitalWrite(outpr, HIGH);// Analog Pin A2 Power for Sensor High
  digitalWrite(inpr, HIGH);// Analog Pin A3 Power for Sensor High
  pplin = digitalRead(in); //people in
  pplout = digitalRead(out);//people out
  if (pplin == 1){ // pplin true 
    ppl--;//changes value
    delay(500);
  }
  else if (pplout == 1){//pplout true
    ppl++ ;//changes value
    delay(500);
  }
  ppl = constrain(ppl, 0, 50);//sensor range
  lcd.setCursor(0, 0);//what LCD has to do
  lcd.print("People In:");
  lcd.setCursor(11, 0);//what LCD has to do
  lcd.print(ppl);
  if (ppl >= 5){//cut off point for entry
     lcd.setCursor(0, 1);//what LCD has to do
     lcd.print("PLEASE   WAIT");
    digitalWrite(6, LOW);//Green LED off
    digitalWrite(7, HIGH);//Red LED on
    }
    if (ppl >=6){//pplout true
    tone(buzzer,450);///HZ
     delay(500);
     noTone(buzzer);
     delay(500);
    
    }
    
  if (ppl <= 4){// less than 4 ok for entry
     lcd.setCursor(0, 1);// What LCD has to do
     lcd.print("Safe to enter");
    digitalWrite(7, LOW);//Green LED on
    digitalWrite(6, HIGH);// Red LED off
    noTone(buzzer); ////
     delay(500);
  }
   lcd.setCursor(14,0);// display section of temperature 
  Serial.print(mlx.readObjectTempC());//read the sensor
  Serial.println("*C");// print in degrees celsius
  lcd.print(mlx.readObjectTempC());// print temp on screen
  Serial.println();
  delay(500);
  temp = (mlx.readObjectTempC());
   if (temp >= alert_temp){/// buzzer alarm if greater than 38 degrees 
   tone(buzzer,450);///HZ
     delay(500);
     noTone(buzzer);
     delay(2000);
   } 
}

Credits

Boyler88
0 projects • 1 follower

Comments