-1

I have added a power switch to turn on/off my raspberry pi 4. When I use this switch the fan connected still remains on. How would I add something to my script when the switch is toggled to turn off this fan. I read this post here: How to operate a cooling fan using GPIO pins, RaspPi2 Where one of the answers said that if you have the fan connected to %V and ground pin you can not disable the fan. This is exactly the pins I have my fan connected to (pins 4 and 6) So is there any other way I could connect the fan to be disabled when the power switch is toggled or since this information is somewhat old is possible to toggle power to these pins now on the raspberry pi 4.

Dextron
  • 99
  • 1
    Can you show us how your on/off power switch is wired to your RPi? (Please use the [schematic tool](https://raspberrypi.meta.stackexchange.com/questions/2074/how-do-i-add-a-schematic-to-my-question) to draw a simple diagram) – Seamus Jul 15 '20 at 06:26
  • This might help a bit: https://raspberrypi.stackexchange.com/questions/104196/how-to-remotely-turn-off-the-cooling-fan-of-an-already-software-shut-down-rpi. Cheers. – tlfong01 Jul 15 '20 at 06:30

1 Answers1

0

You can only control a fan with additional circuitry. See https://raspberrypi.stackexchange.com/a/105820/8697 for an example.

Pins 4 & 6 are DIRECTLY connected to the input 5V supply so cannot be controlled by the Pi. However if you remove power to the Pi they should NOT have any voltage.

If the fan continues to run you have NOT removed power - this can be verified by measuring the voltage on pin 2. (Be careful NOT to accidentally connect to any other pin - especially pin 1 which is adjacent. This will instantly kill the Pi.)

If you have other powered devices connected to the Pi it is possible they are supplying power e.g. via a USB connection. This should NOT happen, and it should NOT be possible to back power the Pi. If this happens the cause is external to the Pi.

Milliways
  • 54,718
  • 26
  • 92
  • 182