Header Ads

4x4 Keypad(calculator keypad) interfacing with microcontroller and Mikro C


In this tutorial I am show you how to interface keypad with PIC16F877A microcontroller. In this project I  am use 4x4 matrix keypad. In this project I am use Mikro C Pro For Pic Compiler for source code editing. Mikro c provide a keypad library working with 4x4 matrix keypad. You can watch this video or read the written tutorial below.







MATRIX KEYPAD

Before I interface the keypad with PIC16F877A microcontroller , frist we need to understand how to working matrix keypad.
Keypad is set of button. It contain digits,symbols&alphabetical letters. It can be (4x4),(4x3) & (3x2). 4x3 it means 3 column and 4 row. Matrix keypads are commonly used in calculator , digital scale, security systems ,electronic device etc. Matrix keypad is array of push switch. Push button switch leg are connected  to columns and rows. 4x4 matrix keypad contain (4*4)=16 push button switch. If we are use 3x4 matrix there are (3*4)=12 push button switch. 4x4 matrix keypad has (4+4)=8 pin connection and 3x4 matrix keypad (3+4)=7 pin connection.



4X4 MATRIX KEYPAD STRUCTURE 





When press the any key than any column & row are connected each other at a time. Than current flowing column to row.


3x4 matrix keypad



CIRCUIT DIAGRAM OF KEYPAD INTERFACING



Keypad Library


The mikroC PRO for PIC provides a library for working with 4x4 keypad. The library routines can also be used with 4x1, 4x2, or 4x3 keypad. For connections explanation see schematic at the bottom of this page.

Library routines

  • Keypad_Init
  • Keypad_Key_Click
  • Keypad_Key_Press


LCD INTERFACING

In this project I am use LM16x02 LCD display. If you don't know how to interface Lcd display with microcontroller than click here for more details.




Mikro C code:





DOWNLOAD

You can download mikro C and protiues file. Click the download button.


download

No comments

Theme images by 5ugarless. Powered by Blogger.