the assignment this week is to Build and Program a smart circuit using an Arduino UNO which reads a signal from an input component (Sensor, Switch, or variable resistor) to control an action component (Motor, Buzzer, LED...etc) using Code Blocks.
My idea this week was to make a table fan, my body overheats in summer and that's why i thought i need one so i searched online and found a tutorial to make a mini table fan and decided to make one i added led as the other output component.
Make sure to search for the datasheet of the components before connecting it to know its specifications( safe range of voltage and current intensity and connections)
Circuit Components:
on/off switch
5v-2A adapter
220 ohm resistor
to build, code and simulate the Circuit
1st. we designed the circuit on tinker cad using:
power supply 5v
220 ohm resistor.
led.(action)
DC Motor(action)
breadboard
slide switch
so first i searched to know each components needed current and connection, the motor need 5v and it has 2 terminals (+ve and ground), the led it need 2v and 20mA to work so the power source we choose was the 5v adaptor that make the 2 components work but if we connected the led to 5v it will be burnt so we had to connect it first to a resistor 220 ohm in series to regulate the voltage and the ampere for the led.
then we connected the led circuit and the motor in parallel so each one of them take 5 volt as the parallel connections take the same volt but different ampere, so now we have the output components and the power supply last we had to add the input component( on/off switch) so connected it in series to cut the circuit as if we connected it in parallel it will act like a separated device so opening or closing it wont affect the circuit
1st i build the circuit with actual components and tested it then i made the enclosure i used a pre-made plastic box then opened places for the components (motor shaft, switch ,led and power socket)
then mounted the components and that's it.
i started the circuit with a led, resistor and the power supply but the led was a bit faded there were something odd first i thought was the led and changed it but no thing changedso 2nd was the wiring that there is something wrong but the led has polarity so if a wire is shifted it wont work at all so there wasn't something else except the resistor and by searching and using a resistor calculator apparently i wasn't using a 220 ohm one so after changing it all is good.