Sunday, 13 November 2016

Ultrasonic Range detector using Arduino and the SR04 Ultrasonic sensor

 

Step 1: Connecting the SR04 Ultrasonic Sensor to the Arduino

Connecting the SR04  Ultrasonic Sensor to the Arduino

Step 2: Parts List

1               Arduino uno R3, or any Arduino for that matter
1               SR04 Ultrasonic Sensor
1               breadboard
4               Jumper Wires

Step 3: Connect Ultrasonic Sensor to Arduino

Connect  Ultrasonic Sensor to Arduino
You Need 4 Jumper wires to conect the SR04 Ultrasonic Sensor to the Arduino:

1  From the SR04  VCC pin to the Arduino 5v
1 From the SR04  GND pin to the Arduino GND
1 From the SR04  TRG pin to the Arduino Digital pin 12
1 From the SR04  ECHO pin to the Arduino Digital pin 11



Next Step, load the Software library and sketches.

Step 4: Step 4 Download SR04 Library and install to Arduino IDE

 DOWNLOAD HERE

Step 4 Download SR04 Library and install to Arduino IDE
 

You should now be able to see the  library and examples in  select File > Examples > NewPing > NewPingexample sketch.
load the sketch to your Arduino.

If you were successful at installing the libraries, and loading the NewPingexample sketch,  Compile the sketch  by clicking on the verify button and make sure there are no errors.

It's time to connect your Arduino to your PC using the USB cable.  Click on the upload button  to upload the sketch to the Arduino.

Once uploaded to the Arduino, open the serial monitor, and you should see the distance  data stream   coming from the sensor. 
 
 
DO SHARE AND LIKE AND COMMENT FEEL FREE TO POST DOUBTS

No comments:

Post a Comment