Measure the distance to an object using the ultrasonic sensor and turn on the LED if the object is within a certain range
This project uses an ultrasonic distance measuring sensor to detect the distance of any object and accordingly turn on the LED light when the object is near the given range(defined) of the sensor and turn it off when the object moves far from the defined range
- UNO R3
- SENSOR
- Connecting Wires
- LED LIGHT= Here I have used the primary LED light given on the board itself
the sensor used is a ultrasonic distance sensor and has 4pins attached to
- Vcc
- trig
- eco
- Gnd
The connections are mentioned below accordingly
- led at pin 13 of uno
- eco pin of sensor to pin 10 of uno
- trig pin of the sensor to 9 of uno
- Gnd pin of the sensor to Gnd of Uno
- Vcc of sensor to 5V of uno
The light of the led will automatically turn high when the object would be in the defined range and it will automatically turn low when the object is outside of the given range


