In previous tutorials, we learned about display modules and keypad. In this article, I will share how to make an Arduino Calculator using a LCD display and keypad module. Using this calculator we can do simple addition, subtraction, multiplication and division. So without wasting any more time, let’s begin…
Requirements:
- Arduino UNO
- 16*2 LCD Module
- 4*4 Keypad Module
- Breadboard
- 10k Potentiometer
Circuit:

According to the diagram, make all the connections.
For Keypad:
- R1 = 2
- R2 = 3
- R3 = 4
- R4 = 5
- C1 = 6
- C2 = 7
- C3 = 8
- C4 = 9
For LCD:
- First connect LCD on breadboard.
- Now connect pins RW, LED cathode and Vss or GND to the GND rail of breadboard.
- Connect the Vcc to the +ve rail of breadboard. Also connect the LED anode pin (Right next to cathode) to +ve rail through a 220 ohm resistor.
- Connect the contrast pin labeled as V0 to middle terminal of the potentiometer. Connect other two terminals of the pot to +ve and GND.
- Now connect the following pin in order:
- D4 = 13
- D5 = 12
- D6 = 11
- D7 = 10
After connections are made, we can upload the code on to the board…
Coding:
Before you can start coding you have to install a library to us the keypad and LCD.
To download the library, open Arduino IDE and goto:-
- Sketch >> Include Library >> Manage Libraries.
- In the search bar type “Keypad.h” and scroll down to find “Keypad library by Mark Stanley version 3.1.1”
- Also check if LiquidCrystal library is installed. If not, you can find it using same method.
- Install the libraries and restart the IDE.
You can download the code from here: Arduino_Calculator.ino
To use the calculator simply upload the code, The Alphabets are used as follows:-
A = + (Addition)
B = – (Subtraction)
C = * (Multiplication)
D = / (Division)
Symbol * and # are used as ‘Cancel’ and ‘Equals to’ Respectively.
That’s all for this tutorial. Hope you like it.
Get your Arduino Uno starter kit from our store: