Create a Calculator with the Micro:bit Board

Micro:bit 11-02-26
9 0

Tutorial plan

1- Objective of the project

2- Required Components

3- Circuit Connections of system

4- Micropython program of Micro:bit calculator

 

Objective of the project

The objective of this project is to design and program a functional calculator controlled by the Micro:bit board, using an I2C LCD display for output and a 4x4 matrix keypad for user input.

This project aims to help learners understand how to interface the Micro:bit with external hardware components, including an LCD display for showing numbers and results, and a matrix keypad for entering mathematical operations. It also develops programming skills in MicroPython (or MakeCode), particularly in handling input scanning, data processing, conditional statements, and arithmetic operations.

By completing this project, students will:

Learn how to connect and configure an I2C LCD display with the Micro:bit.

Understand how a 4x4 matrix keypad works and how to read key presses.

Implement basic arithmetic operations (addition, subtraction, multiplication, and division).

Develop problem-solving skills through embedded system design.

Gain practical experience in combining hardware and software to create a real electronic device.

Overall, this project introduces fundamental concepts of embedded systems, electronics, and programming in an interactive and educational way.

 

Required Components

1. BBC Micro:bit (Microcontroller)

Micro:bit board

The Micro:bit is a small programmable microcontroller board designed for education. It acts as the main controller (brain) of the calculator.

GPIO Extension Card for Micro:bit

The GPIO expansion card for the Micro:bit card

The GPIO extension card Expands the number of usable input/output pins on the Micro:bit, making it easier to connect multiple components like the keypad and LCD display.

2. 4x4 Matrix Keypad

The 4x4 matrix keypad is used to input numbers and operations.

4. LCD Display with I2C Module

The LCD I2C display is used to show: entered numbers, mathematical operations and calculation results.

5. Breadboard 

Breadboard

Breadboard is used for building a non-permanent circuit without soldering.

6. Jumper Wires

Jumper wires

Jumper wires (male-to-male or male-to-female) are used to connect components to the Micro:bit.

 

Circuit Connections of system

1- Connection of keypad to Micro:bit

4x4 Keypad Micro:bit
R1 P0
R2 P1
R3 P2
R4 P8
C1 P12
C2 P13
C3 P14
C4 P15

Connection of LCD I2C display to Micro:bit

LCD I2C display Micro:bit
VCC 5V of GPIO card
GND GND
SDA P20
SCL P19

 

Micropython program of Micro:bit calculator

This program transforms the Micro:bit into a functional calculator using a 4x4 matrix keypad for input and an I2C LCD display for output.

You need to install this library : i2c_lcd for I2C LCD screen.

 

 

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 Mohamed Ali Haj Salah - Teacher info