Arduino Forum

Using Arduino => General Electronics => Topic started by: bobrosco on Aug 12, 2015, 07:22 pm

Title: membrane 1x4 keypad
Post by: bobrosco on Aug 12, 2015, 07:22 pm
I just want to check something because for some reason it wont work like i think it should.
I have this  keypad (https://www.adafruit.com/images/970x728/1332-04.jpg)
It has 5 connections. And if im right 1 should be 5v from the arduino and all the others should be outputting 5v when pressed. And according to the tutorials i have read you should connect it to ground trough a resistor and to the arduino. And thats exactly what i did, but for some reason i dont get any response in my arduino.

So the question is did i hook it up right like that? Or is there a different way to use these?
Title: Re: membrane 1x4 keypad
Post by: groundFungus on Aug 12, 2015, 07:40 pm
I would connect the common to ground and each digit to a digital input with the internal pull ups enabled.  The key that is pushed will go LOW.   Unpushed keys will read HIGH.  This is the most common and accepted way to wire switches.
Title: Re: membrane 1x4 keypad
Post by: DrAzzy on Aug 12, 2015, 08:25 pm
I would connect the common to ground and each digit to a digital input with the internal pull ups enabled.  The key that is pushed will go LOW.   Unpushed keys will read HIGH.  This is the most common and accepted way to wire switches.
Yup - this is absolutely the way to go.

Without seeing how you actually wired it, I can't tell where you went wrong. My guess is you did the external pulldowns wrong - but if you wire it as advised above, you don't need to use external resistors.
Title: Re: membrane 1x4 keypad
Post by: bobrosco on Aug 12, 2015, 10:02 pm
thank you. I got that working now.
Title: Re: membrane 1x4 keypad
Post by: JoeN on Aug 13, 2015, 02:23 am
When working with any circuit like this, use the continuity tester feature on your multimeter and make sure you know the common and what is going on.  Pick pairs of wires and start pressing buttons.  I like buzzing out unknown combinations like that.  You can do the reverse with LED matrices by providing current and ground, one of them through a 470 ohm resistor or so, and simply testing out the combinations.  You don't need no stinkin' datasheet for these types of devices, it's a very easy puzzle to solve.
Title: Re: membrane 1x4 keypad
Post by: Paul__B on Aug 13, 2015, 02:40 am
When working with any circuit like this, use the continuity tester feature on your multimeter and make sure you know the common and what is going on.
Mind you if you take a look at the picture ("View Image"), it is immediately obvious which is the common in this case.
Title: Re: membrane 1x4 keypad
Post by: JoeN on Aug 13, 2015, 03:08 am
Mind you if you take a look at the picture ("View Image"), it is immediately obvious which is the common in this case.
Good point.  And yet I still believe I correctly inferred the original poster (a "newbie") could use some general advice in addition to the specific advice given.