-->
Page 1 of 2

4x4 matrix keypad and ESP8266

PostPosted: Sun Jun 26, 2016 12:28 pm
by lotus49
I want to use 4x4 matrix keypad with my ESP8266. I have done this successfully in the past on an Arduino Uno using a resistor array and connecting the output to an ADC.

I am considering doing this with the ESP8266 (which is why I just posted another question about the ESP8266 ADC) but I would like to know whether there are better options.

I cannot just connect the 8 outputs to GPIO pins because I don't have enough free GPIOs. I understand that I could buy an I2C interface. Are there any other options worth considering?

Naturally I would rather keep it simple and not use more active components unless I have to but if that is the best approach, I shall go down that route.

Re: 4x4 matrix keypad and ESP8266

PostPosted: Sun Jun 26, 2016 12:44 pm
by martinayotte
Personally, I would go with an I2C expander.
But your ADC idea is also a good solution.

Re: 4x4 matrix keypad and ESP8266

PostPosted: Fri Jul 01, 2016 9:40 am
by lalo_uy
There is a Keypad library for Arduino that use GPIO o t I2C io.
I'm considering update it for ESP .
Looking at the source code th COL lins ar only used as outputs.
I will try tu use a simple shift register to get more io lines like CD4094
With 2+N GPIO you get a 8xN keypad.

Lalo

Re: 4x4 matrix keypad and ESP8266

PostPosted: Fri Jul 01, 2016 4:36 pm
by lotus49
That would be useful.

For some reason, the setup that worked perfectly well on my Arduino Uno using a resistor matrix didn't work well with my ESP8266 (a small number of the keys, specifically 7, * and 0 , were very unstable producing widely differing values each time they were pressed) so I have ordered an I2C GPIO expander. I supposed a shift register could be made to work but it seems like a bit of a faff.