Shop OBEX P1 Docs P2 Docs Learn Events
How to hook up a 4x4 keypad to BS2sx — Parallax Forums

How to hook up a 4x4 keypad to BS2sx

tripjacktripjack Posts: 13
edited 2006-11-21 03:51 in BASIC Stamp
Hi,

I have a 4x4 keypad which I would like to interface to the BS2sx

The keypad has 8 terminals for soldering wires.

I have seen a "pullup" circuit diagram that looks like this:

·
See attachment



My question is: how do the actual resistors & wires get connected ?
I know where my input pins are on the BS2SX activity board - but where do the resistors go.
WHere does +5V attach? WHere does ground attach?

The keypad does not have a "ground" - only 8 signal terminals, which should be connected to resistors, right?

David
84 x 83 - 1K

Comments

  • tripjacktripjack Posts: 13
    edited 2006-11-20 23:32
    Sorry that picture was too small, here is a bigger one...
    263 x 261 - 16K
  • tripjacktripjack Posts: 13
    edited 2006-11-20 23:38
    Here is the "pullup" circuit diagram ...
    230 x 226 - 4K
  • GuidoGuido Posts: 195
    edited 2006-11-20 23:57
    Tripjack.

    I think this is what you are asking.

    5 volt goes to·the individual·end of the 47K like shown

    All commons on Push Buttons are connected together and brought to -5VDC
  • GuidoGuido Posts: 195
    edited 2006-11-20 23:59
    oops

    The JUnctiob of the 1K and 47K goes to the Push Button and then the !K goes to the individual Satmo Input pins 5-12 respectiviey
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2006-11-21 00:25
    You probably have a 4x4 matrix keypad, with 4 connections to the rows and 4 to the columns. You need to connect all 8 of them to stamp pins through 1kohm resistors. You may have to do some experimenting to determine which keypad connections are rows and which are columns. Connect the 49kohm resistors from the row inputs to +5 volts. I'll try the ascii art, but if it doesn't come out, there is a better picture at www.emesys.com/BS2fsm.htm#keypad. There are lots of examples of matrix keypad circuits and coding around, even some schemes that require fewer pins on the Stamp.

    O = open keyswitch
     X = closed keyswitch
    
                                                   49kohm x4 for pulliup
     O----O----O----O-------------------;---/\/\--o--- +5v
     |      |      |     |                         |          |
     O----X----O----O--------------;--------/\/\--|
     |      |      |     |                  |      |          |
     O----O----O----O---------;-------------/\/\--|
     |      |      |     |            |    |      |           |
     O----O----O----O----;------------------/\/\--|
     |      |      |     |      |     |    |      |           
     \      \      \     \      \     \    \      \           
     /      /      /     /      /     /    /      /           
     \      \      \     \      \     \    \      \           
     |      |      |     |      |     |    |      |           
     P8    P9   P10  P11  P12  P13  P14    P15 
      1k resistors x 8 for protection
    
    



    In this picture, p12 to p15 on the stamp will be configured as inputs and will read high when no pushbutton is pressed. To code for this, your program scans by bringing one column low at a time. In the picture, the closed switch (X) will show up as a low on row p14 when column p9 is low.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 11/21/2006 12:33:49 AM GMT
  • tripjacktripjack Posts: 13
    edited 2006-11-21 03:51
    Tracy,

    Thanks so much this is exactly what I was after. Now I won't have to worry so much about blowing up my chips!jumpin.gif

    David
Sign In or Register to comment.