How To Control LED Brightness or DC Fan Speed with Arduino, Transistor, and Potentiometer
In this tutorial, I will show you how to control the brightness of an LED or the speed of a DC fan using an Arduino board , a BC547 transistor , and a potentiometer . Follow along for a step-by-step breakdown of the circuit, the code, and useful tips on optimizing your project. Components Required Arduino Board (e.g., Arduino Uno ) BC547 Transistor (or BD139 for higher currents) Potentiometer (10kΩ recommended) LED or small DC fan (6V or 9V recommended) 9V battery or suitable power supply (7V - 12V) Connecting wires and breadboard Why Use a Transistor? The BC547 transistor acts as a switch and amplifier in this circuit. Since the Arduino cannot directly handle high-current loads like a DC fan, the transistor allows us to control higher currents with a low-power signal from the Arduino. If you need to control devices with higher currents, replace the BC547 with a BD139 transistor , which can handle more current. Power Supply Considerations Ensure that your power supply matches the requirements of your…