Ultrasonic Sensor

by JoshuaE12 in Circuits > Arduino

446 Views, 5 Favorites, 0 Comments

Ultrasonic Sensor

tinkercad logo.jpg

This is a small project specifically chosen to develop skills that will be used in future projects, skills in coding and circuit building. Also, the Ultrasonic Sensor will be reused in the Arduino Automatic Car. Tinkercad will be used to form and run the code for the Arduino board and also to plan and simulate the circuit running with the code.

Supplies

Arduino Uno Board, Breadboard, 3 LEDs (red, green, blue), Ultrasonic Sensor, 3 1k Ohm Resistors.

Production

distance sensor lights.png

Here is the code used to program the Arduino Uno board.

The circuit, including the Ultrasonic Sensor input connected to the Arduino Board controlling some LEDs for output.

The code and circuit work when simulated on Tinkercad so the next step will be assembling it for real and uploading the code to the board.

Demonstration

Ultrasonic Sensor.jpg

The final demonstration shows everything working according to the code in reality. The red light is active when the object is close then the green light turns on when the object is at least 70cm away, then finally the blue light is active when the object is greater than 100cm away from the sensor. Then the video also shows that the colours change on the reverse in the correct order as well.