*/ ?>

You are still a beginner in case of using Croduino. Or with electronics in general? Certain module occupied your thoughts but you don't know how to use it? How to use modules series is there for you! How to use modules is a blog tutorial series in which you will find all that you need to start working with your favorite module. Tutorials include technical characteristics, working principles, manuals about how to connect modules with Croduino and basic code. Rest is left for your imagination.

Basic characteristics

  Matrix membrane keyboard is one of the most basic modules. It contains 16 buttons, arranged in 4 rows and 4 columns and we use it as number input to our microcontroller. DSC_8589 Characteristics:
  • Maximum voltage: 35V
  • Maximum current: 100mA
  • Working temperature: -20 to +50°C 
  • Dimensions: 6,9 x 7,6 x 0,1 cm

Working principle

Matrix membrane keyboard uses a combination of 4 rows and 4 columns which determines each button of the keyboard to the microcontroller, Croduino. Physically, below each button, there is a pushbutton which is connected to red with one end and to the column with the other. You can see these connections in the picture below: Model

How to connect module with Croduino

This module comes with female headers which are connected to Croduino as shown in the picture below. Since Croduino comes with female headers as well, most simple way to make a connection is to add male headers in between. We can establish the connection with male-to-male cables too. Klik za veću sliku


A code for Matrix membrane keyboard can be downloaded from the link below. To make it more simple, we used the Keypad library, and code shows an activated button inside a Serial monitor. If you are having any issues regarding library installation, follow our tutorial.
/*                                                                           */
/* (c) 2014 -             */
/* [email protected]                                                        */
/*                                                                           */
/* Matrix membranska tipkovnica 4x4                                          */
/*            */

#include "Keypad.h"  // kod koristi library Keypad.h
                     // mozes ga preuzeti na

const byte red = 4;    // Tipkovnica ima 4 reda
const byte stupac = 4; // i 4 stupca

  char tipke[red][stupac]  = {  // definiraj polozaj tipki na tipkovnici

  byte red_pinovi[red] = {7,6,5,4};   // pinove redova spajamo redom na PIN9, PIN8, PIN7, PIN6    
  byte stupac_pinovi[stupac] = {3,2,1,0};  // pinove stupaca spajamo redom na PIN5, PIN4, PIN3, PIN2
  Keypad tipkovnica = Keypad(makeKeymap(tipke), red_pinovi, stupac_pinovi, red, stupac);
  void setup() {
    Serial.begin(9600);  // zapocinjemo serijsku komunikaciju
  void loop(){   
    char utipkano = tipkovnica.getKey();  // registrira pritisnutu tipku
   if (utipkano) {               // kako bi izbjegli sumove, rezultat 
    Serial.println(utipkano);    // prikazujemo samo ako je nesto utipkano