Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Hackster is hosting Impact Spotlights: Industrial Automation. Watch the stream live on Thursday!Hackster is hosting Impact Spotlights: Industrial Automation. Stream on Thursday!
thepersonwhobuild
Published

Project hurrican

This is a project for maintaining social distancing with arduino uno

IntermediateFull instructions provided181
Project hurrican

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Buzzer
Buzzer
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Tape, Double Sided
Tape, Double Sided

Story

Read more

Schematics

schematics

Code

CODE

C/C++
to use simply copy paste it on your arduino ide
int trig = 9;
int echo = 10;
int b = 6;
void setup()
{
 pinMode (trig,OUTPUT); 
 pinMode (echo,INPUT); 
 pinMode (b,OUTPUT); 
}
void loop()
{
  digitalWrite (trig,LOW);
 delayMicroseconds (2);
  
  digitalWrite (trig,HIGH);
  delayMicroseconds (10);
  
  digitalWrite (trig,LOW);
  delayMicroseconds (2);
  
  int duration = pulseIn (echo,HIGH);
  int distance = duration*0.034/2;
  Serial.println (distance);
  if (distance<=182)
  
  {
    delay (500);
    digitalWrite (b,HIGH); 
  }
    else 
  {
    digitalWrite (b,LOW); 
  }
}

Credits

thepersonwhobuild
3 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.