Reading switch matrix keypad with plc inputs

zstreedbeck

Member
Join Date
Mar 2005
Posts
5
Is there a way to interface a keypad using switch matrix circuitry to plc inputs, specifically an AB 1746-IB16 24vdc (<5v=off, >10v=on)input module. FYI: a switch matrix keypad (say 3 columns of buttons horizontally, 4 rows vertical) has 1 wire common to each row and 1 wire common to each column. When a key is pressed the common wire for that row is connected to the common wire for that column. I am trying to use this for access control for a gate, and have seperate codes for different people, to track who enters. I cannot find a keypad with an individual circuit for each key. I have, in the past, hacked up a keypad to get an individual circuit for each key, but there must be a better way.
 
I can conceive how to do it with analog inputs, and monitor volts or current, and add some circuitry with resistors and such, but the discrete is a stumper
 
zstreedbeck,

There are many ways. Here is one. You can create your own logic to interpret the buttons. You have two sets of inputs to worry about. One set, say the "column" common wires, can be sent to the PLC as Inputs. What about the other set of "rows"? You need another set of inputs with a separate voltage for each one in order to read each button. Because your PLC does not have this, you have to set up another set of pseudo-inputs, but using PLC outputs instead!! Because you have fewer rows than columns, then use an Output for each row. Switch each output on sequentially, very fast (every 2/10 second perhaps?), then read the column inputs to see which button was pressed. Here is an example program.
 
Last edited:
Interesting solution, Lancie1. One thought I have is to switch voltage to all rows for a short time and reading the columns, then to all columns for a short time and reading the rows, all this multiple times per second(20Hz?). The only problem is a device to do the switching and not destroy itself in too short of a time. I guess my ideal solution would be to come up with some custom, yet simple, TTL or CMOS circuitry to handle this. I have some experience in digital logic, but it has been awhile since tech school.
 
zstreedbeck,

Thanks for the compliment. I think it will work, if the "read" time is set properly to allow for the shortest button-press that can occur. I have used something similar for other programs. The employees may have to be told to keep their finger on each button for 3/4 second minimum, or else a feedback lamp should be added to the pushbutton panel that shows when a button has been read by the PLC.

There are TTL input modules available for the SLC500, and there are TTL pushbutton pads available also, but for other reasons you may need to stick with what you have in house.
 
Last edited:
Using an output module apply power to one column at a time, delay a moment, read the inputs and decode. Then switch to the next output and repeat. With DC out and in you should be able to cycle fairly quickly. The 'delay' could be just one scan.


In other words - Scan 1 - turn on output 1. Scan 2 - do nothing. Scan 3 read inputs and decode, turn off output 1, turn on output 2. Scan 4 - do nothing. Scan 5 - read inputs and decode... Continue on forever.
 
bernie_carlton said:
Using an output module apply power to one column at a time, delay a moment, read the inputs and decode.

For even faster reading / decoding, think the reverse. Apply power to all columns. Then when any button is pressed, you can detect it at once, drop power to half the columns, look again at the inputs. Repeat as needed.

Oh, be sure to detect when multiple buttons are pressed in the same column.

Then once that a single button has been read, again apply power to all columns, wait for no inputs (button released) and you're setup for the next button press.
 
Better yet, I did some more research and found some keypads of the "common bus, single pole" variety with an output for each key. Thanks for all the ideas though!
 

Similar Topics

Hi everyone, I just got a new Ethernet Base Controller, with two 16 input modules, in a 4 slot base (normally known as a PLC) with a 24V DC...
Replies
3
Views
4,305
Hello I have a s7-1200 and I would like to read the tags present in this controller with my controllogix controller. The two controllers don't use...
Replies
3
Views
37
Hi all, i have 8 CJ2m plc units that show different numbers on the plc display and i am stuck on reading the info. my unit has an ip address of...
Replies
3
Views
81
Hi Everyone, I am not proficient in RSLogix 500 so I have a question regarding the evaluation of N7:0 data as an input. So as I understand in...
Replies
1
Views
81
Trying to setup a message read via Ethernet. I have the path setup as 1, 1, 2, 192.168.66.10 I get an error code 1, ext err 315. I am beating...
Replies
9
Views
231
Back
Top Bottom