I have what seems to be a simple project, but I can't get it to work. I have 12V fans hat will be powered every x hours for x minutes. The fans have only 2 pins and the project is being powered with an external power supply.
The code itself should be pretty straight forward
Now begins the problem, the wiring. I have FAN+, FAN-, Pin9, 12V+ and 12V-, using a transistor (IRLZ44N) as the switch.
The wiring is:
12V+ to FAN+
12V- to Drain
FAN- to Source
Pin9 to Gate
The fans spin, but Pin9 is redundant. Any other configuration, either limits the power to 5V as the output comes from the arduino, or doesn't work at all.
The diode must be able to take the motor current during flyback. If you have an avalanche rated MOSFET this diode will not be needed as the MOSFET will conduct at a lower voltage. Check the MOSFET data this information is now appearing on many of them.
Thanks for your replies, I got it working without a hiccup.
My only question resides with the flyback diode. I researched what it does and it's pretty simple to understand it's function, but where does it go? Can I just solder it to the fan leads, stripe to + and the other side to -? That's what I took from the schematic posted, but I'm not entirely sure that's what it shows.
I usually solder the diode and cap (if used) right to the motor terminals along with the power wires as you describe. Diode band to motor + and other end to motor -.
It will not do anything if there is no inductance in the circuit. However if there is an inductor when you apply power it charges up forming a magnetic field. When you disconnect the power the inductor needs to discharge. To do this the polarity reverses and the voltage rises (no limit) until it is dissipated by something. This can be by a resistor, maybe the insulation failing, or whatever is in the circuit. In this case it is the MOSFET so if it is rated at a given drain source voltage and when that is exceeded the MOSFET is destroyed or at least damaged. This will dissipate the energy from the inductor and it will quit discharging.
Remember the polarity is reversed so when you turn it off the positive and negative switch polarity on the inductor, this in turn forward biases the flyback diode causing it to conduct. If there is no flyback diode the "avalanche" diode in the MOSFET conducts and dissipates the energy. This will also cause the MOSFET to dissipate the energy as heat. For calculations I use 2X the RDSon as the resistance value for the avalanche diode in the MOSFET. This needs to be taken into account when driving a inductive load. Switching such as PWM will make it get warmer as will other things.
This inductive flyback is the basic principle of switch mode power supplies including buck and boost modules. Also the "avalanche diode" is part of the structure of the MOSFET and not a separate entity.