tinker cad online program tinkercad
arduino uno
ir sensor(input)
micro servo(output)
small bread board
cardboard, scissors
jumpers (male -male & male - female)
arduino
ir sensor
servo
small breadboard
cardboard
scissors
tinkercad
I used tinker cad website "online simulator program" to make simulation for the circuit to make sure from the connection to avoid damaging of the components.
1-I connected the positive of the 5v arduino to a point in the breadboard and the negative to another point.
2-I connected the ir sensor and servo motor as shown in google.
Now, it is coding time, this week we used code blocks instead of writing the code:
-I connected the signal of the ir to pin9 as input and translated it as shown in the blocks.
-signal of servo to pin 8 as output and work depending on the signal of pin9.
-if signal of pin 9 is high the servo will rotate 90 degree, else will return to 0.
I tested the wiring and coding and after working properly, I copied the code and pasted it in the arduino app for compiling.
wiring
Blocks
now I could say"وجرت الامور كما خطط لها"
copying the code
-I connected every thing as were in tinkercad.
-I connected the arduino cable to my pc and uploaded the code from arduino app.
Now the project work properly
implementation
This project took longer time than expected, this because when I began to upload the code, there was an error message always appear and that still till I met my instructor Mohanad and he told me that the problem was in the port of the arduino.
error message
serching online libraries
This week I learned how to deal with arduino and how to program it, also I learned how to wire and program every thing with arduino using google and online libraries and this will help greatly in the final project.
The coolest thing was the programming of arduino.
I will never forget searching about the datasheet of every electronic device(servo, dc motor,.....) in order not to making any damage to the kit.
servo datasheet