Software
online platform to smiulate circuits and 3d designs.
Cardboard
to make the physical prototype
Breadboard
Ultrasonic sensor
to sense the motion
Arduino Uno
to control the circuit
LED Light RED, YELLOW, GREEN
to smiulate the traffic lights.
Resistor
9V adapter
the power supply
crocodile wires
to connect the pushbutton to the jumper wires.
male-male jumper wires
to connect the components to the breadboard.
Step 1
Open Tinkercad in any browser
Step 2
Create a circuit
Step 3
Start searching for components
First, we will use breadboard
so in searching bar will wright breadboard and then drag it in workspace.
Step 4
Then add the Arduino.
Step 5
Then add the Led light
as OUTPUT COMPONENT
Step 6
Add 3 Resistor each one is 220 oam
Step 7
Add Ultrasonic sensor.
as INPUT COMPONENT
Step 8
Start to connect the Ground of the arduino to the breadboard and then connect the ground of the sensor and the negative terminals of the led to the arduino ground.
Step 9
Connect the arduino 5v Pin to the breadboard and connect the vcc pin of the sensor to it
Step 10
Connect the postive terminal of the green led to pin 3 on the arduino, the yellow led to the pin 5 on arduino and the red led to pin 6 on arduino.
Step 11
Connect the the trigger pin of the sensor to the pin 9 on arduino and the echo pin of the sensor to the pin 10.
Step 12
Coding
Open the code icon and from input choose Read ultrasonic distance sensor
then put the number of trigger pin to be 9 and echo pin to be 10
Step 13
Then from Math add the comparison block drag the out block to it and make the sign to be > and the distance number to be 10 cm
Step 14
Then from control add IF,Then,Eles block and drag the previous block to it
Step 15
Then from Output add Set pin....to HIGH
then edit the pin number to be 3 and duplicate the block two times add the pin 5 and 6 and make them LOW
Step 16
Then from Control choose the block Wait 1 secs then dublicate the blocks two times but make the 5 pin high and the other pins low then make the 6 pin high and the other pins low.
Step 17
Then in else add the first out blocks.
Edit the wait times to be 0.5 secs
The circuit link below.
The real circuit
After simulation on tinkercad apply it in the real life.
Step 1
Add the leds
Step 2
Add the resistors and conneect the arduino 5v and ground the breadboard.
Step 3
connect the vcc pin and ground pin of the sensor to the breadboard.
Step 4
Connect the postive terminal of the green led to pin 3 on the arduino, the yellow led to the pin 5 on arduino and the red led to pin 6 on arduino
Connect the the trigger pin of the sensor to the pin 9 on arduino and the echo pin of the sensor to the pin 10.
Copy the code from tinkercad to aruino app
I forgot to link the negative terminals of the leds to the arduino didn't work
solution
I checked all the wires so discovered this mistake.
IN this circuit only the postive terminals of led are connected so the circuit wasn't work
I checked the wiring so i realsed the problem so I connect the negative terminal of the led to the gnd of arduino.