Project showcase
Covid-19 quick distance mesurement

Covid-19 quick distance mesurement © GPL3+

Indicates the distance between people

  • 251 views
  • 0 comments
  • 1 respect

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

No document.

Comments

Similar projects you might like

Open Source Pulse Oximeter for COVID-19

Project tutorial by Arduino “having11” Guy

  • 25,062 views
  • 13 comments
  • 85 respects

Covid-19 Coronavirus Doorbell

Project showcase by Roni Bandini

  • 13,333 views
  • 4 comments
  • 32 respects

Social Distance Detector

Project showcase by Anbu Kumar

  • 1,715 views
  • 3 comments
  • 13 respects

Windows 10 IoT Core: UltraSonic Distance Mapper

Project showcase by Anurag S. Vasanwala

  • 60,520 views
  • 23 comments
  • 157 respects

Arduino Mp3 player + Distance sensor = FUN

Project tutorial by javier muñoz sáez

  • 37,503 views
  • 34 comments
  • 63 respects

Simple Ultrasonic Distance Measurer With LCD Display

Project showcase by onatto22

  • 15,850 views
  • 6 comments
  • 37 respects
Add projectSign up / Login