• Home
  • Electrical
    • Power Electronics
  • Electronics
    • General Electronics
  • Embedded Systems
    • Arduino
    • ARM Cortex
    • Raspberry Pi
  • Robotics
  • Android
  • Others
    • Communications
    • Solar
    • Sensor based
  • Buy projects

Buy Electronics & Electrical Projects in India

Buy Electronic Kits & Electrical Projects in New Delhi, Hyderabad, Mumbai, Bangalore, Pune, Chennai, Ahmedabad and the rest of India.

  • New Delhi
  • Ahmedabad
  • Banglore
  • Chennai
  • Hyderabad
  • Mumbai
  • Pune

4×3 Matrix Keypad Interfacing with 8051 Microcontroller

September 2, 2014 by Tarun Agarwal 11 Comments

Matrix Keypad

Matrix Keypad

Most of the applications of embedded systems require keypads to take the user inputs, especially in case where an application requires more number of keys. With simple architecture and easy interfacing procedure, matrix keypads are replacing normal push-buttons by offering more inputs to the user with the lesser I/O pins. As a Human Machine Interface (HMI) keypad plays a major role in vital microprocessor and microcontroller based projects and equipments. Therefore, this article gives you a brief idea on matrix keypad interfacing with 8051 microcontroller.

Introduction to Matrix Keypad

A Matrix keypad is the most commonly used input device in many of the application areas like digital circuits, telephone communications, calculators, ATMs, and so on. A matrix keypad consists of a set of push button or switches which are arranged in a matrix format of rows and columns. These keypads are available in configurations like 3×4 and 4×4 based on the application it is implemented for. Internal diagram of this matrix keypad is shown in the below figure.

Keypad Internal Diagram

Keypad Internal Diagram

Matrix Keypad Interfacing with 8051 Microcontroller

Matrix keypad can be connected to the microcontroller in numerous ways or techniques, but the fundamental logic is same as making the columns as input and the rows as output. So, in order to detect the key pressed from the keypad, the row lines have to be made low one by one and to read the columns. So let us discuss in brief about 8051 microcontroller interfacing with this matrix keypad.

Circuit Diagram:

Circuit Diagram of Keypad Interfacing with 8051 Microcontroller

Circuit Diagram of Keypad Interfacing with 8051 Microcontroller

Circuit Connections:

  • In this project a 4×3 matrix keypad is interfaced to the microcontroller, which is a 12-key keypad consisting of four rows and three columns.
  • The upper pins of port 1,  i.e., pin 1.0 to pin 1.3 of the microcontroller are connected to the row lines of the keypad and lower pins (pin 1.4 to pin 1.6) are connected to the column lines. These are connected in such a way that the column lines acts as input to the microcontroller , and the row line as output lines. The input lines are pulled up internally.
  • Here 16×2 LCD is connected to the port 0 and port 2 pins. As the port 0 has no internal pull up, it is pulled up externally using a set of resistors which are connected to 8-data lines of the LCD. And control lines of the LCD are connected to the Port 2 pins.
  • As the given circuit is simulated, one RESET and crystal oscillator circuits are not necessarily be connected. But for hardware implementation these must be provided.

Circuit Working

  • Make sure that the all the rows of port 1 high in order to give the signal to microcontroller when any key is pressed.
  • The working of the keypad goes like this: If any of the keys in row1 of the matrix keypad is pressed, the corresponding column line will give low and similarly if the second key is pressed in row1, then the column line 2 will give low. This process is repeated for all the rows.
  • When the circuit is powered and any key is pressed, then corresponding pins of the port 1 get enabled. Depending on the program in the microcontroller, it displays the number on the 16×2 LCD. But this cannot display any number when two keys are pressed at the same time. The program code of the above given interfacing circuit is given below.
Program Code of Keypad Interfacing with 8051 Microcontroller

Program Code of Keypad Interfacing with 8051 Microcontroller

Applications of the Interfacing Keypad with 8051

Keypad Interfacing to Password Based Load Control

This system switches the loads based on the password entered from the keypad. This is of security based load control system and is one of the concept of industrial automation systems. The figure shows the matrix keypad interfacing with the  8051microcontroller for entering password in order to have switching operation of loads. (Here a set of lights indicates the electrical loads or appliances).

Keypad Interfacing to Password Based Load Control

Keypad Interfacing to Password Based Load Control

The 8051 microcontroller acts as a central controller, which accepts the inputs from the matrix keypad and correspondingly control the loads. Here the control circuit is powered with regulated DC power supply and loads are with AC mains supply. A relay driver is interfaced to the microcontroller for switching the relays corresponding to the loads. This 8051 microcontroller and its programming is done in such a way that the password entered from the keypad is compared with the pre-stored password in the ROM of the microcontroller. If the password matches, then the control signals are sent to the relay driver to switch the load. The information of the password authentication and load switching is also displayed on the LCD.

Keypad Interfacing to Programmable Medication Reminder

This project reminds people to take their medicines on time, which is engaged by a doctor. This system is very helpful for the elderly persons and people who are busy and forget taking medicines on time. In this system,  the keypad interfacing with 8051 microcontroller allows the user to set the timings for each and every medicine as shown in the figure.

Keypad Interfacing to Programmable Medication Reminder

Keypad Interfacing to Programmable Medication Reminder

