Introduction: TinkerCAD Ultrasonic Distance Sensor Circuit (Computer Eng Final)

We will be creating another fun tinkerCAD circuit to make during quarantine! Today there is a addition of an interesting component, can you guess? Well we are going to be using an Ultrasonic Distance Sensor! Moreover, we are going to code for 3 LEDs that will assist us in determining how far an object is. So, what even is a distance sensor? A distance sensor uses echolocation/waves, such as a bat and some sea creatures to determine the proximity of an object. This then allows the Arduino program to determine how far an object is from the sensor. This circuit was influenced by the instructable article called "Ultrasonic Distance Sensor in Arduino With Tinkercad".


- Arduino Uno r3 (1) Price: $13.29 CAD

- Small Breadboard (1) Price: $10.99 CAD

- Distance Sensor (1) Price: $3.68 CAD

- LED (3) Price: $10.18 CAD

- 300Ω Resistor (3) Price: $7.15 CAD

- Assorted Wires Price: 17.99 CAD

Step 1: Start Creating the Circuit

Firstly start by taking out your breadboard along with an Arduino from component section. Next you can connect both you ground {-} & power {+} and attach to outside pins on the breadboard (as seen in image). Now you can drag your 4 pin Distance Sensor, place it staring at pin 26 to pin 29 in row C on breadboard. Continue wiring, your distance sensor by adding Arduino pin 4 to pin 27 A on breadboard & Arduino pin -3 to pin 28 A on breadboard.

Step 2: Wiring LED

You can now bring 3 LED's to your breadboard; place them in row G with first LED cathode starting at pin 2. Then continue to place each LED 2 pins a part (you can change colour of the LED by tapping on it with your mouse). You can now proceed to adding one 300Ω resistor to each LED's anode (3 in total); these resistors should be placed from their top pin in row F and bottom pin in row D. Moreover, add wire connecting from LED's cathode; row F to the ground rail (-). Finally, add 3 wires connecting from the Arduino pins to breadboard under resistors (row C); Arduino pin 12 to breadboard 4 C, Arduino pin 8 to breadboard 8 C & Arduino pin -5 to breadboard 12 C.

Step 3: Block Code

To begin open "code" (found top right of tinkerCAD) there are multiple options presented once opened. All the blocks we are adding will single handily influence and control our 3 LED's. Firstly add the primary boxes seen in the photo above. Now that you have a few boxes down we can change some values. In this changing the "input" blocks to cm value makes all our numbers in this measurement. Moreover, for the two math setting (green blocks), change values to < 70 in first box then < 150. Furthermore, you can add 3 digital output blocks in the statement itself, set pin 12 to high and pin 3 & 5 to low (connected to LED's); duplicate twice however change second to 12 and 5 low and 3 to high, repeat for the last block;12 & 3 low and 5 high.

Step 4: Circuits Done!

CONGRATS!!! If you have completed all these steps your circuit should now function! You can now choose to create a real version of this circuit if you would like! if you have any questions regarding this circuit please leave them down below!