Project showcase
Parking Sensor with Arduino

Parking Sensor with Arduino © LGPL

This parking sensor with Arduino is an easy project.

  • 17,431 views
  • 4 comments
  • 28 respects

Components and supplies

Apps and online services

About this project

This easy Arduino project makes a parking sensor.

#include <Ultrasonic.h> 
Ultrasonic ultrasonic(6,5); 
// pin 6 trig , pin 5 echo
const int buzzer = 7; 
void setup(){ 
pinMode(buzzer,OUTPUT); // pin buzzer
} 
void loop(){ 
int dist = ultrasonic.Ranging(CM); 
if (dist < 100) { distance
 tone(buzzer,1000); 
    delay(40); 
  noTone(buzzer); 
    delay(dist*4); 
  } 
delay(100);  
}  

Code

hardwareC/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); 
} 

Schematics

hardware
Untitled sketch bb2 fwdnejua03

Comments

Similar projects you might like

IOT - Smart Jar Using ESP8266, Arduino and Ultrasonic Sensor

Project tutorial by Team Smazee

  • 6,212 views
  • 4 comments
  • 12 respects

Ultrasonic Sensor with Alarm, LCD and Temperature

Project tutorial by MichDragstar

  • 4,645 views
  • 7 comments
  • 19 respects

Distance Sensor and OLED

Project tutorial by javier muñoz sáez

  • 22,053 views
  • 22 comments
  • 65 respects

How To Use DS18B20 Water Proof Temperature Sensor

Project showcase by Team IoTBoys

  • 35,337 views
  • 11 comments
  • 15 respects

Garage Parking Stop Light

Project showcase by Rich Noordam

  • 3,157 views
  • 1 comment
  • 12 respects

Parking Sensor

Project showcase by MrBancroft

  • 2,367 views
  • 0 comments
  • 10 respects
Add projectSign up / Login