Pages: [1]   Go Down
Author Topic: Does keypad library require diodes?  (Read 826 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does the keypad library (http://playground.arduino.cc//Code/Keypad) require diodes on the switches?
Quote
You won't need external resistors or diodes because the library uses the internal pullup resistors and additonally ensures that all unused column pins are high-impedance.
I see why I wont need external resistors, but does the "no diodes" apply only on pre-manufactured kaypads?
I am planning to make my own matrix for input switches and now the question is if all the diodes are required or not:
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 517
Posts: 26301
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Diodes are not required.
What the library basically does is have all the column lines high.
It then brings 1 low, and reads the row pins. If a low is seen, it knows the active column, and now the row, so it knows whic button was pressed.
Then on to the next column...
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your reply, but my question is: What happens if 3 buttons in a rectanble are pressed?
Normally the arduino would report 4 buttons then if I don't use any diodes?!
Or does this library go around this problem somehow?
Hope you do understand what I mean smiley-wink
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 517
Posts: 26301
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't have a keypad set up at the moment. It likely just reports the first one it reads. Try it & see. 
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Phillipsburg, NJ
Offline Offline
Full Member
***
Karma: 6
Posts: 184
Author: Matrix Keypad Library
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Or does this library go around this problem somehow?
Sadly, not yet.  As soon as they improve quantum computers I should be able to nail it. smiley-wink

To be clear, you are correct.  The problem you are talking about is called ghosting.  http://en.wikipedia.org/wiki/Rollover_%28key%29.  The default settings for the library allows 10 keys to be pressed at the same time but you will need diodes if you need to avoid ghosting.
Logged

Pages: [1]   Go Up
Jump to: