4017 based keypad matrix scanner

So, here’s  a simple concept I modified to be a lower pin count and fewer processor cycles less.  The original example I found here used a 74hc595, which is an 8-bit shift register) to scan one bit through the register and through some clever trickery with pull ups and pull downs read out serially what row and column that button is in.  My modification did away with the shift register (which you have to prime with one bit every time you scan) and replace it with a decade counter.  The decade counter does just what we’re using the shift register to do, scans one bit out many outputs.  The decade counter can start in an unknown position, but the start up reset circuit (a diode, capacitor, and resistor to temporarily pull the line high until the cap is charged, then pull it low always after that) sets it back to a known state.

I haven’t seen anyone else try this particular setup before, partially because if through some cosmic radiation (or something more likely)  and a bit gets flipped then you’ll be off-by-one for the rest of your days.  This can be gotten around by triggering the reset line before every read, but I’ll try my hardest to keep the pin count down.  The next problem is that the decade counter resets after ten cycles, not eight.  This should be able to be remedied by tying the reset line to the 9th output, but I haven’t had much luck making that work.  The solution  I came up with is to manually clock the device twice after every shiftIn().  My code here makes it easy to implement the keypad polling in whatever code you’d want.  This could be expanded to a 4×4 matrix with minimal modification (it was originally designed for such, but I’m not using one).

The circuit is fantastically simple to wire and to code for.  I didn’t have any circuit board I was willing to sacrifice to this temporary setup so this is some old wire wrap board (no copper).

This was to be used in the OpenAccess system, but it was abandoned like lots of other parts.


Tags: , , ,

3 Responses to “4017 based keypad matrix scanner”

  1. Arduino keypad and display | Evan's Techie-Blog Says:

    […] cable and have all the keypad and lcd pins run back to the main microcontroller, I could even use local chips to multiplex those pins, but having a second brain at the other end able to take human-readable […]

  2. Wiegand keypad | Evan's Techie-Blog Says:

    […] far with the OpenAccess system I’ve talked about the rs485 terminals I tried to use, a clever low pin count display and keypad, the final display and keypad controller I built, and the ability to log to a dot matrix printer. […]

  3. OpenAccess 3.0 replacement software | Evan's Techie-Blog Says:

    […] 4017 keypad and 74595 display […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: