This week I decided to apply the assignment to a part of my final project to see how it will move and wether or not it will function in the way I want it to, somy assignment will be moving the motor for a certain angle when the ir sensor or ultrasonic detects an object (T-shirt for example)
Tinkercad
Bread Board
Jumpers
Adaptor 9V
Ultrasonic sensor
Servo motor
Arduino UNO
First step was to simulate the circuit on tinkercad.
I started to put the components I needed:
power supply, Servo, ultrasonic sensor and arduino.
after putting the components I started to connect them to the arduino and bread board, took the ground and vcc pins to the rails and connecten the arduino ground to the power supply ground, and then connected the ultra sonic pins to the arduino and power and did the same with the servo.
I made a separate supply for the arduino from the power supply so that I don't put a large load on the arduino, Plus, in the project I'll have 4 motors so I'll absoloutly need to do that.
after putting the components I started making the code with the code blocks.
Basically I wanted my project to move the flapper when someting is read by the sensor.
So, The sequence is as follows:
If the sensor sees an obstical infront of it less than 3 cm away, the motor in pin 3 should rotate 150 degrees then waits for a second then return to the 0 position.
Circuit simulation
After making sure that the circuit works as intended, I converted the code to text to send it to the arduino using the arduino IDE
Then, after converting the code to text, I copied it to the arduino IDE then uploaded it to the arduino to test the project.
The cardboard prototype of the project was already there I just used one side of it to test.
connecting the components together after uploading the code
Testing
Testing video
(here I increased the distance to be able to film the video properly)
At the end of week session we made a minion that waves at us using a servo motor, We didn't make a place for the servo to rest so we were holding it with our hands, but then I saw the other team ( Mohamed-Mohsen and thomas) made a very nice holder to the motor, I didn't even think about fixing the motor and it didn't cross my mind but it was nice to see what they did.
we then made one right before the presentation but there was very little time so it wasn't the best.
I had little trouble in connecting the folder to the motor, it kept falling, I eventually connected it with a wodden stick and glued it to the servo.
Title of Media