+21622886281
ESP32 Keypad 4x4 SSD1306 display

Using the 4×4 Matrix Keypad with the ESP32 board

The ESP32 is a microcontroller development board that is based on the Espressif Systems ESP32 microcontroller. It features a dual-core processor with WiFi and Bluetooth connectivity, and a wide range of peripheral interfaces, including I2C, SPI, UART, and more.

A 4×4 keypad is a type of input device that consists of 16 buttons arranged in a 4×4 grid. These buttons can be used to input numerical or alphanumeric data, and are commonly used in applications such as access control systems, security systems, and point-of-sale terminals. They can be interfaced with the ESP32 microcontroller using either digital input or matrix scanning. If you are interested in interfacing a 4×4 keypad with an ESP32 microcontroller, you can look into the keypad library in Arduino which can help you to read the input data of the keypad easily and take actions accordingly.

Purpose of tutorial:

In this tutorial we will see how to manipulate the 4×4 matrix keypad by the ESP32 card. If a key on the 4×4 matrix keyboard is pressed, the associated character is displayed in the SSD1306 display.

4×4 Matrix keypad operation with ESP32 board:

Necessary components

ESP32 Card

An ESP32 card is a development board or module that is based on the ESP32 microcontroller developed by Espressif. It typically includes the ESP32 chip, as well as a number of peripheral components, such as RAM, flash memory, power management, and input/output (I/O) pins. ESP32 cards can come in a variety of form factors, including the ESP32-DevKitC, ESP32-WROVER, ESP32-PICO-D4 and more.

ESP32 card can be programmed using various programming languages such as C, C++, Python and MicroPython. The ESP32 has a built-in support for the Arduino IDE which makes it easy to program and debug.

4×4 keypad

A 4×4 keypad is a type of input device that consists of a grid of 4 rows and 4 columns of buttons. It is often used as a simple, low-cost way to add numerical input to a project, such as an access control system or calculator.

The buttons on the keypad are typically labeled with the digits 0-9, as well as a few additional characters such as * and #. Each button is connected to a pin on the keypad’s circuit board, and the pins are connected to a microcontroller or other electronic device.

connecting wires

Wires are used to transmit electrical signals and power to various components such as motors, sensors, and microcontrollers. It’s important to properly route and secure the wires to prevent tangles and damage. There are several methods for doing this, including using cable ties, clamps, and wire looms. It’s also a good idea to use different colors or labeling to identify the different wires and their functions. When connecting wires in a robot, it’s important to follow proper safety procedures, such as using the correct wire stripper and connectors, and wearing protective equipment such as gloves and safety glasses.

test plate

A test plate is a type of device used in robotics to test the functionality and performance of various components or systems. It is typically a physical platform or structure that is designed to hold and support various test items or devices, such as sensors, actuators, motors, or other types of mechanical or electrical components. Test plates can be used to simulate different environments or conditions, such as temperature, humidity, vibration, or other factors, in order to evaluate the performance of the components or systems being tested. They can also be used to perform a variety of diagnostic or diagnostic tests, such as stress testing, endurance testing, or other types of evaluations.

Assembly

We connect the 8 outputs of the keypad to the 8 pins of the ESP32 card following this order: D2, D4, D5, D18, D19, D16, D15 and D23.

For the SSD1306 display we connect:

  • the SDA pin to the D21 pin of the ESP32 board

  • the SCL pin to the D22 pin of the ESP32 board

  • the GND pin to the GND pin of the ESP32 board

  • the VCC pin to the 5V pin of the ESP32 board

Micropython program:

Here is the micropython program that allows you to enter characters from the 4×4 matrix keyboard and display it on the SSD1306 display.

Note: the following library must be imported: ssd1306




0 commentaire


Leave a comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Scroll to Top