Arduino DC Motor Fan and LED Control With Potentiometer
by DK968463 in Circuits > Arduino
65 Views, 2 Favorites, 0 Comments
Arduino DC Motor Fan and LED Control With Potentiometer


This project demonstrates how to control a DC motor fan using an Arduino, a potentiometer, and an LED indicator. The motor's speed is adjusted using the potentiometer, and the LED changes brightness according to the same control. This project is perfect for beginners and great for summer!
Supplies










Here are the list of supplies you'll need for this project:
- Arduino UNO board or Abra uno r3 board with USB cable for connection
- DC motor
- NPN transistor (e.g., 2N2222,BC547)
- Potentiometer (10kΩ recommended)
- Red LED
Planning


I built my circuit on Tinkercad to test my ideas before moving on to the real circuit. If you're interested there is also a schematic view of the circuit. Furthermore you can visit this link to see how i connected them.
Assembling the Circuit












1. Connecting the Potentiometer
- Use the yellow jumper wire to connect the output of the potentiometer to A0 of Arduino.
- Next use the black jumper wire to connect the Ground of potentiometer to the negative rail of the breadboard (The black line).
- After that use the red jumper wire to connect the VCC of the potentiometer to the positive rail of the breadboard (The red line).
2. Connecting the DC motor
- Use the black jumper wire to connect the negative part of the DC motor which is known as (Terminal 1) to the breadboard, specifically at "b)9".
- Next use the Red jumper wire to connect the positive part of the DC motor which is known as (Terminal 2) to the positive rail of the breadboard (The red line).
3. Connecting the NPN transistor
- The NPN transistor should align to connect D)7,8,9. Put the NPN transistor in the order of Collector, Base and Emitter. The Collector for example should connect specifically at "d)7", The Base should connect specifically at "d)8" and The Emitter should connect specifically at "d)9".
4. Connecting the Resistor
- Connect the Terminal 2 of the Resistor specifically at "b)10" and Connect the Terminal 1 of the Resistor specifically at "b)6".
5. Connecting the LED
- Connect the Anode of the LED specifically at "d)11" and Connect the Cathode of the LED specifically at "d)10".
6. Wiring
- Connect a long blue jumper wire at the breadboard specifically at "a)11" to the Arduino Board "~11" pin in the Digital PWM rail section.
- Connect another long blue jumper wire at the breadboard specifically at "a)8" to the Arduino Board "~3" pin in the Digital PWM rail section.
- Connect a red jumper wire at the positive rail of the breadboard specifically at the second dot or pin to the Arduino Board specifically at the "5V" pin in the (Power rail section).
- Connect a black jumper wire at the negative rail of the breadboard specifically at the first dot or pin to the Arduino Board specifically at the "GND" pin in the (Power rail section).
- Connect the small groups black jumper wires exactly as shown in the "8th image".
7. Powering the Circuit
- Lastly once you're done assembling the circuit with all the components and wiring's are connected, You need to upload the code into the Arduino board. So below this there is a code you can copy and paste it into the Arduino app, IF you don't have windows or are using a school laptop/Chromebook that doesn't support Arduino or that doesn't let you install app due to the admin restrictions you can luckily use the Arduino Cloud website online to upload the code into the Arduino board. Click on "Get started for free" and then just login or create your account, next in your homepage click on the "Create new" button and select "Sketch" after that paste the following code below to your sketch and once done, plug in the USB cable of Arduino board to your device, select your board, brands and the port. Once your done that click on "Verify" then lastly click on "Upload". Hope for the best as your circuit should work as you connected it, If you encounter problems or your circuit isn't working, you should check the common issues like if your jumper wires are connected properly, as loose connections can prevent the circuit from functioning. If it still doesn't work visit this link and this link to help you out.
The Code
Conclusion


This project taught me a lot about troubleshooting, circuit design, and coding for Arduino. Now that I have a working DC motor fan with speed control and an LED indicator. You can watch the video below to see my circuit working!
And as for you, Have fun building this circuit!!!
Downloads
You're DONE!!!


Thank you for reading! Feel free to ask questions or suggest improvements in the comments.