Micro:bit board and 4×4 matrix keyboard

Micro:bit 26-11-24
38 0

Tutorial plan

1- What is a 4x4 matrix keyboard ?

2- How Micro:bit board displays 4x4 matrix keypad data ?

3- Components Needed to use a 4x4 matrix keyboard with Micro:bit board

4- Wiring the Components

5- Programming Micro:bit with Makecode

 

 

What is a 4x4 matrix keyboard ?

A 4x4 matrix keyboard is a type of keyboard arrangement that contains 16 keys (4 rows and 4 columns). It is a cost-effective and space-saving way to implement a keyboard input for electronic projects, such as microcontrollers (like Arduino, Micro:bit, etc.), security systems, or home automation devices.

Structure of a 4x4 Matrix Keyboard

The matrix is arranged in a grid of rows and columns, each containing 4 keys. Here's how it's typically organized:

Rows (R1, R2, R3, R4): 4 horizontal connections.

Columns (C1, C2, C3, C4): 4 vertical connections.

Each key is placed at the intersection of a row and a column. When a key is pressed, it connects a specific row and column, and this is how the pressed key is identified.

Key Features:

16 keys: A 4x4 matrix keyboard has a total of 16 physical buttons, arranged in 4 rows and 4 columns.

Wired in a matrix: Instead of connecting each key to a separate pin on the microcontroller, the keys are arranged in a matrix to minimize the number of input/output (I/O) pins needed. Only 8 pins are required—4 for the rows and 4 for the columns.

Scanning Process: The microcontroller scans the keyboard by sending signals to the rows and reading the columns (or vice versa). When a button is pressed, it closes the circuit between a row and a column, allowing the microcontroller to detect which key was pressed.

Advantages:

Reduced Pin Usage: Instead of needing 16 pins to connect each individual key, the matrix structure uses only 8 pins (4 for rows and 4 for columns).

Compact: The matrix layout allows for compact designs, making it ideal for embedded systems or devices with limited space.

Cost-Effective: Using fewer pins for more keys makes matrix keyboards cheaper and easier to implement.

How It Works:

The rows are typically set to a LOW (ground) state one at a time.

The columns are read for a HIGH state.

When a key is pressed, it connects a row to a column, allowing the system to detect which key was pressed based on the row and column combination.

 

How Micro:bit board displays 4x4 matrix keypad data ?

Keypad Scanning: The Micro:bit scans the 4x4 matrix keypad to detect which key is pressed.

Display Update: When a key is pressed, the character corresponding to that key is displayed on its LED displays

Feedback to User: The user sees the pressed key on the display in real-time, which could be part of a larger interface, such as a menu, password input, or control panel.

 

Components Needed to use a 4x4 matrix keyboard with Micro:bit board

To use a 4x4 matrix keyboard with Micro:bit board you will need several key components, each with a specific role.

Here's a description of the components and their functions:

Micro:bit Board

Micro:bit board

The Micro:bit is the microcontroller that handles all the logic and control of the system. It reads input from the 4x4 matrix keyboard, processes the input, and sends the relevant output to the SSD1360 display or other connected devices.

The GPIO expansion card for the Micro:bit card

The GPIO expansion card for the Micro:bit card

The GPIO expansion board for the Micro:bit board expands the capabilities of the Micro:bit board by adding more input/output (GPIO) pins and additional functionality.

4x4 Matrix Keyboard

The 4x4 matrix keyboard acts as the input device. It allows the user to press keys to send commands or data to the Micro:bit. This is typically used for entering PINs, controlling devices, or interacting with the system.

Jumper Wires

Jumper wires

Jumper wires are used to physically connect the Micro:bit board, the 4x4 matrix keyboard, and the SSD1360 display. These wires transfer electrical signals between the components, allowing them to communicate.

Breadboard:

Breadboard

A breadboard can be used to create a temporary circuit for testing and prototyping.

 

Wiring the Components

4x4 Matrix Keypad to Micro:bit:

We connect the 8 outputs of the keypad to the 8 pins of the Micro:bit card following this order: P0, P1, P2, P3, P4, P5, P6 and P7.

 

Programming Micro:bit with Makecode

1- Go to Microsoft MakeCode and start a new project.

2- In MakeCode, open the Blocks Editor (https://makecode.microbit.org/).

3- Use this program to check for button presses and the Micro:bit's LED matrix should display the pressed key.

Download program

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

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

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

+216 92 886 231

medaliprof@gmail.com

Pictures of the articles

Robotic site created by MedAli-Teacher info