A Real Time Clock (RTC) is connected to the microcontroller to have a real time timing operation so that it give an alarm at set timings. A 4×3 matrix keypad is interfaced to the microcontroller for entering the timings prescribed by the doctors. LCD and buzzers are connected to microcontroller as output devices for generating display and alarm indications, respectively. Batteries are connected to power the entire circuit making this as portable so that the user can take it to every place easily.

The 8051 Microcontroller is programmed in such that it continuously scans the set timings with real-time clock, when both matches it generates an alarm by giving control signals to the buzzer and correspondingly displays the medicine information on the LCD display.

This is about the keypad interfacing with 8051 microcontroller circuit, operation, program code and applications. Hope that the reader has got the basic idea of this peripheral interfacing technique with the given examples.  For any further help regarding this topic or any other interfacing circuits, you can write to us by commenting below.

Filed Under: Embedded Systems

About Tarun Agarwal

Tarun Agarwal is the Chief Customer Support Officer at Edgefx Technologies Pvt Ltd. He has 8 years of experience in Customer Support, Operations and Administration.

Comments

  1. prudhvi raj says

    November 29, 2014 at 5:08 pm

    Can i buy it ?? How much does it costs??
    Helpful for my mini project

    Reply
    • Tarun Agarwal says

      December 2, 2014 at 10:04 am

      Hi Prudhvi Raj,

      Click the links below for details:
      http://www.edgefxkits.com/password-based-circuit-breaker
      http://www.edgefxkits.com/programmable-load-shedding-time-management-for-utility-department
      http://www.edgefxkits.com/automatic-bell-system-for-institutions
      http://www.edgefxkits.com/precise-illumination-control-of-lamp
      Please check the user friendly website http://www.edgefxkits.com for complete details in the kit content section and go through the FAQ for details.

      Raji (Mobile: +91 9959178000)

      Reply
  2. praveen kumar says

    March 25, 2015 at 6:36 pm

    give me the code please…either embedded c code or assembly language code

    Reply
    • Tarun Agarwal says

      March 27, 2015 at 4:45 pm

      Hi Praveen, Click the links below for help:
      http://www.edgefxkits.com/password-based-circuit-breaker
      http://www.edgefxkits.com/patient-medication-reminder
      http://www.edgefxkits.com/automatic-dialing-to-any-telephone-using-i2c-protocol-on-detecting-burglary
      http://www.edgefxkits.com/life-cycle-testing-of-electrical-loads-by-down-counter
      Please check the user friendly website http://www.edgefxkits.com for complete details in the kit content section: http://www.edgefxkits.com/kitdetails/ and go through the FAQ: http://www.edgefxkits.com/contact-us/#faq for details.Further if you have any queries you can call us on the toll free no. 1800 108 7475 for clarifications/personal counseling. Raji (Mobile: +91 9959178000)

      Reply
  3. nicanor arabit says

    June 28, 2016 at 9:51 am

    im here in the philippines where can a buy materials for this project i interested coz im planning to run small business…..thanks

    Reply
    • Tarun Agarwal says

      June 29, 2016 at 3:22 pm

      i Nicanor Arabit
      We are very sorry to inform you that we can’t provide the material of the projects
      And once again please visit our website http://www.edgefxkits.com/

      For more details please contact our customer support on +91 9959178000

      Reply
  4. Supriya Rajendra Tambe says

    July 21, 2016 at 4:44 pm

    what is the total prize of this kit

    Reply
    • Tarun Agarwal says

      July 25, 2016 at 3:05 pm

      Hi Supriya Rajendra Tambe
      Please mention the project name so that our technical team can guide you
      And once again please visit our web site http://www.edgefxkits.com/

      For more details please contact our customer support on +91 9959178000

      Reply
    • Tarun Agarwal says

      July 25, 2016 at 3:06 pm

      sir
      give a coding of this led display notic board in classroom

      Hi Supriya Rajendra Tambe
      Regrat
      We are very sorry to inform you that once you purchase the project we can provide the coding, simulation, documentation, and with audio & video visuals
      And once again please visit our web site http://www.edgefxkits.com/

      For more details please contact our customer support on +91 9959178000

      Reply
  5. viswa says

    August 23, 2016 at 9:33 pm

    how can make use of keypad to control two loads in circuit breaker?
    what is the code program?

    Reply
    • Tarun Agarwal says

      October 1, 2016 at 5:14 pm

      Hi Viswa
      As per your requirement we suggest you to follow the below link
      http://www.edgefxkits.com/dtmf-based-load-control-system
      we are very sorry to inform you that once you purchase the project we can provide the source code, documentation

      For furthermore details please contact to sathish on +91 8885507011 or you can email us on info@edgefxkits.in

      Reply

Leave a Reply to Tarun Agarwal Cancel reply

Your email address will not be published. Required fields are marked *

Search Here!

Join our Loyal Fan Base!




Recent Posts

  • Reputable Online Pharmacy Glyburide and Metformin
  • Stromectol Australia
  • Best Online Pharmacy. Flomax Pill Cost. Save Time And Costs
  • Neurontin Cheapest Price
  • Tadalis Brand For Sale

Download Ebook Worth 99$





Subscribe to our Youtube Channel

Like us on Facebook

Copyright © 2022 · Magazine Pro Theme on Genesis Framework · WordPress · Log in