Introduction: Modern and New and Easier Example of Locker With Arduino Matrix Keypad 4x4


Another example of using a LCD keypad matrix 4x4 with an I2C circuit.

Step 1: The Schematic

This matrix keypad is made of 16 push buttons and with I2c communication, you just need 2 pins to manage it: SDA (A4 on arduino board) and SCL (A5 on arduino board).

I used a PCF8574A 16 DIP I/O I2c circuit the small schematic is given above. The address of this kind of components is 0x3C in my example (A0=0, A1=0, A2=1).

Step 2: The State Diagram: an Easier Method

This new method is based on timers which allow you to compose the good code (made of 4 characters: CODE1 then CODE2 then CODE3 then CODE4) on the keys in the right time.

The arduino sketch includes 4 special libraries:

  • SM.h
  • Wire.h
  • Keypad_I2C.h
  • Keypad.h

I give a pack of them and the sketch. If the typed code is good, the pin 13 light ON and you need to push the key ' * ' to initialize. If the code is wrong, the pin 13 flashes.

note: I can't download today the libraries due to an internal server error. Sorry.


Step 3: Conclusion

The keys pushed must be detected on a rising edge, unless, it will not run properly.

All these components are very cheap and you will have a very catchy keyboard with few pins on the Arduino boards.

Thanx to all insteresting tutorial I found.

Happy instructable!