MCP23017 16-BIT I/O EXPANDER SERIAL I2C INTERFACE MODULE
Operating Voltage : 2.7 - 5V @ -40° to 85°C
I²C MCP23017 Bidirectional 16-Bit I/O Expander 10Mhz
1x MCP23017 Serial Interface Module
Add another 16 pins to your microcontroller using a MCP23017 port expander. The MCP23017 uses two i2c pins (these can be shared with other i2c devices), and in exchange gives you 16 general purpose pins. You can set each of 16 pins to be input, output, or input with a pullup. There's even the ability to get an interrupt via an external pin when any of the inputs change so you don't have to keep polling the chip.
Use this chip from 2.7-5.5V (good for any 3.3V or 5V setup), and you can sink/source up to 20mA from any of the I/O pins so this will work for LEDs and such.
I²C Write Interface : - The I²C write operation includes the control byte and register address sequence. This sequence is followed by eight bits of data from the master and an Acknowledge (ACK) from the MCP23017. The operation is ended with a Stop (P) or Restart (SR) condition being generated by the master. Data is written to the MCP23017 after every byte transfer. If a Stop or Restart condition is generated during a data transfer, the data will not be written to the MCP23017.
I²C Read Interface :- I²C Read operations include the control byte sequence. This sequence is followed by another control byte (including the Start condition and ACK) with the R/W bit set (R/W = 1). The MCP23017 then transmits the data contained in the addressed register. The sequence is ended with the master generating a Stop or Restart condition.
16-Bit I/O Expander IIC I2C SPI Serial Interface Module MCP23017
Package Contents: 1 x Serial Interface Module, 1 x Pin Header