Twitter icon
Facebook icon
LinkedIn icon
Google icon
Reddit icon
StumbleUpon icon
Del.icio.us icon

Social distancing Device for COVID-19 Pandemic

Added to IoTplaybook or last updated on: 10/16/2020
Social distancing Device for COVID-19 Pandemic

Story

This is a very simple Project. In this I used following components:

  • IR Sensor(Infrared Sensor)
  • Liquid Crystal I2C Display
  • Jumper Wires
  • Arduino UNO
  • BreadBoard

I had fewer materials so I used what I was having.

Things used in this project

Hardware components

 
Adafruit Ir Sensor
 
× 1

 

Amazon

I2C 16x2 Arduino LCD Display Module
DFRobot I2C 16x2 Arduino LCD Display Module
 
× 1

DFRobot

Arduino UNO Wifi Rev.2
Arduino UNO Wifi Rev.2
 
× 1

Arduino

Breadboard (generic)
Breadboard (generic)
 
× 1

Newark

SparkFun

Male/Female Jumper Wires
Male/Female Jumper Wires
 
× 1

Newark

Adafruit

Software apps and online services

Arduino IDE
Arduino IDE
 
  Arduino

Code Explanation:

1.)Libraries for the Project

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

2.) Setting the LCD address

LiquidCrystal_I2C lcd(0x27,20,4); 

3.)Setup

void setup(){  lcd.init();                      // initialize the lcd  
lcd.init();  
lcd.backlight();  
lcd.clear();}

4.)Loop

void loop(){  
if(digitalRead(7)==0){  
delay(1000);  
lcd.clear();  
lcd.setCursor(0, 0);  
lcd.print("You are Safe!");}  
if(digitalRead(7)==1){        
lcd.setCursor(0, 0);    
lcd.print("You are'nt Safe!");    }

Schematics

Circuit Diagram

This is how you must do the connections

Code

Code

C/C++

Code for the project

 

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup()
{
  lcd.init();                      // initialize the lcd 
  lcd.init();
  lcd.backlight();
  Serial.println(digitalRead(7));
  lcd.clear();
}


void loop()
{
  if(digitalRead(7)==0)
{
  delay(1000);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("You are Safe!");
}
  if(digitalRead(7)==1){
    
    lcd.setCursor(0, 0);
    lcd.print("You are'nt Safe!");
    
}

Credits

3956

  3956

 

 

 

Hackster.io

This content is provided by our content partner Hackster.io, an Avnet developer community for learning, programming, and building hardware. Visit them online for more great content like this.

This article was originally published at Hackster.io. It was added to IoTplaybook or last modified on 10/16/2020.