Script Fan Speed Arduino
This is an easy tutorial showing how you can control the brightness of an
LED or adjust the speed of a DC fan using Arduino Board, a small BC547 transistor and a potentiometer.
In my example the whole circuitry is powered from a 9V battery and I use a small 12V fan, but you should use a 9V or 6V.
If you want to use higher currents then replace the BC547 (100mA maximum collector current) with a BD139 or other according to you requirements. Dot not forget that voltage ratings for the Arduino Board are between 7V and 12V.
Circuit Fan Speed Arduino
We set the potentiometer pin as 0 (A0 on the Arduino Uno board), the CONTROL variable is the voltage that is used to cotrol the led brightness of the speed of the fan. In the setup() function the
CONTROL pin 9 is set as OUTPUT.