My fan dosen't want to spin.

October 30, 2024, 17:27

foxy.cz

So i am making a security camera out of raspberry pi zero 2 w, with installed motioneyeos on it. The problem is that i want to connect a fan for keeping the raspberry pi cool. But when i connect it to the board with the NPN transistor to the GPIO4 and ground to ground and to 5v nothing happens. I do have command line in cmdline.txt for the GPIO-fan overlay but it does nothing. What am i doing wrong?

thunder07337

The 470 Ohm resistor is missing...

foxy.cz

I mean yeah, but is it needed?

thunder07337

I don't know, since you haven't posted any instructions, I can't say anything about it.

foxy.cz

Well, to be honest i also don't have any instructions. I am just finding clues on internet. I am new at this and i never worked with raspberry pi. I just need to connect 5v fan to a raspberry pi. And control it by temperature on the raspberry. So basically by GPIO-Fan overlay, u can google it. But i dont think that i need that resistor but i could try.. just need to find one 😄

thunder07337

Well, to control the fan it is not enough to simply connect it to one of the gpio. You also need a program. So if you don't have a manual, you should look for one.

foxy.cz

So, i did connect it to gpio pin, and have a code in python that basically truns on that gpio pin but again.. nothing happend so either my coding sucks (that may be high posibility) or my hardware sucks so i dont know, i will test it more and we will see

oops.se

Yes it is needed, otherwise there is no current limiter

foxy.cz

Okay, thanks!

oops.se

This describes how a Relay Driver Circuit works, but its the same for a fan, light or other devices that consumes more current than a Pico/Pi can supply.

foxy.cz

thanks, i will try it.

oops.se

And an improvement is to replace the BC338 with a MOSFET as a BC338 has a voltage drop of ~0,7 volt and an TTL MOSFET has a much lower voltage drop.

foxy.cz

Thanks a lot for the help, it seems that i used a damaged transistor or a PNP type. So i just bought a new NPN transistor, specifically the 2N2222.