I get a lot of beginner questions like below :-
How do I switch ON & OFF a 12V DC fan from an Arduino ?
|12V SPDT relay|
|Arduino 4N35 12V Relay|
When pin 12 is turn ON or HIGH, it will triggered the LED between pin 1 & 2 inside the 4N35 optoisolator (6 pins white chip) to turn on the phototransistor ( pin 4 & 5) and complete the circuit and send 12V power into the relay (black colour). When the coil is energize, you will hear a click and switch on the motor. The red wires are connected to 12V power supply.
Using this method, it can only switch on or off a circuit but could not control the variable speed of the motor. A second method will use a semiconductor, NPN Power Transistor model TIP122 to control the speed of the DC motor using PWM from pin 9.
On Part 2 of the article, I will explain on how to control the speed of a 12V DC fan using PWM.