-1

I'm trying to make my case fan turn on using Python code. I have connected the fan to the GPIO 4 pin and the ground pin. The code I'm using is below:

import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(4, GPIO.OUT)
GPIO.output(4, True)

The fan works with both the 5 V and the 3.3 V pins already, but when I connect it to the GPIO 4 pin, it does not spin!

1 Answers1

3

You can't just connect a fan directly to a GPIO pin as the current draw would be too high. Each GPIO pin has a max current of about 16 milli amps.

CoderMike
  • 7,102
  • 1
  • 11
  • 16