Controlling LED's Using Ultrasonic Distance Sensor

Turns the 2 LED's on and off by calculating the distance of the object from the Ultrasonic Sensor.

Jan 17, 2022

14109 views

1 respects

Components and supplies

1

Breadboard (generic)

1

5 mm LED: Red

1

Ultrasonic Sensor - HC-SR04 (Generic)

1

Male/Female Jumper Wires

2

Resistor 1k ohm

1

5 mm LED: Green

1

Arduino UNO

Tools and machines

1

Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires

Apps and platforms

1

Arduino IDE

Project description

Code

Code

c_cpp

This is the code of this project. Copy paste this code to your Arduino IDE.

Downloadable files

Circuit Diagram

This is the Circuit Diagram of this project. Assemble your project by following this circuit diagram.

Circuit Diagram

Circuit Diagram

This is the Circuit Diagram of this project. Assemble your project by following this circuit diagram.

Circuit Diagram

Comments

Only logged in users can leave comments

Immagine
Immagine

blackpanda856

2 years ago

Please follow me. Also subscribe to my You Tube channel for more project videos like this. You Tube : J4 JEVINS Link :- https://youtube.com/J4Jevins

Immagine
Immagine

Anonymous user

3 years ago

what will the code be for more than 2 leds?

Immagine
Immagine

blackpanda856

3 years ago

Please follow me. Also subscribe to my You Tube channel for more project videos like this. You Tube : J4 JEVINS Link :- https://youtube.com/J4Jevins