the idea of this week's assignment is to make two inputs controls two outputs for a smart device with an enclosure so I made a device we could call lazy Susan because it's just like it is just the spinning function but it just rotates half rotation .
so
my project is a rotative(panning) base for little things that the purpose from it is to capture only the back, profile, and 3/4 angle view (troiscar) of the object that helps in capturing videos in a specific angle or just capturing a photo in one of those angles.
so the project runs as follows:
the on/off switch is the input of the circuit ( project ) and by clicking on it, it will make anything in the circuit run or stop, also the potentiometer is the 2nd input that controls the led to open or not.
the servo motor is the output that is responsible for the movement of the project surface, and LED is also the 2nd output which is responsible for giving a sign that there is a movement or there is a video /photo session happening here it also has a hidden feature that it give some highlight to the object.
some pictures that I inspired from
I used TINKERCAD software to design the circuit, and after making the circuit on TINKERCAD, I used the real circuit and Arduino Uno to apply the same circuit in reality, I also used Arduino software to make my assignment code then I import it through a USB from Arduino software to the real Arduino slice.
the electronic components that I used:
I used the Arduino UNO, servo motor, on/off switch, led with (220-ohm resistor), potentiometer, a breadboard, crocodile wires, and jumper wires to connect between breadboard, Arduino, servo motor, on/off switch, LED, and potentiometer.
TINKERCAD software app that I used to design the circuit
The circuit on TINKERCAD
Arduino software that I used to import the code to the real Arduino slice
the code that I made for this project on Arduino
I started to design the circuit at TINKERCAD so I used the Arduino UNO, servo motor, on/off switch, led with (220-ohm resistor), potentiometer, a breadboard, crocodile wires, and jumper wires to connect between breadboard, Arduino, servo motor, on/off switch, LED, and potentiometer.
for Arduino, Breadboard, LED, and potentiometer, I connected the (5v) on Arduino to the positive section on the breadboard and connected the GND on Arduino to the negative section on the breadboard then I connected the LED on the breadboard using the 220-ohm resistor for the negative leg and connected the positive leg to pin (8)on Arduino by using jumper wires and then I connected the potentiometer one from leg to the negative section on a breadboard and the other one on the positive section on a breadboard and then connected the middle leg to the analog pin(A0) on Arduino.
for Arduino, Breadboard, on/off switch, and servo motor, I connected the on/off switch with crocodile wires then from them I connected two jumper wires one from them connected to the negative section on a breadboard and the other connected to pin (3) on Arduino, then I connected the servo motor three legs the negative leg to the negative section on the breadboard and the positive leg to the positive section on the breadboard and the third leg to pin(4) on Arduino.
secondly,
I started to make the code on Arduino so I started to define the pins with their names and then started to make an if condition in which the switch was low so the servo will rotate from 0 to 90 to 180 and also will give access to the led to turn on/off only by the permission from the potentiometer and if-else so stop the led and the motor.
a small brief about what the code I made meaning and what it does:
(first of all, I defined the code outputs and inputs which are servo motor and LED were the outputs, while the potentiometer and on/off switch were the inputs then I made an if condition that stipulates that if the on/off switch were LOW ( which means turned on) so in that case, the Motor should rotate from (0) to (90) to (180) and also the potentiometer should give the permission to LED to turn on or off by second permission from the potentiometer after the on/off switch, and if-else which means if the on/off switch were HIGH (turned off) so stop the motor and the LED).
thirdly,
I started to build the real circuit on a breadboard and Arduino Uno doing the same process that I did on TINKERCAD and after wiring everything I put the Arduino slice cable to it and to the laptop to import the code that I made to it and then the circuit work.
the circuit on TINKERCAD
the Arduino code
the real circuit
the circuit video without an enclosure
I used some of the scrap materials that I have at home because there was no cardboard to use so:
I used some of the old boxes as a base for my project and glue an upside-down plastic cup in it and then I put the servo motor on the top of that cup and fixed it by using scotch and I put a scotch (plastic tape) on the bottom of the old cream box cover and fixed on the motor and now we had a semi rotative surface that I could put an object on it and capture it from some angles.
I also made a side box that I put the circuit inside it and made a hole on top of it to put the led on it and made a small rectangle on its side for the switch and a small circle for the potentiometer.
the project pictures
some of the project pictures while making it
the circuit inside enclosure
the project video inside enclosure
final release of it
another video of the project
at the end of this week's task, we ( Abdelrahman, Hussien, and I) asked the instructor Esraa and the lead instructor Sherif about the circuit code because there were some conditions that we missing at the code but Sherif helped us in fixing it and also Esraa helped us at some points at wiring the relay module to the fan and light bulb and also because we had to use an IR sensor and it was not working but the lead instructor Sherif helped it by fixing it with the screw driver.
I stuck a lot in this week's assignment because of the circuit I didn't figure out what is the problem because sometimes the servo motor work and sometimes not but after a lot of searches and trying a lot of codes finally I got that some of the previous codes that I used did not introduce the servo to Arduino at some points so after I fixed that point it works.
is to try every single piece that I will use from the kit at my final project alone and try it alone with its code first before combining them together to save a lot from my time and to figure out the problem faster.
is to make two functions a manual mode and an automatic mode and changes between them using a slide switch and some conditions in coding it was so cool actually for me to just change the mode only by one finger push.
At the end of this week's task we had to make two features and changes between them by a slid switch the manual one was to make the dc fan and light bulb turn on but while sliding the switch the manual mode will turn off and the automatic mode will turn on which is lighting a bulb through an IR sensor if its dark the bulb will turn on and all of this was with this week's team (Hussien, Abdelrahman, and I).
the automatic mode video
the manual mode video
some of the end of week task pictures