Stufin
Home Quick Cart Profile

4x3 Flexible Matrix Keypad

Buy Now on Stufin

Component Name

4x3 Flexible Matrix Keypad

Overview

The 4x3 Flexible Matrix Keypad is a versatile and compact human-machine interface (HMI) component designed for various IoT applications. This keypad combines a flexible and compact design with a 4x3 matrix layout, providing 12 individual switches for user input. Its flexible nature makes it ideal for use in wearable devices, robotics, industrial control systems, and other applications where a compact, customizable keypad is required.

Functionality

The 4x3 Flexible Matrix Keypad is a membrane-based switch matrix that allows users to input data or commands into a connected microcontroller or processing unit. The keypad is designed to detect keypad presses and encode the input data into a digital signal, which is then transmitted to the connected device.

Key Features

  • Flexible Design: The keypad is constructed using a flexible PCB material, allowing it to conform to curved or irregular surfaces, making it ideal for applications where a traditional rigid keypad is not feasible.
  • Compact Size: The 4x3 layout of the keypad provides 12 individual switches in a compact footprint, making it suitable for use in space-constrained applications.
  • Water and Dust Resistant: The keypad is designed with IP67 or higher ratings, ensuring protection against water and dust ingress, making it suitable for use in harsh environments.
  • Low Power Consumption: The keypad is designed to operate at low power levels, minimizing energy consumption and extending battery life in battery-powered applications.
  • Easy Integration: The keypad's flexible nature and compact design make it easy to integrate into a wide range of IoT applications, including wearable devices, industrial control systems, and robotics.
  • Customizable: The keypad's layout and switching functionality can be customized to meet specific application requirements, allowing for tailored user interfaces.
  • Durability: The keypad is designed to withstand heavy use and is built with durable materials to ensure long-term reliability.

Operating Voltage

2.5V to 5.5V

Current Consumption

10mA

Switch Type

Membrane-based switches

Switch Life

1 million cycles

Operating Temperature

-20C to 80C

Storage Temperature

-40C to 120C

Dimensions

40mm x 60mm x 0.5mm (flexible PCB) or 45mm x 65mm x 1.5mm (rigid PCB)

Applications

Wearable devices (smartwatches, fitness trackers)

Industrial control systems (robotics, machine control)

IoT devices (home automation, security systems)

Medical devices (patient monitoring systems)

Automotive systems (in-car entertainment, navigation)

Connectivity

The 4x3 Flexible Matrix Keypad can be connected to a microcontroller or processing unit using a variety of interfaces, including

I2C

SPI

UART

GPIO

Certifications and Compliance

The 4x3 Flexible Matrix Keypad meets or exceeds the following certifications and standards

RoHS compliant

REACH compliant

CE certified

UL certified (optional)

Ordering Information

The 4x3 Flexible Matrix Keypad is available in various package options, including

Reel quantity

1000 pieces

Tray quantity

500 pieces

Tape and reel

3000 pieces

Please contact our sales team for pricing, lead time, and customization options.

