That sounds like a fun project! Here's how you can create it:
Components Needed:
- Arduino Board (e.g., Uno, Nano)
- Ultrasonic Sensor (e.g., HC-SR04)
- 10 LEDs
- 10 Resistors (220Ω recommended for each LED)
- Breadboard and Jumper Wires
Concept:
You'll divide the distance detected by the ultrasonic sensor into 10 ranges. Each range will correspond to a specific LED being lit. For example, if the distance is between 0-10 cm, 1 LED will be on; if it's between 10-20 cm, 2 LEDs will be on, and so forth.
Circuit Diagram:
- Ultrasonic Sensor:
- VCC to 5V on Arduino
- GND to GND on Arduino
- Trig to a digital pin (e.g., Pin 9)
- Echo to a digital pin (e.g., Pin 8)
- LEDs:
- Connect the cathode (-) of each LED to GND through a 220Ω resistor.
- Connect the anode (+) of each LED to a digital pin on the Arduino (e.g., Pins 2-11).
Video Link: - Click Here For Video
Ultrasonic Distance Indicator simple Circuit: -
Arduino IDE Program
-----------------------------------------------------------------------------------------------------------------------------
Explanation:
- Trig Pin sends an ultrasonic pulse.
- Echo Pin receives the pulse that bounces back.
- The distance is calculated based on the time it takes for the pulse to return.
- The
map()
function converts the distance (from 0 to 100 cm) into a range from 0 to 10 LEDs.
Assembly:
- Build the circuit on the breadboard.
- Upload the code to your Arduino board.
- Test by placing objects at various distances from the ultrasonic sensor and observe the number of LEDs that light up.
Let me know if you need any adjustments or further help!
Share, Support, and Subscribe!!! 1. PRO KAM EXPLAINED 2. Knowledge KAM 3. PRO KAM Follow us on 1. Facebook 2. Instagram 3. Pinterest 4. Blogspot 5 Twitter If you have any other ideas to make me design, you can describe them in the comment section and if I can, I will make a designing video on it. So I am waiting #prokam #pro #IDM #Solutions #Hack
0 Comments