Rushil Saraswat
Published © CC BY-ND

COVID-19 Prevention Badge

It is a batch which reminds you to maintain social distancing ringing and it also senses the temperature of the person standing near you.

IntermediateFull instructions provided639
COVID-19 Prevention Badge

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
Resistor 47.5 ohm
Resistor 47.5 ohm
Its 4.7 k ohm
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Adafruit Waterproof DS18B20 Digital temperature sensor
Adafruit Waterproof DS18B20 Digital temperature sensor
×1
Coin Cell Battery CR2032
Coin Cell Battery CR2032
×2

Software apps and online services

Arduino Web Editor
Arduino Web Editor

Hand tools and fabrication machines

Tape, Clear
Tape, Clear

Story

Read more

Custom parts and enclosures

The 3D Model

This is the 3D model.

Schematics

The Schematics

This is how the components are wired.

Code

The code

C/C++
This is the code
#include <OneWire.h>

#include <OneWire.h>
#include <DallasTemperature.h>
int buzzer = 8;
int const trigPin = 10;
int const echoPin = 9;



int temp_sensor = 2;

float temperature = 0;
int lowerLimit = 15;
int higherLimit = 38.5;
OneWire oneWirePin(temp_sensor);
DallasTemperature sensors(&oneWirePin);
void setup(void){
  pinMode(trigPin, OUTPUT); 
	pinMode(echoPin, INPUT); 
	pinMode(8, OUTPUT);
  Serial.begin(9600);
  
 

  sensors.begin();
}
void loop(){
int duration, distance;
digitalWrite(trigPin, HIGH); 
	delay(1);
	digitalWrite(trigPin, LOW);
	
	duration = pulseIn(echoPin, HIGH);
	distance = (duration/2) / 29.1;
	if (distance <= 50 ) {
    	// Buzz
    	digitalWrite(8 , LOW);
    } else {
    	// Don't buzz
    	digitalWrite(8 , HIGH);
    }
    // Waiting 60 ms won't hurt any one
    delay(60);
  Serial.print("Requesting Temperatures from sensors: ");
  sensors.requestTemperatures(); 
  Serial.println("DONE");
  
  temperature = sensors.getTempCByIndex(0);
  ;
  Serial.print("Temperature is ");
  Serial.print(temperature);

if(temperature <= lowerLimit){ 
    Serial.println(", You are safe."); 
     digitalWrite(8, LOW);} 

 
else if(temperature >= higherLimit){
    Serial.println(", COVID-19 detected");
    digitalWrite(8, HIGH);
}
delay(250);
}

Credits

Rushil Saraswat

Rushil Saraswat

0 projects • 18 followers

Comments