Ultrasonic Distance Finder
by Kanjo Noel Ngarka in Circuits > Arduino
71 Views, 1 Favorites, 0 Comments
Ultrasonic Distance Finder
This project uses an ultrasonic sensor to detect distance ranges which is then indicated by the leds. So as the distance increases, the leds come ON progressively indicating the distances ranges. This project is applicable in cases like measuring hole depths, distance for ceiling to floor etc
Supplies
- Arduino uno or any
- Ultrasonic Sensor
- Leds
- Battery and connector
- Jumper wires
- 200 - 330 ohms resistors
Code
Here in the code we delclare the various pins for the ultrasoning Trig and Echo pins and set them as OUTPUT and INPUT respectively. then we also set the led pins as output
We then get the distance in the void loop and use it to turn on the leds progressively with each representing a given value of the distance