Instructables
This instructable explains how to interface with a 4x4 keypad over an I2C bus.

I started this project because I wanted some plug and play input and output modules for easy and fast prototyping of my electronics projects (mostly with PIC microcontrollers). Of course you can use leds and dip switches but they require lots of pins on your microcontroller and you only have binary I/O.

To solve this problem I decided to use I2C.
I2C is a 2 wire bidirectional bus to which addressable devices can be connected.
I had some I2C remote I/O expander chips laying around that I could use for this purpose.
You give them an address and then you can read or write to their 8 I/O pins.
I also recovered a 4x4 keypad from a broken telephone to be used as input device.
And I connected a 7 segment display to the I2C bus as an output device.

In a next iteration of the project I'll move the components to PCB.

PCF8574.PDF(595x842) 132 KB
 
Remove these adsRemove these ads by Signing Up

Step 1: Components

Picture of components
Required components:

-1x PCF8574  I2C chip (remote 8-bit I/O expander for I2C-bus)
-1x 4x4 Keypad
-2x 2,2 kOhm pull-up resistors
-1x PIC18F4550 (or other programmable I2C master device)

Optional components (depends on output):

-1x PCF8574  I2C chip
-1x 7 segment display
-7x 330 Ohm resistor
-1x serial to usb dongle

bk-paradox1 year ago
Where did you get the keypad library for eagle?
exactly what im after
For anyone looking for the part.
http://www.esawdust.com/blog/eagle/partsearch.html
I used this to search for keypad and it pointed me to get keypad4x4_ece.lbr
Eagle search is not intuitive :p
Cheers
Synck (author)  bk-paradox1 year ago
It's not in the default library? Maybe the Sparkfun library.
hasanhadi1 year ago
please cannot download the project
please i needed this project
hasanhadi1 year ago
Very nice and usefull project.
Thanks
tinker2343 years ago
wow nice looks good
Ender20073 years ago
Very nice and usefull project.
Thanks.
hobbyman3 years ago
Hello, nice project. Thanks for sharing,
I just wondered why you didn't use the hardware I2C port of pic 18f4550?
Synck (author)  hobbyman3 years ago
I did use the hardware I2C port.
RB0 is the data line and RB1 is the clock line as stated in the datasheet page 14.
janw3 years ago
Very nice instructable! Where did you get that 4*4-keypad?
djmachet janw3 years ago
um it says in the initial blurb that he got the keypad from an old phone
janw djmachet3 years ago
Oooooooooooops, didn't see that.