This small robot is used to sense if there is an object near by a specific distance.
I made this project to protect my laptop from the children in my house. As when they will be near by my laptop the buzzer turns on.
Circuit design software
OUR LOYAL FRIEND
Google: To search for whatever i need to know to complete the assignment.
Tinkercad: The main tool in this assignment, As i made the electrical circuit in it to make sure from the idea and from its validity
Cardboard: for the device enclosure.
Cutter: to cut the cardboard to make the wanted prototype parts
Hot glue gun : to assemble the parts together and get out with the device enclosure
Breadboard:
5 Volt Adapter:
Servo-Motor :
Buzzer:
Ultrasonic sensor:
wires:
The action components that you used:
Servo motor
Ultrasonic sensor
Buzzer
Voltage source
5 Volt adapter :to provide the voltage for Servo motor ,Buzzer and the Ultrasonic sensor
This screenshot represent the project connection
1-Servo motor connected in pin 5
2- Ultrasonic sensor the trigger in pin 6 and echo in pin 7
3- Buzzer connected to pin 4
TinkerCAD simulation
Blocks Code
In this pic we can see the blocks code of the project in consist from:
1- forever function: to loop the code
2- count function : to make the servo motor rotate a scientific step (in this case it will rotate 1 degree)
3-if function: to ask about the distance of the object from the ultrasonic sensor
Then if the distance is less than 10 cm the buzzer in pin 4 will be high and make a sound .
else it will be low .
Circuit simulation in TinkerCAD to show the functionality of the project
You can see how the the servo motor rotate and by controlling the distance away from the ultrasonic sensor the buzzer turns on\off
Project final wiring
I test all components to make sure that all of them work.(servo alone - ultrasonic sensor +Buzzer)
I connect all the components together
Making sure from the connection with the Arduino and breadboard
Take the text code from tinkerCAD to Arduino IDE to compile it and upload it to the Arduino UNO
Connecting them to the 5 voltage adaptor
أمسك حرامي
This video show the progress of the project
The servo motor start rotate with the ultrasonic above it
The ultrasonic sensor detect if there is an object 10 cm away from it or not
while put my hand in front or while it see the nearby wires while rotating the buzzer turns on
The first problem that i face was with the servo motor, it was rotate fast and 360 deg even i make it rotate 180 or 90 deg.
I had tried to make a specific code for it and finally it ended by it doesn't work.
So i tried another one and it works and make the function of the project.
The second problem was with the wiring, i wanted it to be a real project as a dog or some thing like that. But after i completed the wiring and turn the power on, the wires become as in the pic and also with the problem of the servo the wires were very messy.
So i made it vary simple as shown in the previous video.
Bad wiring
Bad wiring
The most important 2 things i learned in this week:
be care about the wiring
test each component individually
We build a Smart Waving Hand using Arduino. When you wave at the smart hand, it waves back at you! 👋
Cute Waving Hand