Required Hardware
- Keypad 3×4 Matrix
- PCF8574A
- Breadboard 830
- Jumper Cables M/M
- Resistors 220Ohm
With this library and LCDI2C4Bit you can use one keypad and one lcd (and a lot more devices! like eeproms, etc.) using only two analog pins on arduino.
Wiring Instructions
To wire your PCF8574A to your Arduino, connect the following pins:
- PCF8574 Pin 1 –> GND
- PCF8574 Pin 2 –> GND
- PCF8574 Pin 3 –> GND
- PCF8574 Pin 4 –> Keypad Pin 1
- PCF8574 Pin 5 –> Keypad Pin 2
- PCF8574 Pin 6 –> Keypad Pin 3
- PCF8574 Pin 7 –> Keypad Pin 4
- PCF8574 Pin 8 –> GND
- PCF8574 Pin 9 –> Keypad Pin 5
- PCF8574 Pin 10 –> Keypad Pin 6
- PCF8574 Pin 11 –> Keypad Pin 7
- PCF8574 Pin 12 –> N/C
- PCF8574 Pin 13 –> N/c
- PCF8574 Pin 14 –> SCL (A5)
- PCF8574 Pin 15 –> SDA (A4)
- PCF8574 Pin 16–> +5V
Add a 220Ohm resistor in series with each column to avoid possible shorts between a HIGH and a LOW line when pushing multiple keys at a time.
Recommended Software
- none
thank you for share!
I have a Waveshare PCF8574 IO Expansion Board with an 4×4 keypad on an Arduino board (Uno or Mega).
I downloaded “i2ckeypad” library.
When I run it I get this error:
————————————————————————–
48:26: fatal error: WConstants.h: No such file or directory
#include “WConstants.h”
compilation terminated.
Error compiling.
————————————————————————-
Where do I get “WConstants.h” from, it’s not in the download package?
WConstants is called from i2ckeypad.h
Hallo,
i think that the 220Ohm resitor is not necessary for the PCF because its maximum current is somewhere
in the range of µA and it cannot be damaged. For a connection directly on the IO-Pins of the
Atemga they are necessary.
Is this right ?
regards
Ulrich Klaas
Hello congratulations but i’m not find library i2ckeypad.h. Give me a link for downloading please? Thanks