Interface 4×4 Keypad With Raspberry Pi

Let's try keypad on Raspberry Pi!

Introduction

If you’re developing project that require control panel, keypad can be one of the important component. So, in this tutorial, I will share on how to interface keypad with Raspberry Pi.

Video

This video will show you how to interface 4×4 keypad with Raspberry Pi and create a simple password application.

Hardware Preparation

This is the list of items used in the video

Wiring connection table.

Raspberry Pi/Maker pHATKeypad 4×4I2C LCD
GNDGND
5VVCC
SDASDA
SCLSCL
GPIO171 (most left)
GPIO182
GPIO273
GPIO224
GPIO255
GPIO126
GPIO137
GPIO198 (most right)

Sample Program

This is sample program to interface keypad with Raspberry Pi. It has 2 files, (1) Main file and (2) Library for I2C LCD.

Thank You

References:

  1. Raspberry Pi gpiozero library
  2. How to Display on I2C LCD Using Raspberry Pi

Thanks for reading this tutorial. If you have any technical inquiry, please post at Cytron Technical Forum.

2 thoughts on “Interface 4×4 Keypad With Raspberry Pi”

  1. Scott Osborne

    I’m having the same issue. I get a repeating number sequence. Totally random. Happens even without the keypad plugged in. I also tried several keypads so I believe this is an issue with coding

  2. hello i tried following this tutorial but it did not work for me.
    my lcd only displaying squires, and the keypad sims not to respond i have check the wiring over and over but nothing changed. wen i run the code its runs but i keep seeing some numbers.

    some thing like this

    pi@raspberrypi:~/keypad $ sudo python keypadlcdlock.py
    13
    0
    3
    9
    15
    10
    3
    3
    9
    7
    0
    9
    15
    6
    10
    11
    10
    14
    7
    2
    14
    1
    9
    13
    10
    14
    4
    10
    11
    14

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

Program PikaBot Using mBlock
Monitor Temperature Humidity Using IoT Telegram Bot on ESP32
Control PikaBot Using a Phone Through Bluetooth
Display Heart Rate Data on IoT Blynk Using Arduino
DS18B20 Waterproof Temperature Sensor with Maker UNO
Scroll to Top