Making a calculator using Arduino and 4*4 Keypad
Updated: Aug 9
We use calculators more often in our daily life to perform many kinds of calculations for various purposes. In this blog, we will learn to make a calculator by interfacing a 4x4 keypad that takes input from the user and performs the arithmetic operations like addition, subtraction, multiplication, division and the result of the operation (i.e., output) will be displayed on the LCD screen.
Hardware Requirements:
1. 4x4 keypad:

A 4x4 matrix keypad is used as an input device that takes inputs from the users. It consists of 16 pins in total with four rows and four columns. On pressing a key, a connection will be established between the corresponding row and column between which the switch is placed.
2. Arduino UNO:

The Arduino is a programmable #microcontroller, it's an open-source electronics proto-type platform. It interacts with the user by receiving input with the aid of sensors and provides the output employing LED, buzzer, etc.,
In order to know more about the Arduino UNO, refer to this article.
3. 16x2 LCD:

LCD- Liquid Crystal Display is an electronic module that uses liquid crystal to produce a visible image. It is the basic module that is generally used in DIY and circuits. The display segments are affordable and simply programmable.
4. Jumper Wires:

Jumper wires are used to establish connections between different components in the circuit.
Circuit Connection:

Hardware Circuit:

What goes where??
Circuit Connection involves the following steps:
Column pins C4-C1 of the keypad are connected to 6-9 PWM pins of the Arduino respectively.
Row pins R1-R4 of the keypad are connected to 10-13 PWM pins of the Arduino respectively.
The Ground pin of the LCD is connected to the GND pin of the Arduino.
Vcc of the LCD is connected to the 5V of the Arduino.
SDA is connected to analog pin 4 of the Arduino.
SCL is connected to analog pin 5 of the Arduino.
Code
Working:
After switching ON the Arduino, the operands and operator values are entered, and the '=' symbol is pressed to get the final answer to be displayed on the LCD.

Check the practical implementation of the above-explained project and see how it works before you try it yourself.
Video by - Aishwarya Balajee and edited by Neha Patil
See also:
1.Smart Lighting System - Using LED's, LDR and Raspberry Pi
2.Interfacing Keypad with Arduino using TinkerCAD
3.Arduino DIY Calculator using a 4*4 Keypad and 16*2 LCD Display