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

IMG_20250621_182307.jpg
IMG_20250621_182454.jpg

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

abrauno_1__.jpg
12615-02_Full_Size_Breadboard_Split_Power_Rails.jpg
image_2025-06-21_194541236.png
image_2025-06-21_194625497.png
image_2025-06-21_194652819.png
image_2025-06-21_194732549.png
image_2025-06-21_194918744.png
image_2025-06-21_194939212.png
image_2025-06-21_195010149.png
image_2025-06-21_195134644.png

Planning

image_2025-06-21_230110079.png
Screenshot 2025-06-22 11.58.34 PM.png

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

Screenshot 2025-06-22 9.42.29 PM.png
Screenshot 2025-06-22 170448.png
image_2025-06-22_170546547.png
Screenshot 2025-06-22 6.16.54 PM.png
Screenshot 2025-06-22 6.30.44 PM.png
Screenshot 2025-06-22 7.11.16 PM.png
Screenshot 2025-06-22 7.35.44 PM.png
Screenshot 2025-06-22 9.26.46 PM.png
Screenshot 2025-06-22 8.06.48 PM.png
Screenshot 2025-06-22 8.08.59 PM.png
Screenshot 2025-06-22 8.30.38 PM.png
Screenshot 2025-06-22 8.31.16 PM.png

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

#define LED_PIN 11
#define MOTOR_PWM_PIN 3
#define POT_PIN A0

void setup() {
pinMode(LED_PIN, OUTPUT);
pinMode(MOTOR_PWM_PIN, OUTPUT);
}

void loop() {
int potValue = analogRead(POT_PIN); // Read potentiometer (0-1023)
int pwmValue = map(potValue, 0, 1023, 0, 255); // Map for PWM (0-255)

analogWrite(LED_PIN, pwmValue); // LED brightness
analogWrite(MOTOR_PWM_PIN, pwmValue); // Motor speed

delay(10); // Small delay for stability
}

Conclusion

is-it-working.jpg
1000_F_229660418_qeDV0lEoBHMkdrhE0gC7wuXOmGrPDy6u.jpg

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!!!

You're DONE!!!

image_2025-06-22_174509429.png
any-question-label-template-design-vector.jpg

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