Close

Fan Controller - using STP16NF06L

A project log for Greenhouse Pi

Solar powered Raspberry Pi measuring greenhouse environmental data and driving some actors

dotpidotDotPiDot 08/18/2016 at 20:210 Comments

So after having mounted all temperature sensors i started to work on the part which will be driving a fan to cool the greenhouse and to controll the humidity. I decided i have no need for PWM controll of the fan. It is fine that the fan is running full speed all the time as to have an effect at all the fan needs to run full speed anyways.

So i just neded to drive a 12v fan - which requires a Mosfet (i decided to go for the STP16NF06L as it was avialbale at the local store). Very important is the "L" at the end - as there are other version without that available - those are not logic level Mosfet. This would mean they cannot be (fully) triggered using a Raspberry. The STP16NF06L is an N-Chanel Mosfet which potentially could drive up to 45W which is far more than the 4W i will need for one fan. I could easily add another fan just attaching it to the same wire later...

So the layout is pretty straight forward:

The N-Chanel Mosfet switches Ground whereas the +12V is just passed through to the fan. To make sure we don't get nasty side effects of course Raspberry GND and the GND of 12V supply need to be connected. Of course one GPIO (here GPIO23) is connected to the Mosfet's gate (Mosfet Pin 1) - which is actual the switching port. Last but not least a pull-down resistor is used to make sure that the switch (Gate) is in a defined state (GND) even of the Raspberry GPIO is in input mode.

The Mosfet source (Mosfet Pin 3) and the Drain (Mosfet Pin 2) to the fan's GND in.

That's it and should work nicely.

Tomorrow i'll solder this on experimental board to test it...

Discussions