0

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:

  • If I use an expansion board: will be possible to use it with Android Things?
  • If I use 2 RPis: what's the best way to communicate between them? (for example: a signal received in a GPIO in RPi A, may trigger an output in RPi B)

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

Sergio Viudes
  • 2,714
  • 5
  • 26
  • 44

2 Answers2

2

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)

Seb
  • 1,230
  • 11
  • 19
  • Thank you. I've read more about using a multiplexor. It works, but the only problem is that only one pin can be activated at a time. – Sergio Viudes Jan 11 '17 at 08:05
1

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