I'm looking to do something interesting with 16-20 laptop and computer fans. I was wondering if this was possible to just connect them to a large battery and then use a trigger to control some power switches or something.

  • Use MCP23017 and MCP23S17 chips and you can get 768 extra GPIO. That would need eight MCP23017 chips on the I²C bus. And eight MCP23S17 chips on each of the five SPI busses. Each MCP23x17 gives you 16 GPIOs.
    – Dougie
    Mar 5, 2019 at 23:23

1 Answer 1


The title asks how many, but the question asks whether 16-20 is possible.

You have (more than) 20 GPIO pins so 20 is easily possible.

The absolute limit is practically infinite with simple extra hardware - for example you could chain practically any number of shift registers to give you, to all intents and purposes, any number of outputs you like, provided you don't need to control them particularly fast.

In either case you cannot run relays directly from the Pi - you will need transistors to drive them, to prevent too much current from being drawn from the Pi's outputs. Most "relay modules" seem to have these built in, whereas if you buy literally a "relay" it won't.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.