The inspiration from this idea is What if use the ultrasonic sensor to help blind people To avoid bumping into things with ultrasonic sensor destines and buzzers to make sound an alarm. we can put this on shoes or any garment they wear it
I used tinker cad to design and simulate the circuit and the resistor calculator to calculate the ohm of the resistor.
I use this software to upload the coding text and corrected it too and transfer it to Arduino
Buzzer
Ultrasonic sensor
LED
arduino usb
Breadboard
Arduino
Male jumper
Resistor
In this project, I used four outputs (light) Red Led/green Led / yellow led, and a buzzer
I use an ultrasonic sensor to measure the distains
I used male wire to connect the led to the breadboard and all components to Arduino
I used a resistor for the led, connect all together as shown in the video below.
the Second step was to make a circuit for led to make sure it is working
The first step was to make a circuit on tinker cad
here it is working
here I started to make the actual circuit i connect the cathode with Resistor and (-) line on the beard board
then I linked the ultrasonic to the breadboard vcc to + line and ground to - line
then attach the anode for each of led to Arduino green led to pin 6
red to pin5- green to pin- 3 )
line trig to pin 8 eco to pin 7
here is the final result on tinker cad
here I linked the buzzer + with + line at bread board
and another side to pin 9
Then I write the code to upload it to Arduino
I want to when the object is 50 cm or less away the buzzer makes sound and green led opens another condition when the object is 30 cm or less away the red led opens and when the object is 10 cm or less away the yellow led opens
here is the final result I got from coding when the Distance
is < 50cm the green led opens and the buzzer makes a small alarm the second condition is when the Distance is < 30 cm the red led is open and the buzzer to
the third condition when the Distance < 10 cm the yellow led is open and the buzzer with long tone
here I was so struggling to write the block code i try to make it right
also here I try to write in anther way and didn't work too
and there is also a problem the buzzer is working all time then realize I was the link to the side of the buzzer the wrong way then i was exchanged and it is working
here is the result when the code is wrong all of led open and the buzzer work all the time
then I ask on slack and hams help me a lot to write the block code in the right way Thanks Hamosaa
here is the final result I got from coding when the Distance
is < 50cm the green led opens and the buzzer makes a small alarm the second condition is when the distance is < 30 cm the red led is open and the buzzer to
the third condition when the distance < 10 cm the yellow led is open and the buzzer with long tone