This Week assignment , I took inspiration about an automatic barrier road .
Arduino IDE
Tinkercad
Jumpers wires
Arduino Uno
Arduino USB cable
Ultrasonic sensor
Buzzer
Green LED
DC Jack Cable
Servo Motor
220 ohm Resistor
First of all, I started to design the circuit on Tinkercad
1) Connected the 5V and the ground of Arduino to the negative and positive of the breadboard.
2) Then Connected The power of the servo motor to the positive of the breadboard, the ground to the negative and the signal to pin 6
3) For the ultrasonic , I connected the trig and echo to the pin 10 and 11 and for his Vcc to the positif and the ground to the negative.
4) After Then, I Connected the positive of the Buzzer to pin 3 and the negative to the negative of the breadboard
5) Finally, I connected the resistor and led to pin 8 and the ground.
6) After finishing all this steps , I started to make the code of my circuit Under this condition : "When the ultrasonic sensor detects something at a distance less than or equal to 20 cm, the servo moves to 90 degrees until it no longer detects an obstacle, then it returns to its initial position at 0 degrees, and during this time the buzzer makes a beep-beep sound and an LED turns on under the same condition as the buzzer. "
Here is a video who show the simulation of circuit
After everything was ok , I pasted and upload the code to the arduino
This video show us how my barrier works
I had only one challenge, and it was adjusting the sound of my buzzer, it was making a weird sound, But I wanted that it looks like an alert, after a lot of trying i find out that I need to add a "1S Wait" .
It was good a week, we made a cute waving hand 😂for the End of week session.
Title of Media