Membrane Keypad Problems

MoonGoon

Member
Im having a problem using my membrane keypad.
This thread only about the keypad, the code to use it has checked out good.

I have this keypad:
http://newzealand.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=0130381

While running my program, it appears that this keypad is giving false readings. eg. saying their are buttons pressed when Non are pressed, and constantly changing without user input. When i jiggle the keypad around the numbers its outputing changes rapidly. When i put my finger around the loom, it changes rapidly. Im thinking there is a capacitance / inductance problem between the loom wires.

Im putting approx 15mA @ 4.5V onto the lines.
And the lines not being used are grounded via a 10K resistor.
The resistance on each line is 30 Ohms when a key is pressed.

I have taken the keypad off, and used wires across the appropriate pins and the code gives the correct readings onto my display that it should. But when the keypad is connected, false readings occur.

Im using a 28X1, and im using the digital inputs of portA to read IN.

Has anyone come across this problem before?
Does have a theory on why this might be happening?
Does anyone have a possible solution on this?


If you need more info, please ask.
 

MoonGoon

Member
Also, i used the ADC inuts and Debug to see what the chip was reading.
The values where constantly changing, between 0 and 50, when no key pressed.

Also, the chip was reading multiple Highs on the pins when only one key was pressed. The keypad, when disconnected, metered out ok. All lines where 30 Ohms, when key pressed, and Open when not pressed.

The problem seems to only be when voltage is running through it.

Please any ideas.
 

tarzan

Senior Member
Keypad

Has anyone come across this problem before?
Does have a theory on why this might be happening?
Does anyone have a possible solution on this?

Probability is high
Porta pins not grounded
Ground porta pins with 10K resistor and while you’re at it put diodes on the outputs to protect against shorts when more than one button is pushed at the same time. If you want to go the full hog add current limiting resistors also.
 
Last edited:

MoonGoon

Member
Your absolutely right. :eek:

Immediately after writing this thread and , naturally, blaming the equipment. i went back and realised that, after watching the display for 10 seconds with the keypad disconnected, that the display flashed a number or two. resulting in me clearly having a wiring problem.

While i had grounded my pins with a 10K R.
I had grounded the Outputs instead of the Inputs. :eek:
Resulting in a short to ground via my 10K. Luckily no harm done.
But a rather Red face believe me.

Opps.

Sorry for wasting the readers time.

Thanks for reading anyway :eek:
 

Dippy

Moderator
Like Tarzan says, input pins should be tied down via resistors. If they float then you'll get all sorts of funnies. A nice SIL res network keeps things tidy.

Remember, when strobing a keypad, that even if you do an output LOW the actual keyswitch is open-circuit. Without a pulldown res on the input pins it'll float around like a leaf in the wind... nothing wrong with the switches.

I haven't seen your circuit or code, so this is merely a suggestion and also explains why your ADC is going up and down like a ... "Fiddler's elbow'".

15mA into the lines??!?!
 

westaust55

Moderator
Keypad problems - where to put resistors

See the attached sketch for using a matrix configures keypad.
This shows how to connect anti-shorting resistors and pulldown resistors.

The pulldown resistors could be 10k Ohm as others have suggested.

You say that your program code is working okay.
I trust that you have some form of de-bounce included in the input routine.
 

Attachments

Dippy

Moderator
Yes, remember the old saying 'look before you leap', well always 'check (10 times) before you post'. I wish I would that :)

It saves looking silly and also, if done too frequently, then the next time you ask people will just say "oh, oh, he can't be bothered to check his wiring.....".
 

D n T

Senior Member
Moments of clarity often come just after you press the submit button

I know that when I'm in full flow and totally involved in what I'm doing and its usually the wrong side of midnight, I have made more than my share of cries for help on here and thanks to every one on here, I get helpful advise. Sometimes it is hard to get out of the box and look at what you are doing objectively etc.
But I know that when I post and get an answer, to a problem, I learn and I usually don't do it again... I've even been known to repeat the advice I've been given, to others down the track a bit.
So don't stress, learn from it, I mean if no one posted when they had a problem, would the forum exist, and how many people have not posted but read another persons post and learned from it.

Post problems and pass on solutions, beware the magic smoke.
 
Top