

The Module Converter Keypad Matrix 4x4 to I2C is a versatile electronic component designed to simplify the process of interfacing a 4x4 matrix keypad with microcontrollers. By converting the keypad's row-column signals into I2C communication, this module reduces the number of GPIO pins required and streamlines the process of reading key presses. It is particularly useful in applications where GPIO pin availability is limited or where I2C communication is preferred.








The module has two main interfaces: the keypad input pins and the I2C communication pins.
| Pin Name | Description |
|---|---|
| R1 | Row 1 input from the keypad |
| R2 | Row 2 input from the keypad |
| R3 | Row 3 input from the keypad |
| R4 | Row 4 input from the keypad |
| C1 | Column 1 input from the keypad |
| C2 | Column 2 input from the keypad |
| C3 | Column 3 input from the keypad |
| C4 | Column 4 input from the keypad |
| Pin Name | Description |
|---|---|
| VCC | Power supply input (3.3V to 5V) |
| GND | Ground |
| SDA | I2C data line |
| SCL | I2C clock line |
Below is an example of how to interface the module with an Arduino UNO to read key presses:
#include <Wire.h> // Include the Wire library for I2C communication
#define I2C_ADDRESS 0x20 // Default I2C address of the module
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Start serial communication for debugging
Serial.println("4x4 Keypad I2C Module Test");
}
void loop() {
Wire.requestFrom(I2C_ADDRESS, 1); // Request 1 byte from the module
if (Wire.available()) {
byte key = Wire.read(); // Read the key press data
if (key != 0) { // Check if a key is pressed
Serial.print("Key Pressed: ");
Serial.println(key, HEX); // Print the key value in hexadecimal
}
}
delay(100); // Small delay to avoid flooding the serial monitor
}
I2C_ADDRESS if you change the module's default address.No Key Press Detected
Incorrect Key Values
I2C Communication Errors
Module Overheating
Q: Can I use this module with a 3x4 keypad?
A: Yes, but you will need to leave one row or column unconnected. The module will still function, but some key positions will be unused.
Q: How do I change the I2C address?
A: The module's I2C address can be changed by modifying the solder jumpers on the PCB. Refer to the module's datasheet for detailed instructions.
Q: Is this module compatible with Raspberry Pi?
A: Yes, the module is compatible with Raspberry Pi. Use the smbus library in Python to communicate with the module over I2C.
Q: Do I need to debounce the keypad in software?
A: Yes, it is recommended to implement software debouncing to avoid false key presses caused by mechanical bounce.