Pin Configuration

  • 4x3 Flexible Matrix Keypad Documentation
  • The 4x3 Flexible Matrix Keypad is a compact and flexible keypad designed for various IoT applications. It features a 4x3 matrix of buttons, providing a total of 12 keys for user input. The keypad connects to a microcontroller or other compatible devices through a set of pins, which are explained in detail below.
  • Pinout:
  • The 4x3 Flexible Matrix Keypad has a total of 7 pins, labeled as follows:
  • Pin 1: Row 1 (R1)
  • Function: Row 1 of the keypad matrix
  • Description: Connects to a digital input pin on the microcontroller to scan the first row of keys
  • Connection: Typically connected to a digital input pin (e.g., D2) on the microcontroller
  • Pin 2: Row 2 (R2)
  • Function: Row 2 of the keypad matrix
  • Description: Connects to a digital input pin on the microcontroller to scan the second row of keys
  • Connection: Typically connected to a digital input pin (e.g., D3) on the microcontroller
  • Pin 3: Row 3 (R3)
  • Function: Row 3 of the keypad matrix
  • Description: Connects to a digital input pin on the microcontroller to scan the third row of keys
  • Connection: Typically connected to a digital input pin (e.g., D4) on the microcontroller
  • Pin 4: Row 4 (R4)
  • Function: Row 4 of the keypad matrix
  • Description: Connects to a digital input pin on the microcontroller to scan the fourth row of keys
  • Connection: Typically connected to a digital input pin (e.g., D5) on the microcontroller
  • Pin 5: Column 1 (C1)
  • Function: Column 1 of the keypad matrix
  • Description: Connects to a digital input pin on the microcontroller to scan the first column of keys
  • Connection: Typically connected to a digital input pin (e.g., D6) on the microcontroller
  • Pin 6: Column 2 (C2)
  • Function: Column 2 of the keypad matrix
  • Description: Connects to a digital input pin on the microcontroller to scan the second column of keys
  • Connection: Typically connected to a digital input pin (e.g., D7) on the microcontroller
  • Pin 7: Column 3 (C3)
  • Function: Column 3 of the keypad matrix
  • Description: Connects to a digital input pin on the microcontroller to scan the third column of keys
  • Connection: Typically connected to a digital input pin (e.g., D8) on the microcontroller
  • Connection Structure:
  • To connect the 4x3 Flexible Matrix Keypad to a microcontroller, follow this structure:
  • Connect Pins 1-4 (R1-R4) to digital input pins on the microcontroller (e.g., D2-D5)
  • Connect Pins 5-7 (C1-C3) to digital input pins on the microcontroller (e.g., D6-D8)
  • Use a pull-up or pull-down resistor for each pin to prevent floating inputs
  • Write a keypad scanning routine in the microcontroller's firmware to read the keypad state and detect key presses
  • Note:
  • The exact pin connections may vary depending on the specific microcontroller and its pinout.
  • The keypad scanning routine should be implemented to avoid key bounce and debounce issues.
  • This documentation assumes a basic understanding of microcontroller programming and digital input/output operations.

Code Examples

