Title of Media
This week idea was inspired by my graduation project .It was a great chance to learn and save some time to enable me to work on the nice to have features in my project which I found on hackster .
I edited it and began with 2 features
two inputs:-
-switch's
- IR sensor
one out put :-
servo motor
process :-
turning on the switch while the IR sensor is active ... this will activate the servomotor ( open the box )
Title of Media
My Idea
on pushing the switch button the servo motor will move 90 degrees . that will only happen if the ir sensor is activate .
First :-
I connected the IR sensor and the servo motor to the Arduino.
Next I used the codeblock to make sure everything works fine .
the code
-//if you read (high signal from the switch)
rotate servo motor to 180
else ( if the reading was low signal )
do nothing
Title of Media
Then i connected the switch button and edited the code as shown in the pic.
The final code .
i added
If you read high signal from digital pins 9 & 11 (the ir sensor and the switch )...rotate servo motor
Using my kit
I connected the servo and the IR sensor to the arduino using large breadboard and jumpers to make suer its working.
IR sensor : at first it was not working so i searched about it and i found two switches with the blue color it allows you to control its resistance and sensitivity .
I edited it and it worked
then I uploaded the code and made suer its working.
Finally ,I connected the switch button to the circuit and VOLA !! it worked .
At first , it was not working and he had the same problem so he said to move that peace and make it 5v instead of 12 v and it worked .
My friend Abdelfattah while i was using the relay module in one of the exercises to power a lamb
I wanted to know how to control an the speed that the servo motors is going with and i did find it in arduinogetstarted without using the delay function in the code .
to save some time later I started with the circuit of my project as the assignment .
we had an exercise to make the 7 segment count from 9 to 1 Using the Arduino code and it was amazing