I have been inspired by the hands on activity which shown me the variety tones of the buzzer ,and how we can control it to do the project we need.
So my project is a security system in the dangerous places, which makes a warm sound in the normal state and makes a loud sound and opens red LED's when we are in a 10 cm distance or less .
TinkerCAD website
Arduino Uno and it's cable
Ultrasonic sensor
One buzzer
Some male-female and male-male wires
Breadboard
Avometer
12V Adaptor
2 LED's
Arduino APP.
A box from cardboard
I have used TinkerCAD website to simulate and test my project, then I have used cardboard to be the enclosure, I used the Arduino Uno to be the microcontroller of the project and it's cable to connect it to the PC,I used Arduino App to put the code of the project, I used also Ultrasonic sensor to detect the distance, 2 red LED's and buzzer to show that we are in danger. Also, I used 12V DC adaptor to use the project away from the PC power . I needed also a breadboard to help me to connect my wires.
Design in TinkerCAD website
I used the search tab to collect my tools then I started connecting them : the ultrasonic needs a power and ground also needs two analog output I used pins 3 and 5, I used two LED's each needed 220 Ohm resistor as they need about 2-3 voltage only where the Arduino dives 5V and connected each to a digital pin in the Arduino . Finally I put the buzzer and connected one pin of it to an analog pin(11) to have different sounds. , and the other pin was put to the ground.
Done!
Actually, it's a great moment seeing it virtually working.
My code was to make the buzzer make sound in tone 10 when there is no object
After I made sure of the design on TinkerCAD and saw it working, I moved to the tools and started with the LED's connections, then moved to the Ultrasonic sensor connection putting it similar to Tnkercad connections, then I put the buzzer. Finally I took 5V from the Arduino and negative connections to put them in the breadboard so that I can use them ultimate times.
After that I've taken the code from tinkercad and pasted it in Arduino APP , I have tested it and finally uploaded it to the Arduino using the cable.
Finally, I made some holes in the upper face of the box to put the output and input tools. , and used male-female wires to help me putting the components away from the breadboard.
After I have done I have found that one of the two LED's wasn't working :(.
I have used the avometer to see if there is power in the terminals of the LED .
I found it reading (-4.999V) which meant that the wires were put in an opposite way.
So, I checked the wires and put them in the correct way.
This week I have learned how to use tinkercad to simulate the circuit (how to get components, use blocks, get the text code).
Also, I learned how to use the Arduino Uno and it's APP to get the code.
I have learned from this week activities how to search quickly and get information I need , So I have searched to know how to use Ultrasonic sensor blocks in tinkercad website.
I'm so proud to say that my teams in both mid-week and end-of-week were the first to complete the activities in a quick and a great way ♥