Sergio Viudes
Sergio Viudes

Reputation: 2854

More GPIO pins: use expansion boards, or 2 raspberry pi?

I'm planning to start a project using a RPi3 and Android Things. I need 50 GPIO pins (20 inputs, 30 outputs), so I have 2 options: use an expansion board, or use 2 RPis. So I have a question for each option:

EDIT: Here I link a post that describes 3 ways to extend RPi's GPIO ports -> https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=86738#p611850 It may be useful

EDIT 2: I will use 2 MCP23017 (16 port expander). So I will get 32 pins using only the 2 I2C pins. More info: http://ww1.microchip.com/downloads/en/DeviceDoc/21952b.pdf

Upvotes: 0

Views: 1753

Answers (2)

Dave McKelvie
Dave McKelvie

Reputation: 61

You could consider the PCF8574, which is I2C an 8 bit port expander. You can have up to 8 of them on a single I2C bus, giving you up to 64 GPIO pins.

Here is a driver for the PCF8574 for Android Things:

https://github.com/davemckelvie/things-drivers

Upvotes: 1

Seb
Seb

Reputation: 1230

I'm not familiar with Android Things but with some electronic work you will be able to achieve your results.

This 4 line decoder will only use 4 gpio pins to control 16 outputs.

http://www.nxp.com/documents/data_sheet/74HC_HCT154.pdf

The reverse process is also possible. You may use a 16 line "demultiplexer" to encode 16 bits of logic information in on 4 GPIO inputs of your Raspberry

http://www.ti.com/product/CD54HC4514

(the components I selected are the first one I stumbled across. They may not be the best products for your specific application. I used the 74HC238 before on a project and it worked like a charm)

Upvotes: 2

Related Questions