4x3 Flexible Matrix Keypad Documentation
Overview
The 4x3 Flexible Matrix Keypad is a compact, flexible, and easy-to-use input device designed for IoT projects. It features 12 keys arranged in a 4x3 matrix, providing a convenient way to add user input functionality to your projects. This keypad is ideal for applications where a simple and intuitive interface is required.
Pinout
The 4x3 Flexible Matrix Keypad has 7 pins:
VCC: Power supply (typically 3.3V or 5V)
 GND: Ground
 R1-R4: Row pins (connected to microcontroller's digital inputs)
 C1-C3: Column pins (connected to microcontroller's digital outputs)
Connecting the Keypad
To connect the keypad to a microcontroller, follow these steps:
1. Connect VCC to the power supply (3.3V or 5V).
2. Connect GND to the microcontroller's ground pin.
3. Connect the row pins (R1-R4) to digital input pins on the microcontroller.
4. Connect the column pins (C1-C3) to digital output pins on the microcontroller.
Code Examples
### Example 1: Basic Keypad Scan (Arduino)
This example demonstrates a basic keypad scan using an Arduino board. The code uses the `digitalRead` function to read the row pins and the `digitalWrite` function to set the column pins.
```cpp
const int rowPins[] = {2, 4, 5, 7}; // Row pins connected to digital inputs
const int colPins[] = {8, 9, 10}; // Column pins connected to digital outputs
const int numRows = sizeof(rowPins) / sizeof(rowPins[0]);
const int numCols = sizeof(colPins) / sizeof(colPins[0]);
void setup() {
  // Initialize row pins as inputs
  for (int i = 0; i < numRows; i++) {
    pinMode(rowPins[i], INPUT);
  }
  
  // Initialize column pins as outputs
  for (int i = 0; i < numCols; i++) {
    pinMode(colPins[i], OUTPUT);
  }
}
void loop() {
  // Scan the keypad
  for (int col = 0; col < numCols; col++) {
    digitalWrite(colPins[col], HIGH);
    for (int row = 0; row < numRows; row++) {
      if (digitalRead(rowPins[row]) == LOW) {
        // A key is pressed, print the key value
        Serial.print("Key ");
        Serial.print(row  numCols + col + 1);
        Serial.println(" is pressed.");
      }
    }
    digitalWrite(colPins[col], LOW);
  }
  delay(20); // Debounce delay
}
```
### Example 2: Keypad Interface with Interrupt (ESP32)
This example demonstrates a keypad interface using an ESP32 board and interrupts to detect key presses.
```cpp
#include <esp32-hal-gpio.h>
const int rowPins[] = {GPIO_NUM_2, GPIO_NUM_4, GPIO_NUM_5, GPIO_NUM_7}; // Row pins connected to digital inputs
const int colPins[] = {GPIO_NUM_8, GPIO_NUM_9, GPIO_NUM_10}; // Column pins connected to digital outputs
const int numRows = sizeof(rowPins) / sizeof(rowPins[0]);
const int numCols = sizeof(colPins) / sizeof(colPins[0]);
void IRAM_ATTR keypad Interrupt() {
  // Clear the interrupt flag
  gpio_isr_handler_remove_all(rowPins[0]);
  
  // Scan the keypad
  for (int col = 0; col < numCols; col++) {
    gpio_set_level(colPins[col], 1);
    for (int row = 0; row < numRows; row++) {
      if (gpio_get_level(rowPins[row]) == 0) {
        // A key is pressed, print the key value
        Serial.print("Key ");
        Serial.print(row  numCols + col + 1);
        Serial.println(" is pressed.");
      }
    }
    gpio_set_level(colPins[col], 0);
  }
}
void setup() {
  // Initialize row pins as inputs with pull-ups
  for (int i = 0; i < numRows; i++) {
    gpio_config_t io_config = {};
    io_config.intr_type = GPIO_INTR_NEGEDGE;
    io_config.mode = GPIO_MODE_INPUT;
    io_config.pull_up_en = 1;
    gpio_config(&io_config, rowPins[i]);
  }
  
  // Initialize column pins as outputs
  for (int i = 0; i < numCols; i++) {
    gpio_config_t io_config = {};
    io_config.mode = GPIO_MODE_OUTPUT;
    gpio_config(&io_config, colPins[i]);
  }
  
  // Attach the interrupt handler
  gpio_isr_handler_add(rowPins[0], keypadInterrupt, NULL);
}
void loop() {
  // Nothing to do here, the interrupt handler will capture key presses
}
```
### Example 3: Keypad Scanning with Debouncing (Raspberry Pi and Python)
This example demonstrates a keypad scanning with debouncing using a Raspberry Pi and Python.
```python
import RPi.GPIO as GPIO
import time
rowPins = [17, 23, 24, 25] # Row pins connected to digital inputs
colPins = [4, 5, 6] # Column pins connected to digital outputs
numRows = len(rowPins)
numCols = len(colPins)
# Set up GPIO mode
GPIO.setmode(GPIO.BCM)
# Initialize row pins as inputs with pull-ups
for pin in rowPins:
    GPIO.setup(pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
# Initialize column pins as outputs
for pin in colPins:
    GPIO.setup(pin, GPIO.OUT)
def scanKeypad():
    for col in range(numCols):
        GPIO.output(colPins[col], 1)
        for row in range(numRows):
            if GPIO.input(rowPins[row]) == 0:
                # A key is pressed, print the key value
                print(f"Key {(row  numCols + col + 1)} is pressed.")
                # Debounce delay
                time.sleep(0.1)
        GPIO.output(colPins[col], 0)
try:
    while True:
        scanKeypad()
        time.sleep(0.01) # Scan interval
except KeyboardInterrupt:
    GPIO.cleanup()
```
These examples demonstrate how to use the 4x3 Flexible Matrix Keypad in various contexts, including Arduino, ESP32, and Raspberry Pi platforms.