Bukit Mertajam, Penang

Attendance Record System

I have been given a task to build an attendance system for our staff. The requirements are quite straight-forward. It needs to be standalone (without computer), fingerprint recognition is preferred and it should record real time into an SD card.

1.0 Introduction

There has been various kinds of attendance record system in the market, RFID-based, fingerprint scanning-based and barcode-based, etc. Talking about this attendance system, you may think that it is quite complex and hard to build. However your perception might change after you read this article. In this tutorial, we are going to demonstrate how to make a simple attendance system using currently on-sale Cytron products including the Arduino Mega, SM630 fingerprint module, Breakout Board Micro SD and other devices such as LCD display shield and an RTC Module (Real Time Clock).

1.1 Feature

The objective of this tutorial is to build a standalone attendance record system.

Below are the features of the system:

  • Built using Arduino Mega 2560 main board 
  • Utilizes SM630 fingerprint module for fingerprint scanning purpose and extra storage.
  • Utilizes embedded microSD through Breakout Board Micro SD  to store attendance information that can be easily accessed by user.
  • includes LCD Keypad shield that displays time and attendance information. It also contains 5 buttons (not including reset button) as navigation buttons for the user.
  • includes RTC module to provide current date and time.
  • includes other devices such as a buzzer as indicator.

2.0 Getting Started

2.1 Components

The components you need:

Electronic components:


Fingerprint module UART connection:

RTC Module System:

  • 1 x Arduino Type Header pin

BreakoutBroad Micro SD:

  • 1 x Arduino Type Header pin

2.2 Basic Connection:

The system is built by stacking up the main board and shields as shown below.


Before stacking up, we need build a circuit consists of all necessary systems on prototyping shield.

prototype circuit




2.22 Indicator

We use a buzzer to indicate when an attendance is successful recorded. One beep indicates login success, 2 beeps means logout and 3 beep sounds indicates an error, perhaps the improper installation of microSD card or an unrecognized employee fingerprint, etc. If you use our example code, connect longer leg of the buzzer to A1 and another to GND.

User can also customize their own indicator systems such as using visual indicators like LEDs.


2.23 Fingerprint Module UART Connection

The figure below shows the connection between the connector and the Arduino prototyping shield.


2.24 RTC module 

Users can either directly solder the module to prototyping shield or solder a 5 pin or 6 pin header on the shield for easy removal of the module like we did.  This RTC module stores current time information with the power of a coin cell lithium battery.

Note**: Removal of the battery will instantly erase all the information stored in the RTC and reset its time. Handle with care!

We are going to use 4 pins only :VCC, SCL, SDA and GND. Leave others as unconnected.


You can either use jumper wires to connect to the legs of female header pin, or solder 2 wires onto the board as SDA and SCL wires.


Connect the SDA wire to pin 20 and SCL to pin21. There should labels for you as guidance.


While inserting battery, make sure the side of battery with “+” sign attached to the surface of coin cell holder with “+” sign.


3.0 Programming

Below is the flow diagram sketch of the designed system. The full sketch can be downloaded here.


Basically the programming involves 4 major parts:

  • Fingerprint scanning process and teaching process
  • Information storage and access with the fingerprint module and micro SD,
  • Time settings and display
  • Menu interface for time setup, fingerprint teaching ,etc.


The SM630 Fingerprint module uses packet data communication. If we wants the module to carry out certain operations, we need to send a command – which is a string of bytes in serial. After the device receives the data, it will send back a response – which is another string of bytes in serial. It is our job to program the board to ‘write’ and  ‘read’ these bytes and its following actions.

Generally the communication packet includes the following:

  • packet head – 2 bytes
  • packet flag – 1 byte
  • packet length – 1 byte
  • packet content – N bytes (any number of bytes)
  • checksum – 1 byte

Let say we want to add fingerprint at position(id) 2, what should we send?

  • packet head : 0x4D and 0x58
  • packet flag: 0x01 (command)
  • packet length:adding operation requires 3 data bytes for packet content, thus here we should put 0x03
  • packet content:  0x40 (command code as stated in user manual), 0x00(high byte of value 2), 0x02 (low byte of value 2)
  • checksum : 0xFA (low byte of total sum from packet head to packet content data)

So we should send a string of data bytes  {0x4D,0x58,0x01,0x03,0x40,0x00,0x02,0xFA} in serial to the fingerprint module.

This is just a brief explanation on the working principle of fingerprint module. To know more details on how to communicate with the module and execute other functions, user can refer to the SM630 Fingerprint Module User’s Manual.

Below is the sample code of sending command and receive response. This sample code is not optimized to full functionality. User can play around to add in more functions or modify the program for the best performance.


Related Posts

Leave a comment