Page 1 of 1

MCP23017-based GPIO expander compatible with R Pi?

Posted: Fri Jul 26, 2019 12:13 pm
by seanspotatobusiness
Can this kind of GPIO expander be used with the Raspberry Pi? https://www.aliexpress.com/item/3294560 ... 4c4dsJudEA

The listing only mentions the Arduino but I thought it might work with the Raspberry Pi as well.

Also, would using that kind of expander be a way of protecting the Pi GPIO pins from mishaps? Like the mistakes would only affect the expansion board and not the Pi? I can't remember what kind of mistakes destroy GPIO pins but I know it's not uncommon.

Re: MCP23017-based GPIO expander compatible with R Pi?

Posted: Fri Jul 26, 2019 12:15 pm
by trejan

Re: MCP23017-based GPIO expander compatible with R Pi?

Posted: Fri Jul 26, 2019 1:10 pm
by hippy
seanspotatobusiness wrote:
Fri Jul 26, 2019 12:13 pm
Can this kind of GPIO expander be used with the Raspberry Pi? ...
Any device with an I2C (IIC, TWI) or SPI interface can usually be connected to a Pi, Arduino or any other microcontroller. Either through dedicated I2C or SPI hardware pins or general digital I/O pins using bit-banging.

The main requirement is that device and the controller have compatible signal voltages or an interface is added to allow operation between incompatible voltages.

Re: MCP23017-based GPIO expander compatible with R Pi?

Posted: Sat Jul 27, 2019 9:37 am
by LTolledo
seanspotatobusiness wrote: Also, would using that kind of expander be a way of protecting the Pi GPIO pins from mishaps? Like the mistakes would only affect the expansion board and not the Pi?
This is the same reason I got the MCP23017 (and the MCP23008) in the first place. Not the module but the IC itself (got myself some good inventory of those), and made my own interface boards.

also it more handy in providing more outputs than the RPi board itself can provide.

do remember that each port/pin can source or sink max 25mA,
however, if you plan to turn on all 16 port/pins to sink or source at the same time, that value drops to 7.5mA (Vdd max current divided by 16 ports)

for higher output current requirements, better add a transistor or transistor array to the output ports/pins.

am using Adafruit library at the moment....
....and still waiting for MCP23017/MCP23008's integration to gpiozero.....