small handheld fan
I hate summer 😀, so I thought about the mini portable hand fan, it's very useful in hot weather as it's small in size and can be easily carried with you anywhere
the fan has an on/off switch, so when you switch it on the motor will rotate the fan and give you cool air 😃
it's powered by a battery
I used tinkercad to simulate my connections.
then, i started implementing my assignment.
please check it here
https://www.tinkercad.com/things/6w6wEYj5ZsQ/editel?returnTo=%2Fdashboard%2Fdesigns%2Fcircuits&sharecode=oPrq0S0TIkQbsg34QjBczsIoB_6YnDiDAHzQa4Bv21s
I built my circuit on bread board and tested it.
I used DC motor, on/off switch, jumper wires, breadboard, small fan blade and arduino uno.
at the end i exposed one terminal of male-male wires and soldered it using soldering iron and soldering wire. (i thought it will stick better instead of using crocodile wire)
The arduino will power the circuit with 5v and control both switch and motor
i need a switch to open and close the portable fan
and motor and blades to rotate and get fresh air
i used arduino ide software to upload code on arduin ide to use it
Tinker cad
https://www.tinkercad.com/
arduino ide software
simulating my circuit on tinker cad
coding my project
copying the code to arduino ide and uploading it on arduino uno
At the beginning i used tinkercad to simulate my circuit
1- first, i connected pos. and gnd of breadboard to 5v and gnd in arduino uno.
2- second, i connected the switch (input) on tinkercad, it has 3 terminals so i connected terminal 1 to positive 5v, common to digital pin 2 on arduino uno, and terminal 2 to ground
while the switch that i had for hardware connection has 2 terminals so i connected one terminal to ground and the other to digital pin 2 on arduino
3- third, i connected the motor (output), i connected one terminal to positive and other to pin 3 on arduino uno
4- then i started coding my project, i want if pin 2 of switch has high (switch on) then the motor will rotate
while if pin 2 of switch is low (switch off) then the motor will stop rotating
- i chose from code blocks + text and coded it using blocks... then i started simulation and switched on and off of the switch it was working alhamdulelah/
- then i copied the text code and uploaded it on arduino uno and uploaded the code.. i tested the circuit by switching on and off of the switch and it was working alhamdulelah
second, For hardware connections
1- first, i exposed one terminal of 4 male- male jumper wire, soldered them to terminals of the switch and motor (to be easier to use and well connected)
2- second, i connected pos. and gnd of breadboard to 5v and gnd in arduino uno.
3- Third, i connected the switch (input), i connected one terminal to ground on and the other to digital pin 2 on arduino
4- then, i connected the motor (output), i connected one terminal to positive on breadboard and other to pin 3 on arduin uno
5- at last, i copied the text code from tinkercad to arduino ide, i attached usb cable to arduino port and pressed verify then upload to upload the code
6- when i switched on the switch the motor worked and when i switched off the switch, the motor stopped.
video of my project working
Yes, i asked for feedback from my instructors after i finished my circuit and showed it to them, they told me that connecting arduino to motor directly may burnout the arduino, and that i need to add L298N Motor Driver
so i will upgrade my project and add motor driver to it
i rewatched the tutorial and made the circuit
I got stuck at two points:
First one: i connected one of the motor terminals to ground and the other to digital pin in arduino, when i tested it, the motor didn't work.... so i thought (by trial and error) in switching the motor terminal connected to the ground i breadboard to the positive, and tried it again and it worked
troubleshooting 1
second one, when i added the H-bridge (motor driver) to my connection, i connected motor 2 to it but in the pins, i connected the pins of motor 1 to arduino, so the result was that the motor wasn't stoping when i turn off the switch... I sent a video to my instructors and they told me the fault in my connections, i corrected it and retried it, now the motor stops completely when i turn off the switch 👍
troubleshooting 2
arduino, inputs and outputs
i started to learn how to use arduino uno in controlling inputs and outputs
this will help me later in programming LCD, keypad, stepper motor in my candy dispenser final project
coding of RGB led with arduino to light all colors in order (red, blue, green, purple, yellow, and white)
i enjoyed doing this task cause i love colors and art
connection of RGB led to arduino
This week i went to FLL competition in alexandria with my super elementary students and we won 2 awards alhamdulelah
Team 1 won core values award
Team 2 won pioneer award