viniciuslindoss
Published © LGPL

Parking Sensor with Arduino

This parking sensor with Arduino is an easy project.

BeginnerShowcase (no instructions)1 hour30,443
Parking Sensor with Arduino

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Buzzer
Buzzer
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

hardware

Code

hardware

C/C++
// 6 trig , 5 echo
#include <Ultrasonic.h>
Ultrasonic ultrasonic(6,5);// 6 trig , 5 echo


const int buzzer = 7; // pin buzzer

void setup(){
 pinMode(buzzer,OUTPUT);

}

void loop(){
 int dist = ultrasonic.Ranging(CM);
if (dist < 100) {
  tone(buzzer,1000);
     delay(40);
   noTone(buzzer);
     delay(dist*4);
   }
 delay(100); 
} 

Credits

viniciuslindoss

viniciuslindoss

0 projects • 9 followers

Comments