Smart DC Fan.
My idea for this week's assignment was about a smart DC fan controlled by IR Sensor. The green LED is emitted as long as there is no signal from IR and if you put your hand near the IR sensor, the fan will run automatically and the red LED will be emitted and the green will turn off. So, there are 2 outputs:
Running the fan.
Changing the LED color.
I have used the TINKER CAD platform for simulating the electronic circuit.
Arduino IDE to upload the code for Arduino.
9V Adaptor.
Brushless fan DC 5V.
Bread Board.
Arduino UNO.
IR Sensor HW-201.
2 Light Emitting Diode (LED).
Two 220 Ω Resistor.
Motor driver L298N.
Jumper wires.
USB Cable.
Adaptor Socket.
Title of Media
I Used the TINKERCAD platform to simulate and view the schematic of the circuit which helped me to understand the process
TINKERCAD Simulation
Block Code
As a beginner, I don't have experience or knowledge of coding. So, I have used the TINKERCAD platform to program the circuit with this interactive blocks which helped me to do what I want.
After I have finished the block code on TINKERCAD, I copied the text code from it and dragged it into Arduino IDE as shown.
This circuit has been programmed based on the conditional" If". As if the IR sensor detects a signal, the fan will work and the red LED will light up with it, otherwise, the fan will not work and the green LED will remain light.
Note:
You have to verify the code before uploading it to Arduino to make sure that there are no mistakes in the syntax of the code otherwise the circuit won't work properly.
Arduino Code
Building the circuit
I used the electronic components I mentioned above to build the circuit of the project.
This step was very necessary to make the fan run because the output current of the Arduino is not enough to power the fan. So we have to use this piece and here is the method of its connection.
L298N Connection
Final Outcome
Finally, After many tries to understand and run the circuit it worked properly.
I got stuck when I had started to test the circuit. The fan couldn't start because I had forgotten to connect the motor driver module LM298N as the output voltage of Arduino didn't enough to operate it as shown in the video attached. So, I used google to understand how to connect it with the circuit.
The reference that I depended on
It was my first time dealing with the Arduino IDE. So, I got familiar with it and it will help me during working on my final project in the point of programming.
I have earned a variety of skills and knowledge in this week as follows:
Controlling several components by analog and digital inputs.
Understanding the concept of analog and digital output.
Getting familiar with Arduino IDE.
Title of Media