Hello all,
I want to connect 4x4 keypad to nodemcu board. I used I2C module to connect LCD to nodemcu, and have an extra I2C module with me.
Would it be possible to connect keypad with LCD I2C module? (Since the I2C module is 16-pin module and keypad has 8 pins)
I wasn't able to find anything on the internet, so asking here.
If not, please suggest alternatives. I read that a gpio extender would be required to connect keypad to nodemcu. And this was the gpio extender available at a local store near me.
I am new to electronics. Apologies if this sounds dumb/in-appropriate.
NodeMCU - Use I2C module to connect 4x4 keypad?
Re: NodeMCU - Use I2C module to connect 4x4 keypad?
Not sure what you mean by "I2C module". Can you elaborate?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: NodeMCU - Use I2C module to connect 4x4 keypad?
If the keypad is just an array of pushbuttons the answer is no. I2C can only be used to connect devices which have an I2C interface.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: NodeMCU - Use I2C module to connect 4x4 keypad?
I think you mean you have a gpio expander like an MCP23017. It should be straightforward to multiplex a 4x4 button array using such a module using either built-in pull up resistors or wired resistors. I put together https://github.com/ShrimpingIt/micropython-mcp230xx for my own experimentation with the gpio module but you also need to know how to multiplex the buttons, so this link might be useful...
http://www.microchip.com/wwwAppNotes/Ap ... e=en529784
http://www.microchip.com/wwwAppNotes/Ap ... e=en529784
Re: NodeMCU - Use I2C module to connect 4x4 keypad?
Sorry for such late response
This is the I2C module I have for LCD: https://potentiallabs.com/cart/image/ca ... 00x800.jpg
It's a 4x4 keypad. I was able to find some tutorials for interfacing 4x4 keypad with 8-bit gpio module.pythoncoder wrote: ↑Mon Mar 26, 2018 6:52 amIf the keypad is just an array of pushbuttons the answer is no. I2C can only be used to connect devices which have an I2C interface.
I have the complete module. It has PCF8574A chip.cefn wrote: ↑Mon Mar 26, 2018 8:58 amI think you mean you have a gpio expander like an MCP23017. It should be straightforward to multiplex a 4x4 button array using such a module using either built-in pull up resistors or wired resistors. I put together https://github.com/ShrimpingIt/micropython-mcp230xx for my own experimentation with the gpio module but you also need to know how to multiplex the buttons, so this link might be useful...
http://www.microchip.com/wwwAppNotes/Ap ... e=en529784
Re: NodeMCU - Use I2C module to connect 4x4 keypad?
If you take the time to read the datasheet for that chip (available at http://www.ti.com/lit/ds/symlink/pcf8574a.pdf), you will realize that you can use it both as input and as output — which means that yes, you can read values from your keyboard with it. The datasheet further explains all the commands that you need to send to do the writing and reading, and if you couple that with any tutorial on button matrices, you should be able to write your program.