Project showcase
Covid-19 quick distance mesurement

Covid-19 quick distance mesurement © GPL3+

Indicates the distance between people

  • 3,597 views
  • 0 comments
  • 12 respects

Components and supplies

About this project

I made a little box allowing to know is other people are enough far or not.

This is a very simple project, it took me 2 hours and the longer time was makeing holes in the platic box.

Here are some photos


Code

Covid19Arduino
this code is a simple code with fixed values (red for lower than 100 cm, yellow for lower than 150 cm and green for other distance)
// covid-19 denis fournier 2020-05-02
// V 1.0

// Digital pins of arduino nano
int trig = 4, echo = 5, LedRed=7, LedYellow=8 , LedGreen=9;
long lecture_echo, cm;

void setup()
{
  pinMode(trig, OUTPUT);
  digitalWrite(trig, LOW);
  pinMode(echo, INPUT);
  pinMode(LedRed,OUTPUT);
  pinMode(LedGreen,OUTPUT);
  pinMode(LedYellow,OUTPUT);  
  Serial.begin(9600);

}

void loop()
{
  digitalWrite(trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(trig, LOW);
  lecture_echo = pulseIn(echo, HIGH);
  cm = lecture_echo / 58;
  Serial.print("Distance en cm : ");
  Serial.println(cm);

  digitalWrite(LedRed,0);
  digitalWrite(LedYellow,0);
  digitalWrite(LedGreen,0);
  if (cm)
  {
      if (cm < 100)
         digitalWrite(LedRed,1);
      else
      {
          if (cm < 150)
              digitalWrite(LedYellow,1);
          else
              digitalWrite(LedGreen,1);
      }
  }
  else
     digitalWrite(LedGreen,1);
  delay(100);
}

Schematics

covid19 schema
covid19_AYD69qPpL5.fzz
Covid schema
Covid19 bb lppg8l5nvp

Comments

Similar projects you might like

COVID-19 Ultrasonic Distance Warning Tool

Project tutorial by DL1EKM

  • 9,409 views
  • 1 comment
  • 20 respects

COVID-19 Simple Friendly Social Distance Robot Watchzi

Project tutorial by draakje156

  • 6,140 views
  • 0 comments
  • 6 respects

Safe Distance Protection Badge

Project tutorial by filipmu

  • 9,373 views
  • 2 comments
  • 36 respects

Connected Visor

Project in progress by Yayi Make

  • 7,036 views
  • 4 comments
  • 16 respects

Touchless faucet with door control system for COVID-19

Project tutorial by Rucksikaa Raajkumar

  • 12,660 views
  • 15 comments
  • 38 respects
Add projectSign up / Login