How a Keypad Matrix Work ?


   Keyboard like on a computer keyboard, has a lot of input in the form of letters, numbers, symbols, functions, etc.. Using synchronous serial communication protocol and uses 2 lines of communication so that the SDA (serial data) and SCK (serial clock). Both are used for systems with many input and complex and very useful for some applications microcontroller.
  While the keypad input matrix is the solution to quite a lot with a little pin mikrokontroller.Keypad using matrix generally consists of button / Push Button NO ( Normally Open ) which is coupled with an array of rows and columns to form a matrix . The composition of the matrix is what causes a lot of buttons by using the little pin microcontroller . If the composition of the matrix of 4 rows and 4 columns or 4x4 matrix keypad achieved so much is 16 buttons ( maximum of 28 keys ) , while as many as 12 key 4x3 matrix ( maximum 21 buttons ) .



To access the keypad are connected in a matrix as shown in figure 2 that use the scanning system .


Each pin row and column pins are not connected to each lain.Saklar - switch or button that when pressed will cause the pin row and column pins connected . When press S1 in the S1 will connect line 1 to column 1 , when S3 is pressed then the S3 connects row 1 with column 3 , when pressed, S12 S12 connects with line 3 column 4 , and so on . Therefore microcontroller pin should detect the connection of the row and column pin satupersatu to avoid errors reading data further defined as a character . To prevent the occurrence of errors then one should be used as output and other woods are used as inputs into output columns and rows into the input ( adjusted for hardware design ) .


Keypad scanning method is to detect the relationship pin rows and columns as the button is pressed , respectively , and alternately one by one . More details as follows :


§ Pin - pin output columns become rows and the pins become inputs .
§ Pin column and row pin initial conditions ( the default ) all logic 1 .
§ Output pin logic 0 and 1 column detection :
· If the input line 1 turned into a logic 0 then the character '1 '
· If the input line 2 turns into a logic 0 then the character '4 '
· If the input line 3 turns into a logic 0 then the character '7 '
· If the input line 4 turns into a logic 0 then the character ' * '


§ Pin column and row pin back logic 1 all .
§ Output pin logic 0 and column 2 detection :
· If the input line 1 turned into a logic 0 then the character '2 '
· If the input line 2 turns into a logic 0 then the character '5 '
· If the input line 3 turns into a logic 0 then the character '8 '
· If the input line 4 turns into a logic 0 then the character '0 '


§ Pin column and row pin back logic 1 all .
§ Output pin logic 0 3 columns and detection :
· If the input line 1 turned into a logic 0 then the character '3 '
· If the input line 2 turns into a logic 0 then the character '6 '
· If the input line 3 turns into a logic 0 then the character '9 '
· If the input line 4 turns into a logic 0 then the character ' # '


§ Pin column and row pin back logic 1 all .
§ Output pin logic 0 and column 4 of detection :
· If the input line 1 turned into a logic 0 then the character ' A '
· If the input line 2 turns into a logic 0 then the character ' B '
· If the input line 3 turns into a logic 0 then the character ' C '
· If the input line 4 turns into a logic 0 then the character ' D '