seanspotatobusiness
Posts: 192
Joined: Tue May 22, 2012 11:19 pm

MCP23017-based GPIO expander compatible with R Pi?

Fri Jul 26, 2019 12:13 pm

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.
Last edited by seanspotatobusiness on Fri Jul 26, 2019 12:17 pm, edited 1 time in total.
Raspberry Pi 3 B and B+
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"


hippy
Posts: 6087
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

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

Fri Jul 26, 2019 1:10 pm

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.

LTolledo
Posts: 2022
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

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

Sat Jul 27, 2019 9:37 am

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.....
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Return to “Beginners”