I am bogged down in this project
I am bogged down in this project
Bill,
I have a document that I produced that shows the connections from a 4 * 4 matrix keypad to the 8574 and the basic code to use it. I do not lay claim to the originally of the code as it is what I pulled together from other peoples work on the web. There are two versions of the 8574, the 'A' version has a different address range. Therefore if you really wanted you could add 8 off 8574's and 8 off 8574A's to give a total of 16 * 8 128 extra I/O on 2 wires from the Arduino!
There are variants of the keypads and there appears to be no standard for the pin outs. However it is not difficult to determine what the connections are with a multimeter. The code can then be easily changed to produce the output you want.
I could probably convert the notes I have to a PDF if you wish and sent it via email. I do not know how to add documents to my replies on this site. Actually I have never tried!
Bob
Bill,
I have a document that I produced that shows the connections from a 4 * 4 matrix keypad to the 8574 and the basic code to use it. I do not lay claim to the originally of the code as it is what I pulled together from other peoples work on the web. There are two versions of the 8574, the 'A' version has a different address range. Therefore if you really wanted you could add 8 off 8574's and 8 off 8574A's to give a total of 16 * 8 128 extra I/O on 2 wires from the Arduino!
There are variants of the keypads and there appears to be no standard for the pin outs. However it is not difficult to determine what the connections are with a multimeter. The code can then be easily changed to produce the output you want.
I could probably convert the notes I have to a PDF if you wish and sent it via email. I do not know how to add documents to my replies on this site. Actually I have never tried!
Bob
Bob;
Could you email me you notes on this project.
Do you have a library for the 8574 and a working example.
Thanks Averil
Try this, full description for using this chip with the keypad
Hi Averil,
Peter has posted some information for you that will help you. However, if you need anything else please send me your email address and I'll forward what I have. I used an Arduino and a LCD display on my project. There are also several modules that can be bought that cover both a matrix keypad and a LCD display functionality on a small PCB. That said the 8574 chip is a very versatile device, fun to learn and be creative with.
Thanks for the info on the i2c keyboard.
The example from instructables is for a PIC controller, Do you have a sketch for Arduino?
If you have further info please send it to me.
Bob
Thanks so much for the info you sent. The code is simple and short.
I'm still having one problem as the code you sent and the i2c library I have will not compile.
I get an error ( i2c_keypad does not name a type.) I don't know what this means.
Iv'e done quite a bit of research and it seems to be related to the version of the IDE one is running.
I am running 1.05 and the i2c_keypad library is for versions before version 1.
Here is the link for the library, http://arduino.cc/playground/Main/I2CPortExpanderAndKeypads
Do you have a more current version? If so could you send it to me or a link to it.
If not any advise as to how to update this library, that is not to complicated, as i am some what of a newbie.
Thanks again
Norm
Norm,
I think you have the wrong library. I have attached a zip of the library I have. I am running Arduino IDE version 1.56r2.
Hopefully you can unzip the file and look at the stuff in there, I am sure it will sort out your problem. The error you are getting means the compiler can’t find the correct library content.
Bob
Keypad_I2C.zip |
Bob:
Once again thank you for helping with this.
I upgraded to 1.5.8 and installed your library and it now complies.
Norm
Norm,
That’s great news, if you need any further help please ask.
Bob
I have run into another problem I though I'd run by you and see if you have any ideas.
When i run the sketch, I don't get any response in the serial monitor.
The hardware is as follows.
I'm using a i2c backpack off a 16 x 2 lCD. This is a 8574 surface mount chip with the i2c and data lines brought out on headers.
I ran a i2c scanner sketch and found the address is 0 x 27 and changed it in the sketch.
There are 4.7k pull up resistors on the SCA and SCL pins.
The i2c communications seem to be working as i get an address when I scanned the devise.
I'm using a 4 x 4 membrane keypad found on ebay.
I've ohmed out the keypad and found pin 1-4 are the rows and 5-8 the columns.
The keypad is wired pin 1 to d0 pin 2 to d1 etc.
The are 10k pull ups on the 4 columns.
Upon uploading the sketch and opening the serial monitor Iv'e pressed all the buttons, but there isn't any response.
Any thoughts on what Iv'e missed?
Norm
Hi Norm,
I assume you have power to the 8574 and you have the library loaded correctly. Have you set up the pin configuration for the library? I have attached a zip file with one of my sketches so you can see how I set mine up with the key array and pin definitions.
I have not got my key pad set up at the moment but as I recall I did not add the pull up resistors, I have a feeling that the library enables the Arduino internal pull ups on the appropriate pins. Thus it is important to correctly define the pins. I think this may be the cause of your problem.
Bob
i2cKeypad1.zip |