Hello Readers, welcome to my Blog - A Blog For Bloggers By A Blogger. I'm Arun, an entrepreneur Blogger from India.

4X4 Keypad Interfacing with ATmega16 and LCD Display

25376
4
Mark as Favourite

Keypads are parts of HMI or Human Machine Interface and play really important role in a small embedded system where human interaction or human input is needed. Matrix keypads are well known for their simple architecture and ease of interfacing.

In this project, we will learn How to interface a 4X4 keypad with AVR ATmega16 microcontroller. Here, we will display the value of the pressed key in a 16X2 alphanumeric LCD. See the below table to know the value assigned to each key of the 4X4 keypad. For to display the value of the pressed key, the microcontroller should know if any key is pressed or not and if pressed then which key is pressed. To know all this, the microcontroller scans each row or column of the 4X4 keypad one by one continuously (scanning is done by the read_keypad function). When any key of 4X4 keypad is pressed, the read_keypad function returns the value of the pressed key and the microcontroller displays it in the 16X2 alphanumeric LCD. When none of the key is pressed the read_keypad function returns 0XFF and the LCD displays the value of the last pressed key. Now, press different keys of the 4×4 keypad and see the output in the 16×2 alphanumeric LCD.

Key Pressed

Key Value

1

1

2

2

3

3

4

4

5

5

6

6

7

7

8

8

9

9

0

0

*

*

#

#

A

A

B

B

C

C

D

D

 

Softwares Required

Hardwares Required

Name / Unit Price Quantity Total Price
AVR Trainer Board-100 with ATmega16
Rs. 700.00
1pc
Rs.700.00
AVR USB Programmer
Rs. 350.00
1pc
Rs.350.00
12V, 1A DC SMPS Adaptor
Rs. 130.00
1pc
Rs.130.00
RG1602A 16X2 Alphanumeric LCD Green
Rs. 150.00
1pc
Rs.150.00
4X4 Keypad
Rs. 120.00
1pc
Rs.120.00
1 to 1 Connector-Female to Female
Rs. 4.00
3pc
Rs.12.00
10 to 10 FRC Female to Female Connector
Rs. 15.00
3pc
Rs.45.00
TOTAL Rs.1507.00

Circuit Diagram

4x4-Keypad-Interfacing-with-AVR-ATmega16-Microcontroller-and-LCD-Display-Circuit-Diagram-ABLab-Solutions-1024x606

Video

Connection Guide

The step-by-step connection guide for 4X4 Keypad Interfacing with ATmega16 and LCD Display is as follows:

  • Insert the DC Pin of 12V, 1A DC Adapter to the DC Socket of AVR Trainer Board-100.

    Steps - 1 ( 0f 9 )

  • Connect PortB header with LCD data header in AVR Trainer Board-100 with a 10 to 10 FRC Female Connector.

    Steps - 2 ( 0f 9 )

  • Connect RS, RW & EN pins of LCD control header with PD0, PD1 & PD2 pins of PortD header respectively in AVR Trainer Board-100 with 1 to 1 Connectors.

    Steps - 3 ( 0f 9 )

  • Connect the 16X2 Alphanumeric LCD to the LCD header of AVR Trainer Board-100.

    Steps - 4 ( 0f 9 )

  • Connect the 4X4 Keypad header of 4X4 Keypad with PortC header of AVR Trainer Board-100 with a 10 to 10 FRC Female Connector.

    Steps - 5 ( 0f 9 )

  • Connect the ISP header of AVR Trainer Board-100 with AVR USB Programmer header of AVR USB Programmer with a 10 to 10 FRC Female Connector.

    Steps - 6 ( 0f 9 )

  • Connect the AVR USB Programmer to the PC/Laptop's USB Port directly or with the help of USB AM-FM Cable.

    Steps - 7 ( 0f 9 )

  • Switch on the power with the help of Power Switch of AVR Trainer Board-100.

    Steps - 8 ( 0f 9 )

  • Download the 4X4 Keypad Interfacing with ATmega16 and LCD Display Hex file to AVR Trainer Board-100 with the help of SinaProg Hex downloader and AVR USB Programmer.

    Steps - 9 ( 0f 9 )

  • Insert the DC Pin of 12V, 1A DC Adapter to the DC Socket of AVR Trainer Board-100.

    Steps - 1 ( 0f 9 )

  • Connect PortB header with LCD data header in AVR Trainer Board-100 with a 10 to 10 FRC Female Connector.

    Steps - 2 ( 0f 9 )

  • Connect RS, RW & EN pins of LCD control header with PD0, PD1 & PD2 pins of PortD header respectively in AVR Trainer Board-100 with 1 to 1 Connectors.

    Steps - 3 ( 0f 9 )

  • Connect the 16X2 Alphanumeric LCD to the LCD header of AVR Trainer Board-100.

    Steps - 4 ( 0f 9 )

  • Connect the 4X4 Keypad header of 4X4 Keypad with PortC header of AVR Trainer Board-100 with a 10 to 10 FRC Female Connector.

    Steps - 5 ( 0f 9 )

  • Connect the ISP header of AVR Trainer Board-100 with AVR USB Programmer header of AVR USB Programmer with a 10 to 10 FRC Female Connector.

    Steps - 6 ( 0f 9 )

  • Connect the AVR USB Programmer to the PC/Laptop's USB Port directly or with the help of USB AM-FM Cable.

    Steps - 7 ( 0f 9 )

  • Switch on the power with the help of Power Switch of AVR Trainer Board-100.

    Steps - 8 ( 0f 9 )

  • Download the 4X4 Keypad Interfacing with ATmega16 and LCD Display Hex file to AVR Trainer Board-100 with the help of SinaProg Hex downloader and AVR USB Programmer.

    Steps - 9 ( 0f 9 )

Downloads

4x4 Keypad Interfacing with ATmega16 and LCD Display
  • 46 downloads 302 Kb

Post a Comment

    • amit
      wonder full
      2017-02-09 07:08:14
      Reply
    • amit
      wonder full
      2017-02-09 07:08:16
      Reply
    • Abdullah Allababidy
      2017-02-23 00:10:56
      Reply
    • Mijee
      How does this work? No understand
      2017-03-29 15:13:59
      Reply