Functionality

The keypad module connects to the main controller via a 4-wire I2C bus interface and provides the following functions:

I2C bus input and output through ports. Input for connection to MCU and output - for connection of any external devices that support the I2C specification.

Thanks to the use of the I2C bus and the MCP23017 port expander, GPIO savings of the main controller and the ability to input and output information in a user-friendly way are achieved. The rest of 7 GPIOs are connected to separate pin connectors for additional I / O signals connection according to the user's design. Int A & Int B output signals are available - can be used for interrupt processing when the state of the module inputs changes.

Application

I2CUI4_V1 keypad will be convenient to use as a control panel and status display on user devices

Usecase example

The image shows the application of another of our I2CUI3_V1 modules in a DIY GGreg20_V3-based Geiger counter. The I2CUI4_V1 module is an updated and more versatile version that allows you to build convenient and reliable DIY and IoT solutions for most platforms.

Compatibility

Compatible with controllers and platforms:

Integration into Home Assistant (with ESPHome plugin), Blynk, OpenHab, Node-RED is possible.

Minor and major versions of the module

Unlike the minor version I2CUI3_V1, the I2CUI4_V1 user interface module uses a widely supported 16-bit MCP23017 port expander. This makes it possible to use this module in IoT devices for easy integration in Home Assistant, Arduino and many others.

Chips of user interface modules:

The major version of I2CUI4_V1 has the following features:

Driver-level support

Support for the MCP23017 chip at the driver level is stated in particular by the following platforms:

PlatformAPI or Documentation Link
NodeMCU / Luahttps://nodemcu.readthedocs.io/en/latest/lua-modules/mcp23017/
OpenHabhttps://www.openhab.org/addons/bindings/mcp23017/
Home Assistanthttps://www.home-assistant.io/integrations/mcp23017/
ESP Homehttps://esphome.io/components/mcp230xx.html
Arduinohttps://www.arduino.cc/reference/en/libraries/mcp23017/
Blynkhttps://community.blynk.cc/t/using-the-mcp23017-io-expansion-board/44525/3
Node-REDhttps://flows.nodered.org/node/node-red-contrib-mcp23017

Assignment of module ports

The following ports are provided on the I2CUI4_V1 module board:

Port NameAssignmentLogic
GPIO 0 (GPB0)Buzzer on board3V3 or 5V active high
GPIO 1 (GPB1)Free, for user extensions3V3 or 5V active low
GPIO 2 (GPB2)Free, for user extensions3V3 or 5V active low
GPIO 3 (GPB3)Free, for user extensions3V3 or 5V active low
GPIO 4 (GPB4)Free, for user extensions3V3 or 5V active low
GPIO 5 (GPB5)Free, for user extensions3V3 or 5V active low
GPIO 6 (GPB6)Free, for user extensions3V3 or 5V active low
GPIO 7 (GPB7)Free, for user extensions3V3 or 5V active low
GPIO 8 (GPA0)LED - Blue on board3V3 or 5V active high
GPIO 9 (GPA1)LED - Green on board3V3 or 5V active high
GPIO 10 (GPA2)LED - Red on board3V3 or 5V active high
GPIO 11 (GPA3)Key Up on board3V3 or 5V active high
GPIO 12 (GPA4)Key Down on board3V3 or 5V active high
GPIO 13 (GPA5)Key Left on board3V3 or 5V active high
GPIO 14 (GPA6)Key Right on board3V3 or 5V active high
GPIO 15 (GPA7)Key OK on board3V3 or 5V active high
A0I2C address bit 0GND=0; VDD=1, by default 0
A1I2C address bit 1GND=0; VDD=1, by default 0
A2I2C address bit 2GND=0; VDD=1, by default 0
IntAInterrupt for GPIO group A3V3 or 5V active low
IntBInterrupt for GPIO group B3V3 or 5V active low
I2CSDA I2C I/O3V3 or 5V active low
I2CSCL I2C I/O3V3 or 5V active low
3V3Power1.8-5.5 V
GNDCommon ground

Power supply and consumption

The power supply of the module is possible in the range of voltages of 1.8 - 5,5 volts. The current consumption of the I2CUI4 module at rest is about 1 microampere. In the case of simultaneous data output to R + G + B + buzzer, the maximum current consumption can reach 20 milliamperes.

Addressing on the I2C bus

The address of the module has a fixed and variable part:

Fixed address partVariable (selectable) address part
0 1 0 0A2 A1 A0

The address of the module I2CUI4_V1 is selected in accordance with the documentation on the chip MCP23017 because it is this chip of the module that interacts with the main controller via the I2C bus.

Interrupt handling

The module has two interrupt channels: Int A and Int B. All processing and logic (active-low) correspond to the documentation for the MCP23017 chip. Interrupt processing is provided for the master controller to monitor changes in GPIO states set to input mode.

Note: When you want to process interrupts from one combined INT and not from each separately INTA and INTB, the client must solder to connect the INTA and INTB pads.

According to the design of the interface module I2CUI4_V1, input mode:

Ports GPIO 0 (GPB0) Buzzer on board, GPIO 8 (GPA0) LED - Blue on board, GPIO 9 (GPA1) LED - Green on board, GPIO 10 (GPA2) LED - Red on board - work on the module as outputs.

Module dimensions

The dimensions of the module board are 50 x 52 mm. Module height (Z): 15 mm.

Product kit sets

The module is delivered in the following sets: