Build a Calculator Using the ESP32 Board

ESP32 13-02-26
15 0

Tutorial plan

1- Objective of the project

2- Required Components

3- Circuit Connections of system

4- Micropython program of ESP32 calculator

 

Objective of the project

The objective of this project is to design and implement a functional digital calculator using the ESP32 microcontroller. The system allows the user to enter numbers and select arithmetic operations through a 4x4 matrix keypad, while the results are displayed clearly on an LCD I2C display.

This project aims to:

1- Understand how to interface a 4x4 matrix keypad with the ESP32 to detect user input.

2- Learn how to control an LCD I2C display to show numbers and calculation results.

3- Program the ESP32 using MicroPython to perform basic arithmetic operations such as addition, subtraction, multiplication, and division.

4- Practice embedded systems programming and hardware–software integration.

5- Develop problem-solving skills through real-time input processing and output display.

By completing this project, learners will gain practical experience in microcontroller programming, electronic circuit connections, and interactive embedded system design.

 

Required Components

1. BBC Micro:bit (Microcontroller)

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

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 ESP32 board.

 

Circuit Connections of system

 

1- Connection of keypad to ESP32 board

4x4 Keypad ESP32 board
R1 GPIO23
R2 GPIO19
R3 GPIO18
R4 GPIO5
C1 GPIO17
C2 GPIO16
C3 GPIO4
C4 GPIO2

 

2- Connection of LCD I2C display to ESP32

LCD I2C display ESP32
VCC 5V
GND GND
SDA P20
SCL P19

 

Micropython program of ESP32 calculator

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

You need to install this libraries : i2c_lcd et lcd_api 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