You are on page 1of 13

Department of Electrical and Electronic Engineering

Course Title: Micro-Processor Laboratory

P R O J E C T N A M E : S I M P L E C A L C U L AT O R I N L C D C A PA B L E O F P E R F O R M I N G
S I M P L E C A L C U L AT I O N S
1)Project Title:Simple Calculator in LCD capable of performing simple calculations
2)Objectives :
1. Showing logical operations.
2. Performing simple mathematical operations.

APPARATUS
COMPONENTS
● Microcontroller - ATMEGA32
● Keypad - KEYPAD SMALLCALC
● 16x2 LCD Display- LM016L

SOFTWARE
● CodeVisionAVR
● Proteus 8 professional
● 3)Specifications and Requirement list:
● Input to the calculator is taken through the “small calc” keypad
● After each data is entered, it is displayed in the 16x2 LM016L LCD display
● Shows the result after “=” is pressed
● Only after 2 operands and 1 operator is entered, the calculator will show the result. That is if “=” is
pressed after entering only one operand and or after entering the one operand and one operator, it will
not show any result.
● Capable of doing logical operation such as 24/0
● Can perform simple mathematical operations which are addition, subtraction, multiplication and
division.
● Result is displayed upto 5 decimal places.
● It can continue the calculation after the result is shown, that is it can perform operations with the
result also.
● If the key “CLEAR” pressed, it will reset the calculator and the user can enter another expression
4) Methodology
~We connected the keypad to PORT B and the LCD display to PORT A of the ATmega32 microcontroller
~The row are connected to upper 4 pins of PORT B and the columns are connected to lower 4 pins of the same
port

● We then confirmed the key pressed by sending ‘0’ to each column of the keypad and correspondingly
checking the row value for each row and if we get (0,0) for column and row, we know which key has been
pressed
● The Vss pin of the LCD is connected to ground and Vdd and Vee connected to +5V power supply. RS, RW,
E connected to the first 3 pins of PORT A and the last 4 data pins are connected to the last 4 pins of PORT
A.
● Then the data is stored as the input and displayed in the LCD
● Similarly, the operator and the 2nd operand is entered and stored and only after the “=” is pressed, the result
is shown.
● The C program calculates the result
● The stored result is then printed on the LCD screen
System Flow Diagram:
Circuit Diagram:
EXPLANATION
1. In the void main function, we declared the output pins and printed the
welcome and enter expression message.
2. In the while loop, it will call the data function which will check the key
pressed row by row and column by column using the nested for loop and
then go to the display function.
3. Inside the display function, it will execute cases 0 to 10 (except 3) for if a
number is entered. If case 4 is executed, it will reset everything and start to
read data again.
4. After an operator is entered, case 12 to 15 will be executed and then go on
to store the 2nd number.
5. When 2nd number is entered, again case 0 to 10 (except 3) and then after
‘=’ is pressed, case 11 is executed and the result is calculated which is then
displayed on the LCD display
PROTEUS SIMULATION RESULTS
Logical Operation Result

Mathematical operations
Addition: Result

Subtraction Result
Multiplication Result

Division Result
ALTERNATIVE DESIGN
Alternative Code:
Using calc.h as a direct inbuilt library
Alternative Circuit: Instead of LCD alternatively we can also use multiple 7 segment displays.
APPLICATION
 
As it is a calculator, it has its use in every sector of life like from studying to business
purposes and so on. Besides calculation we can use it as a counter or even as a password
security system too and be used to perform calculations in other complex embedded systems.

IMPACT

The calculator has had a profound impact on the world, making computations quicker and more exact.
In the classroom, calculators have given many students the ability to learn about and put complex
formulas and concepts into practice more easily. It has helped us save a lot of calculation time.
FUTURE DEVELOPMENT

1)While doing operation with three numbers 2+3*5 BODMAS rule will be
followed.

2)We want to add other complex calculations like trigonometric functions,


differentiation, integration and so on

3) Lastly we want to add a voice sensor in our calculator where by giving


voice commands we can operate the operations without even typing the
numbers

You might also like