Apem AC3561ILL Illuminated Membrane Keypad Array: 4 x 4 Contact load 30 V/DC (L x W) 95 mm x 95 mm AC3561ILL Data Sheet

Product codes
AC3561ILL
Page of 1
     3561ILL
5
9
6
10
7
11
8
12
4
13
3
14
2
15
1
16
LED MATRIX
SWITCH MATRIX
PINS
PINS
PINS
PINS
Row1
Row2
Row3
Row4
C
o
lu
m
n
1
C
o
lu
m
n
2
C
o
lu
m
n
3
C
o
lu
m
n
4
Row1
Row2
Row3
Row4
C
o
lu
m
n
1
C
o
lu
m
n
2
C
o
lu
m
n
3
C
o
lu
m
n
4
Application Note:
Scanning The Keypad Matrix and Driving The LEDs
Scanning The Keypad Matrix
The membrane keypad can be interfaced easily to a bi-directional 8 bit port on a microprocessor.
Connect the 4 rows to the lower 4 bits of the port. Pull each of the Rows down to 0V with a 100K resistor.
Configure these 4 bits as inputs.
Connect the 4 columns to the upper 4 bits of the port. Configure these 4 bits as outputs.
Output a ‘1’ on column 1 and look at each row in turn, looking for a ‘1’. If all rows are ‘0’, reset column1 to ‘0’ and
move on to column 2, 3 then 4 repeating the same procedure. Go back to column 1 and repeat.
If at any time a ‘1’ is detected when reading a row, pause 10mS to allow for key ‘bounce’ and read that row again.
If the row is still ‘1’ there is a key pressed. Branch to carry out the function for that key, then return and read that
row again to see if the logic level is now ‘0’, which would signify the key has been released, in which case move
on to the next column and resume scanning. Otherwise go round a loop checking for the key to be released before
continuing with the scan.
This simple method will detect any single keypress; if more than one key is held down at once the program will
register the first key it discovers is pressed depending on where it is in the scan.
Latching functions can be achieved by setting and resetting a flag alternately when a key is pressed.
Driving The LED Matrix
Lighting the LEDs is almost the opposite of reading the keys. Connect the 4 rows and 4 columns to an 8 bit output
port on the microprocessor. Fit a 270 ohm resistor in series with each of the rows to limit the current to around 10mA.
To light an LED, its corresponding row must be set to’1’ and its column to ‘0’. For the LED to be off, its corresponding
row or column must both be set to the same logic level - either ‘1’ or ‘0’.
Depending on the complexity of the equipment, one could constantly go round a loop adjusting the on / off status
of each LED to the required state, effectively scanning the LEDs.
3
1
7
5
11
9
15
13
4
2
8
6
12
10
16
14
RoHS COMPLIANT