☢🌫 How to Control Fan Speed with Arduino Using PWM and a Potentiometer

Controlling the speed of a fan using Arduino is a great way to learn about PWM (Pulse Width Modulation) and analog input. This project is simple, powerful, and forms the basis of temperature control systems, ventilation, robot cooling, and more.

Whether you're building a DIY smart home setup or a robot with cooling, this tutorial will teach you how to adjust fan speed in real-time using a potentiometer.


🔧 Components Required

  • ✅ Arduino Uno (or compatible board)

  • ✅ DC Fan (5V or 12V based on setup)

  • ✅ Potentiometer (10kΩ)

  • ✅ NPN Transistor (e.g., TIP120 or 2N2222) (optional for higher power fans)

  • ✅ Diode (1N4007 for back EMF protection) (optional)

  • ✅ Jumper wires & Breadboard

🛒 Buy all components from Plysmotix.in – Fast shipping across India!


📲 Bonus: Download the Plysmotix Android App

Want circuit diagrams, live tutorials, and mobile Bluetooth control?

🎯 Download the Plysmotix App and:

  • Get interactive guides

  • Shop components directly from the app

  • Control your fan via Bluetooth

  • Save your custom projects


🔌 Circuit Diagram Overview

  1. Potentiometer connects:

    • One side to 5V

    • Other side to GND

    • Middle pin to A0 on Arduino

  2. Fan connects:

    • Positive to external 5V (or VIN)

    • Negative to Collector of NPN Transistor (if used)

    • Transistor Base connected to Arduino Pin 9 through a 220Ω resistor

  3. If you're using a low-power 5V fan, you can connect it directly to Pin 9.


💻 Arduino Code for Fan Speed Control

int fanPin = 9; // Fan connected to PWM pin int potPin = A0; // Potentiometer input void setup() { pinMode(fanPin, OUTPUT); Serial.begin(9600); } void loop() { int speed = analogRead(potPin) / 4; // Convert 0-1023 to 0-255 analogWrite(fanPin, speed); // Control fan speed Serial.print("Fan Speed: "); Serial.println(speed); delay(100); }

🧠 How It Works

  • analogRead(potPin) reads a value between 0–1023

  • Dividing by 4 scales it down to 0–255 for PWM control

  • analogWrite(fanPin, speed) adjusts the fan’s voltage

  • You can view speed values in the Serial Monitor

🔍 The more you turn the knob, the faster the fan spins!


⚙️ Real-World Applications

  • 🌡️ Smart Cooling System

  • 🏠 Home Ventilation Control

  • 💻 DIY PC or 3D Printer Fan Controller

  • 🚗 Automotive Climate Projects

  • 🤖 Robot Cooling & Speed Control


🛍 Buy Sensors & Kits from Plysmotix.in

Build faster with pre-tested, affordable components:

  • ✅ Arduino Boards & Shields

  • ✅ Potentiometers, Transistors, Fans

  • ✅ Complete Starter & IoT Kits

  • ✅ Exclusive Bundles for Students & Schools

🛒 Shop now at Plysmotix.in – India’s trusted electronics store.


📈 SEO Keywords to Rank This Blog

  • Arduino fan speed control PWM

  • PWM DC fan Arduino code

  • Arduino potentiometer fan control

  • DIY fan speed controller with Arduino

  • How to use analogWrite with Arduino

  • Buy Arduino components online India

  • Plysmotix electronics store

  • Download Arduino control app


📲 Control It Wirelessly with Plysmotix App

Want to control fan speed from your smartphone?

  • 📡 Pair your Arduino via Bluetooth

  • 🎛️ Adjust speed using sliders on the app

  • 📦 Shop and manage parts from within the app

  • 🔔 Get updates and projects every week

🎯 Download the Plysmotix App Now


✅ Conclusion

This simple project teaches the fundamentals of PWM, analog reading, and hardware control. It’s a great starting point for more advanced systems like automatic temperature regulation or remote fan speed control.

🚀 Start building your smart electronics journey today!


🔗 Quick Links

  • 🛍 Buy electronics at Plysmotix.in

  • 📲 Download the Android app for free

  • 🧠 Need help? Contact us or comment below!

Comments

Popular posts from this blog

💡How to Blink an LED with Arduino – Beginner's Guide with Code

🔊 How to Make a Buzzer Beep with Arduino – Easy Sound Project for Beginners