I have several Raspberry Pi 4 with a case that includes a fan. I connected the red cable to 5v Power(Physical/Board pin 4) and the black cable to GPIO 14 (Physical/Board pin 8). I setup raspi-config to turn on fan at 60 and use GPIO 14. When the temperature goes higher than 60 degrees, I notice the GPIO gets triggered, but the FAN doesn't spin. If I connect power and ground the fan spins. I would really prefer to make a config change and have to unmount and take apart 8 Raspberry Pi.
Asked
Active
Viewed 1.1k times
3 Answers
2
You should NEVER connect a GPIO to an inductive load. Eventually you will destroy the GPIO and the Pi.
You should NEVER connect a GPIO to a voltage outside the range 0 to 3.3 volts. Eventually you will destroy the GPIO and the Pi.
A GPIO can only supply (source or sink) about 20 milliamps at 3.3 volts. Nowhere near enough to power a motor even if it was safe to do so.
joan
- 67,803
- 5
- 67
- 102
-
Thanks for that. If I had external power and relay switch for the power, is there a way to configure it? – nyitguy Mar 24 '21 at 23:01
-
@nyitguy Yes, using a relay (or just simply a transistor) is the common way of powering a fan. You'll find lots of tutorials on how to wire that up. I'm a bit confused that your housing does not include the relevant electronics (or at least a description on how you should do that) – PMF Mar 25 '21 at 06:47
1
I endorse joan's comments.
It is simple to control a fan with inexpensive circuit. See https://raspberrypi.stackexchange.com/a/105820/8697
See https://docs.google.com/document/d/1bxIzUXLXdrtTo7DwAYv8maLeBssYau4nWwyeAAjot-0 for a picture of my module.
Milliways
- 54,718
- 26
- 92
- 182
-
I know it's super simple but do they sell the pieces needed already built? I have a total of 8 to do. – nyitguy Apr 05 '21 at 15:41