This project uses an HC-SR04 ultrasonic sensor to measure the distance to an object. When an object comes within 10 cm of the sensor, an LED turns ON. If the object is farther away, the LED turns OFF.
This project introduces:
if-else)| Component | Quantity |
|---|---|
| Arduino Nano (or Uno) | 1 |
| HC-SR04 Ultrasonic Sensor | 1 |
| LED | 1 |
| 220Ω Resistor | 1 |
| Breadboard | 1 |
| Jumper Wires | As required |
| USB Cable | 1 |