Introduction: LED Light Triggered by Ultrasonic Sensor
Original Source: https://www.arduino.cc/en/Tutorial/BuiltInExamples...
In the source, the author uses an ultrasonic sensor to detect distances. The idea is great and easy to understand, but his product lack usage. Therefore, I decided to add LED lights to the original product. The author of the original source coded and drew the circuit diagram of the ultrasonic for me. To extend, I coded the LED light to turn it on when the ultrasonic detects a distance lower than 30 centimeters. Moreover, I modified the original circuit diagram to fit our ultrasonic sensor; I also created the circuit of the LED light. I must modify the original circuit diagram as the author's ultrasonic sensor varied from ours. I need to create a new circuit from LED light to fit my new codings. My extended codings and circuit create a purpose for this new product and make it better.
Modified Code: https://create.arduino.cc/editor/derrick_0723/2398...
Supplies
1. Dedicated wiring*1: used to connect Leonardo Board to the computer for uploading code.
2. Leonardo Board*1: used to run code.
3. Wires*8: used to connect LED light and ultrasonic sensor.
4. LED light*1: used to shine when the ultrasonic sensor detects distances.
5. Ultrasonic Sensor: used to detect distances.
6. Computer: used to code your Leonardo Board.
Step 1: Download Code
1. Download the code from the original source: https://www.arduino.cc/en/Tutorial/BuiltInExamples...
The original source is using an ultrasonic sensor to detect distances.
Step 2: Modify Code
Modify the original code by adding an output, which is the LED light for me. The output can give the product usage and purpose.
Step 3: Modify Circuit
Modify the original circuit.
1. The author of the original source uses a different ultrasonic sensor, which only has 3 wires to connect. Mine has 4 wires to connect, shown in the second picture. The SIG wire in the original source is split into 2 in my product. Therefore I connect my wires to pin 6&7, where the original author only connect to 7.
2. Because I added an LED triggered by the ultrasonic sensor, I added a LED in my circuit.
Step 4: Decorate/Upload Code to Computer
Decorate your final product and upload your code then you're finished!
Step 5: My Final Product
Youtube Link: https://youtu.be/qLPDCt4acZM



