1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Electronics 12-key keypad wiring

Discussion in 'Modding' started by dragon2309, 15 Jun 2007.

  1. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    949
    Likes Received:
    11
    Picked up a couple of keypads on the cheap (really cheap, which is why i bought them without having a reason to)

    They are the small type, used in security code pads etc...

    Keys like this

    Code:
    1   2   3
    4   5   6
    7   8   9
    *   0   #
    Got them home, had a close investigation, they only have 7 connectors on the bottom... strange... 12 keys but only 7 connectors. Which got me thinking, maybe it interfaces with serial or something? If so then this is goig to be harder to tinker with than i thought

    Any ideas, i can post pics if you'd like...

    dragon2309
     
  2. ChromeX

    ChromeX Minimodder

    Joined:
    12 Aug 2004
    Posts:
    1,606
    Likes Received:
    22
    perhaps they output in binary? Bit hard to say without knowing more about them, any numbers on them?
     
  3. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    949
    Likes Received:
    11
    That crossed my mind as well, its definitely a possibility.

    The onyl serial/code/model number/ID on the board is "AP-207WP-MM" I've searched for countless hours and countl find anything worth writing about...

    The closest was this PDF - http://www.megatonecorp.com/product_doc/pdf/keypad-web-kpd-207WP.pdf although its got 207WP in it, there are subtle differences to the one i have and the ones in those pictures. That and the fact taht PDF is utterly useless with reaards to connectivity.
     
  4. Javerh

    Javerh Topiary Golem

    Joined:
    5 Sep 2006
    Posts:
    1,045
    Likes Received:
    26
    Pop them open. Maybe you can get to contacts of the buttons directly.
     
  5. Smilodon

    Smilodon The Antagonist

    Joined:
    25 Mar 2003
    Posts:
    6,244
    Likes Received:
    102
    Sounds like a matrix setup.

    one for each row and one for each column.

    3 columns and 4 rows. that's 7 connectors :)
     
  6. Macaba

    Macaba What's a Dremel?

    Joined:
    4 Mar 2006
    Posts:
    107
    Likes Received:
    1
    I'm going with the matrix setup idea.
     
  7. ConKbot of Doom

    ConKbot of Doom What's a Dremel?

    Joined:
    2 Jul 2003
    Posts:
    2,160
    Likes Received:
    6
    12 keys and 7 wires... most likely its has 3 common columns and 4 common rows. Find a micro-controller and use that to scan the keypad. Though I have seen somewhere (forget where) something that hooks directly to the keypad and outputs DTMF, thats not really helpful unless your making a phone.
     
  8. capnPedro

    capnPedro Hacker. Maker. Engineer.

    Joined:
    11 Apr 2007
    Posts:
    4,381
    Likes Received:
    241
    4 rows, 3 columns! Welcome to the Matrix!

    EDIT: Damn, beaten. Thrice.
     
  9. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    949
    Likes Received:
    11
    Ok, i'm sort of getting this matrix idea thing... so these 7 connectors at the bottom, say the first three, do they correspond with columns 1, 2 and 3 and the next 4 connectors correspond with the rows 1, 2, 3 ans 4?

    So say i pressed button 8, it would close the circuit around pins 2 and 6?? yes?

    If so that makes perfect logical sense, but it still is quite confusing... how would i interface with this.

    I'll give you a little hint, i aim to have it as part of a multi-lock on a case to power it up, theres two key switches, and i want this keypad to act as the 3rd lock... easily done, just put all three switches in series on the PWR_ON connector on the mobo, but still, i need to get my head around this keypad first

    cheers, dragon2309
     
  10. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    949
    Likes Received:
    11
    okay, after metering every possible combination and pressing every single button over 7,000,000 times, i've come up with this, but ill be screwed if i can make sense of it

    [​IMG]

    :|
     
  11. jakenbake

    jakenbake full duplex

    Joined:
    5 Jun 2005
    Posts:
    495
    Likes Received:
    3
    i cracked it... kinda... lol

    Code:
        
         5   1   3  2  7    6  4  
    1            x  x
    2        x      x
    3    x          x 
    4            x     x
    5        x         x
    6    x             x
    7            x         x
    8        x             x
    9    x                 x
    *            x            x
    0        x                x
    #    x                    x 
    
    edit: if you just comment a chart like this in your code, then it should be relatively easy to see how each one is done, even in the future.
     
  12. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    949
    Likes Received:
    11
    thats helpful in the fact that it sort of dispalys it in a nice fashion, but it still doesnt make any sense, it only looks like it does because you mixed up the pin numbers along the top... my question is why the hell would they make a board layout like that, it makes no sense
     
  13. jakenbake

    jakenbake full duplex

    Joined:
    5 Jun 2005
    Posts:
    495
    Likes Received:
    3
    lol, no clue. thats why i said i "kinda" cracked the code. oh well, at least you know how it works and it will only take up 7 pins on a PIC. any clues as to what your going to use it for yet?
     
  14. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    949
    Likes Received:
    11
    He he, thanks for setting it out for me btw, appreciate it.

    First thing, is that i've never used a PIC or programmed anything more than simple arrays in C#... and that was over 2 years ago... I do PHP if thats any help... lmao

    and yeh, in a couple posts back i mentioned it... quote..:

     
    Last edited: 16 Jun 2007
  15. Bas van der Werff

    Bas van der Werff What's a Dremel?

    Joined:
    18 Feb 2007
    Posts:
    228
    Likes Received:
    0
    Very good idea to use it as a lock on your conputer :D i'm having the same in my project.
     
  16. Smilodon

    Smilodon The Antagonist

    Joined:
    25 Mar 2003
    Posts:
    6,244
    Likes Received:
    102
  17. ch424

    ch424 Design Warrior

    Joined:
    26 May 2004
    Posts:
    3,112
    Likes Received:
    41
    OMG Come on people, I figured this out for myself aged 12.
    Code:
    OOOOOOO
    ||||||+-2nd row
    |||||+--3rd row
    ||||+---3rd col
    |||+----4th row
    ||+-----1st col
    |+------1st row
    +-------2nd col
    
    To read with a PIC: make col1 high, other cols low, then test each of the rows, if row1 is high, that means "1" is being pressed, if row2 is high, "4" is being pressed, if row3 is high, "9" is pressed etc. Then make col2 high and the rest low, and repeat for 2,5,8,0 then finally make col3 high and the rest low, and read in the rows for 3,6,9,#.
     
  18. capnPedro

    capnPedro Hacker. Maker. Engineer.

    Joined:
    11 Apr 2007
    Posts:
    4,381
    Likes Received:
    241
    To route the PCB traces easier?
     
  19. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    949
    Likes Received:
    11
    Well duh, we all know that already, i was pointing out that it didnt really make logical sense, surely for the easiest use it would be pins 1-7 with column 1, 2, 3 and then row 1, 2, 3, 4 along the 7 pins, in that order...

    But, yeh, as pointed out by someone else, it was most probably to route the traces easier. Which makes sense i suppose.

    I'm currently looking into PIC programmers, they are quite expensive (cheapest i can find is £20 and that doesnt really look very good). And im only using it for one thing ever, seems expensive.

    I dont suppose there is any service or person on here that programs chips and sends them out for a fee or anything?

    Also, say myself or someone else does end up programming a PIC, how would it actually interface with the keypad, im pretty sure these are simple questions and are making me look like a dick, but i have no idea about PIC's, sorry

    I could go the other non technical way, rig up some sort of latching switches (or possibly relays) only on a set of 4 terminals etc... then it would only complete the circuit if the right keys were pressed.... Sort of crap though, cos a user could just press every switch, lol... But for the purposes of external viewing and photos/videos it would work fine, its just not functional, lol

    dragon
     
  20. jakenbake

    jakenbake full duplex

    Joined:
    5 Jun 2005
    Posts:
    495
    Likes Received:
    3
    basically, you would just hook those 7 lines into 7 IO lines on the PIC. when a button is pressed, two of those IO lines will go HIGH, so then you find which 2 went HIGH, then use a lookup table to find which key was pressed.

    heres a little example i found real quick, even has some assembly code for the PIC.

    http://www.winpicprog.co.uk/pic_tutorial9.htm

    edit: or, even better, here is an encoder that takes the keypad and transforms it into binary numbers that can be transfered to the PIC either in 4 parallel lines or one serial line. it also has an output for a beeper noise thing. pretty cool...

    http://www.elabinc.com/ede1144.pdf

    oh, btw, its for a 4x4, but you have a 3x4... there is probably one out there for a 3x4 button matrix.
     
    Last edited: 16 Jun 2007

Share This Page