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
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 components. While the Arduino itself can be powered via USB, this may not provide enough current to run external devices like fans. For this project, a 9V battery or a regulated power supply between 7V and 12V is recommended to provide enough current to the fan while safely powering the Arduino board.
Learn more: