Introduction: Arduino Calculator - Final Project
For this project, I've made a calculator using the Arduino Uno, an LCD screen, and the 4x4 number pad. Although he used click buttons instead of the number pad, the idea for this project along with help with some of the code comes from this lesson from Aleksandar Tomić:
https://www.allaboutcircuits.com/projects/simple-a...
Here are the items you'll need to complete this project:
- Arduino Uno
- Breadboard
- 16x2 LCD Module
- 4x4 Membrane Keypad
- Jumper Wires
- Potentiometer
Libraries Needed:
- LiquidCrystal
- Keypad
Both of the libraries can be downloaded in the "Manage Libraries" tab of the Arduino IDE.
Step 1: Connecting the LCD to the Arduino
Here is where we'll connect the LCD to the Arduino. First, connect the LCD to the Breadboard and then connect the pins in the following order:
- Ground
- Power
- Pin 13
- Pin 12
- Pin 11
- Pin 10
- Empty
- Empty
- Empty
- Empty
- Pin 9
- Ground
- Pin 8
- Potentiometer (Connect to Ground and Power)
- Power
- Ground
Finally, connect the Ground Rail on the Breadboard to the GND port on the Arduino. Also, connect the Power Rail on the Breadboard to the 5V port on the Arduino.
Attachments
Step 2: Connecting the Keypad to the Arduino
Now we'll connect the 4x4 Keypad to the Arduino. The Membranous 4x4 Keypad that I used isn't offered in the Fritzing diagram, so I improvised with this 4x4 button pad as a placeholder. The number pad that I used only has 8 ports and I tried to make it as clear as possible for this diagram.
For this step, connect the four pins on the left to ports 2, 3, 4, and 5 on the Arduino.
Now connect the other four pins on the right side of the number pad to ports A5, A4, A3, and A2 on the Arduino.
Attachments
Step 3: Connecting All of the Components
By this time, you should have a fully functional Arduino based calculator. Now just use the code below to get it working!
Attachments
Step 4: Number Pad Diagram
This is how I formatted the number pad with the Arduino.