This project involves building a simple calculator using an Arduino, a 4x4 matrix keypad, and a 16x2 LCD. The calculator performs basic arithmetic operations like addition, subtraction, multiplication, and division. The input is taken from the keypad, and results are displayed on the LCD screen.
-
Arduino UNO: The microcontroller used to control the components.
-
16x2 LCD Display: Displays input numbers, operators, and results.
-
4x4 Matrix Keypad: Allows user input for numbers and operations.
-
Wires: For connecting components.
-
Circuit Diagram
The calculator circuit was designed using Tinkercad. Refer to the diagram below:
LCD Pins:
- RS, RW, ENA, DB0-DB7 → Arduino Digital Pins.
- VCC, GND → Power and Ground.
Keypad Pins:
- Rows connected to Arduino Pins 8-11.
- Columns connected to Pins 12, 13, A0, A1.
-
Basic Arithmetic: Supports addition (+), subtraction (-), multiplication (*), and division (/).
-
Error Handling: Displays an error when attempting division by zero.
-
Reset Function: Pressing C clears the display and resets the calculator.
- The user inputs numbers and operations using the keypad.
- The input is displayed on the 16x2 LCD.
- Upon pressing the # key, the result of the operation is displayed.
- For square root calculations, pressing the dedicated button reads the first number and displays its square root