Skip to the content
2 layers60 × 88.5 mmAttendance management system, the printed circuit board in 3D

Attendance management system

rajinthanr/attendance-management-system2

Battery-powered NFC attendance logger (STM32L432 + ST25R3916) that mounts as a USB drive, with a Qt companion app

Size
60 × 88.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
93
Nets
72
Pads
329
Tracks, vias
629, 92
Pours
6
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
10 Sep 2026
Updated
14 Oct 2026

Overview

Attendance management system is an open-source printed circuit board by rajinthanr, from the rajinthanr/attendance-management-system repository on GitHub, published under the MIT licence. It is a 2-layer board of 60 × 88.5 mm with 93 parts on 72 nets, routed with 629 tracks and 92 vias.

It is built around the ST25R3916-AQWT, USBLC6-2SC6 and X32252712MMB4SI, with the AO3400A and SS14 among its other parts. Its parts include 38 capacitors, 20 resistors, 7 connectors, 6 diodes and 5 ICs. It belongs with the radio and wireless and power boards and the STM32 boards of this library.

Main components

5

README

README.md

Card Attendance System

A battery-powered NFC attendance logger. A student taps an ID card and the unit confirms the tap with an LED and a vibration pulse, and stores the card number with a timestamp in on-chip flash. Plugged into a PC over USB-C, it appears as a USB drive, with no driver needed.

A desktop companion app for the PC keeps the student names, decides which cards are registered and works out who attended which lecture.

The repository holds the hardware (KiCad 10), the firmware (STM32CubeIDE / Makefile), the companion app (Python, Qt) and a 3D-printable enclosure.

Install the companion app on Windows

  1. Download the installer: Companion/dist/AttendanceLogger-Setup-1.0.0.exe (direct download, 26 MB).
  2. Run it. It installs for the current user without an admin prompt (it offers an all-users install too), into %LOCALAPPDATA%\Programs\Attendance Logger. Python and Qt are bundled, so nothing else needs installing.
  3. Start Attendance Logger from the Start menu (or the optional desktop icon). Attendance Logger (demo, made-up data) shows the whole app without a device.
  • Requirements: 64-bit Windows 10 or 11.
  • "Windows protected your PC": the installer is not code-signed, so SmartScreen may warn the first time. Choose More info, then Run anyway.
  • Your data lives in %USERPROFILE%\AttendanceLogger\attendance.db, with a daily backup in backups\ (the last 14 kept). Uninstalling or upgrading the app leaves it in place.
  • Upgrading: run a newer installer over the old one.

On Linux, build the .deb or a portable .tar.gz with sh Companion/packaging/build_linux.sh; on macOS, or to run from source, see Running from source. Companion/README.md explains the app in full.

Project status (2026-10-14)

AreaState
Schematic and PCBRouted except the NFC antenna loop (AE3), which still has to be placed and its feed routed. The through-hole parts (battery connector, SWD header, NTC) moved to the back on 2026-10-11 for the slim enclosure, so PCB/production/ and PCB/bom/ need regenerating.
FirmwareRuns on the board. Card reading, the reader's low-power card wake-up, LEDs, vibration, Stop 2 sleep and the USB drive work. 931 host checks pass.
Companion appQt desktop app with Windows and Linux installers, built by GitHub Actions on every change.
EnclosureTwo-part printed case (base and lid), designed in code and fit-checked against the board.

How it works

  1. Card tap. The ST25R3916 reader sleeps in its own wake-up mode, watching the antenna for a card, and wakes the MCU when one comes near. It reads ISO14443-A cards (MIFARE Classic, NTAG and similar). The card number is the UID: 4-byte UIDs as they are, longer ones by their last four bytes.

  2. Check. A card read again within 10 s, or already recorded in the current lecture, is a duplicate and is not recorded again. Every other card is recorded. The device keeps no list of students: it records every card, and the PC app decides who is registered.

  3. Feedback.

    ResultFeedback
    Tap recordedgreen LED and one short buzz
    Duplicategreen flashes twice, with a short buzz each
    New lecture started (button hold)green and three quick buzzes
    Battery lowred blinks five times (and the idle flash turns red)
    Log full, or reader faultred flashes four times, with a buzz each
    Settings applied / refusedgreen and two buzzes / red and three buzzes
    Waiting for cardsa 10 ms green flash every 5 s (red when the battery is low)
    Plugged into a computera green flash every second
  4. Logging. Taps go to a RAM buffer, then to flash within 5 seconds. The log holds 6,858 records and survives a power cut. When it is full, new taps are refused rather than overwriting old ones.

  5. Lectures. Starting a lecture writes a marker into the log, so taps are grouped by lecture even without the app. A lecture is started from the app, or on the device by holding the button for 2 s (it keeps the module and numbers the lecture on: Lecture 4 becomes Lecture 5). A card counts once per lecture. The app imports every tap before a lecture starts and then has the device delete its copy (#CLEARLOG).

  6. USB. Plug in USB-C and the device appears as a drive called ATTENDANCE. A tap while it is plugged in is not attendance: it goes to LASTCARD.TXT, so the app can register the card. Ejecting the drive or tapping the button applies SETTINGS.CSV and starts taking attendance with the cable still in; a quick double press brings the drive back. A USB charger that is not a computer is recognised after 5 s, and scanning carries on while it charges.

  7. Power. Press the button to switch on; a tap shows the battery level. Holding it for 5 s switches the device off. On battery it switches itself off after 3 minutes without a tap, or when the battery is flat.

Firmware/docs/Attendance_Logger_Easy_Guide.pdf is a five-page, picture-led guide to hand to lecturers; Firmware/docs/USER_GUIDE.md explains the device in full for the people who run a class with it.

Low power: measured

The logger spends almost all of its life in one of two low-power states, and draws large currents only for milliseconds per tap. One charge of a 1000 mAh cell lasts about 17 months at four 100-student lectures a day (27 months from the device's own draw; the rest is the cell's self-discharge).

StateCurrent (measured)What is running
Switched off1.8 µAMCU in Standby with the RTC, reader powered down
Switched on, waiting for cards108 µAMCU in Stop 2, reader in its own wake-up mode, 10 ms heartbeat flash every 5 s
Reading a card202 mA for 12.2 msRF field on: REQA, anticollision, SELECT
Buzz91 mA for 50 msvibration motor starting and running
One whole tap10.3 mC (2.8 µAh)read, buzz and the LED pattern
One 100-student lecture0.36 mAh100 taps plus the idle time
For comparison: plain polling18.9 mAreader polled every 100 ms instead of wake-up mode; 2 days per charge

The trick is the reader's wake-up mode. Instead of the MCU switching the 13.56 MHz field on every 100 ms to look for a card (18.9 mA on average), the ST25R3916 measures its antenna by itself for about 0.7 ms every 100 ms and interrupts the MCU only when the reading changes. That is 175 times less current, and 91 % of what is left:

Idle current breakdown: reader wake-up mode 99 µA, heartbeat LED 5.5 µA, MCU in Stop 2 3.3 µA, MCU wake-ups 0.2 µA, battery sample 0.2 µA

Oscilloscope captures

Measured on 8 October 2026 with a Tektronix TBS1052C across a 1 Ω shunt in the battery's negative lead (1 mV = 1 mA), each capture's offset removed. Steady currents (Standby, Stop 2, reader Ready) were read with a multimeter in series with the cell, using a power-test build that holds each load steady.

One wake-up measurement. The reader's oscillator starts, the antenna is driven for 41 µs, and everything stops again: 9.9 µC, ten times a second, is 99 µA on average.

Scope capture of one wake-up measurement: oscillator start at 13 mA for 0.4 ms, a 3.7 mA plateau, then a 94 mA spike for 41 µs

A card tap. The measurement that sees the card wakes the MCU, which switches the field on to read the card (202 mA for 12.2 ms), then buzzes the motor and lights the green LED with the field off.

Scope capture of a card tap: 202 mA for 12.2 ms while reading, 91 mA average for the 50 ms buzz, then 9.2 mA for the reader and green LED

A false wake-up. When the antenna reading strays without a card, one empty poll (5.7 ms) confirms it and the reader goes straight back to wake-up mode. The firmware learns from these and widens its window, so they stay rare.

Scope capture of a false wake-up: a 228 mA empty poll for 5.7 ms, then nothing until the next wake-up measurement 99 ms later

The raw captures are Waveforms/TEK0000{5,6,7}.CSV; python3 Waveforms/readme_plots.py redraws these graphs, and Firmware/docs/Power_Estimation_Report.pdf has the full analysis (every mode, wake-up timings, battery life and the cost of the unit).

Files on the USB drive

FileContents
ATTEND.CSVevery tap (DATE,TIME,CARD_ID), read-only
LECTURES.CSVevery lecture start (date, time, module, lecture), read-only
LECTURES\one read-only CSV per lecture, e.g. L001_2026-10-07_14-30.csv
STATUS.TXTdevice ID, clock, battery, record count, current lecture
LASTCARD.TXTthe card last tapped while plugged in, for registering it
SETTINGS.CSVedited by the PC: set the clock (#TIME), start a lecture (#MODULE, #LECTURE, #NEWSESSION), clear the log (#CLEARLOG), set the device ID (#DEVICE)

Hardware

FunctionPartNotes
MCUSTM32L432KB (Cortex-M4F, 128 kB flash, 64 kB RAM, QFN-32)Runs at 4 MHz from MSI, and 24 MHz during USB sessions, with a 32.768 kHz LSE crystal; sleeps in Stop 2 when idle. The 128 kB of flash holds both the firmware (72 kB) and the attendance log (56 kB).
NFC readerST25R3916 (13.56 MHz, QFN-32) on SPI1Differential antenna drive with an EMC filter, a matching network and a capacitive RX divider; 27.12 MHz crystal.
AntennaPCB loop, NFC_Loop_40x30_3T (40 × 30 mm, 3 turns)In the keep-out area at the top of the board.
Backup reader8-pin header for a PN532 breakout (Elechouse V3 SPI pinout)Shares SPI1, with its own chip-select (PA15) and IRQ (PB6). Not fitted, and not used by the firmware yet.
ChargerMCP73833 Li-ion linear charger10 kΩ NTC and three charge-status LEDs.
3.3 V railTPS7A0233 LDO, 200 mARuns from the cell. The reader's VDD/VDD_TX come straight from the battery, and its VDD_IO from 3.3 V.
USBUSB-C receptacle (GCT USB4110), USB 2.0 full speedSink-only with 5.1 kΩ CC resistors; USBLC6-2SC6 ESD protection.
BatterySingle-cell Li-ion, 3.7 V, 2-pin JSTSensed through a 4.7 MΩ / 2.7 MΩ divider with 100 nF, on the ADC (PA7) and the PVD input (PB7).
FeedbackRed and green LEDs, vibration motorThe motor is switched by an AO3400A MOSFET with an SS14 flyback diode.
ButtonsPower (PA0 / WKUP1), reset, BOOT0
Debug4-pin SWD header: 3V3, SWDIO, SWCLK, GND

MCU pin map

PinSignalPinSignal
PA0Power button (EXTI0, WKUP1)PB0ST25R3916 chip-select
PA2 / PA3Green / red LEDPB1ST25R3916 IRQ (EXTI1, card wake-up)
PA4Vibration motor enablePB3 / PB4 / PB5SPI1 SCK / MISO / MOSI
PA7Battery sense (ADC1_IN12)PB6PN532 IRQ
PA9VBUS detect (EXTI9)PB7Battery sense (external PVD input)
PA11 / PA12USB D- / D+PA15PN532 chip-select
PA13 / PA14SWDIO / SWCLKPC14 / PC1532.768 kHz crystal

Firmware/Bsp/Inc/bsp_board.h is the firmware's reference for the pin map, and Firmware/Card Attendance System.ioc for the CubeMX configuration.

PCB

  • Board: 60 × 88.6 mm, 2 layers, 1.6 mm FR-4. SMD parts on the top; the through-hole battery connector, SWD header and NTC on the back, so the front stays flat.
  • Floorplan: the NFC antenna fills the top of the board. Below it are the PN532 header, the MCU and the ST25R3916 front end. The power section (USB-C, ESD, charger, LDO, battery connector) runs along the bottom edge.
  • Schematic sheets:
    • power.kicad_sch: USB-C, ESD, charger, LDO and battery.
    • mcu.kicad_sch: STM32, buttons, LEDs, motor driver, SWD and the PN532 header.
    • rfid.kicad_sch: ST25R3916, crystal, EMC filter, matching network and antenna.
  • Rules: manufacturing rules are in PCB/Attendance Management System.kicad_dru. The production files sent to JLCPCB are in PCB/production/.

Enclosure

Enclosure/ holds a slim two-part case, 18.8 mm tall: a flat lid with LED light pipes and a flush flexure power button, and a base that clamps the battery and motor under the board. Both parts print without supports and are also designed to be mouldable. enclosure.py generates the STL files in Enclosure/stl/ from the board file and checks the fit; view.py is an interactive section viewer. See Enclosure/README.md.

Firmware

The firmware is split along one rule: the application logic (App/) decides, the drivers (Bsp/) act.

  • App/: the state machine, ISO14443-A protocol, card presence tracking, button debouncing, flash log and device config, lecture sessions, the SETTINGS.CSV parser, the FAT12 volume, CSV and status files, and battery maths. It includes no HAL or register headers and compiles on a PC.
  • Bsp/: implements the hardware contract in App/Inc/platform_if.h, handing up only raw values. It includes the register-level ST25R3916 driver (bsp_nfc.c).
  • Tests/: builds all of App/ against a RAM-backed stub platform with a simulated card and a simulated PC editing the drive, so the logic is tested without hardware.

The main loop handles events, then sleeps until the next deadline: in Stop 2 when idle, woken by LPTIM1, the button, VBUS or the reader's card wake-up. Firmware/docs/ARCHITECTURE.md describes the whole design: the flash layout, record, CSV and settings formats, sessions, the USB volume, power, and known limitations.

For debugging, dbg_* globals defined in Core/Src/main.c show the battery voltage, the last card, button presses, reader status and record counts in STM32CubeIDE's Live Expressions view.

Build and test

Run these from Firmware/:

sh
make test    # host tests for the application logic; needs only a native C compiler
make         # cross-compiles build/card-attendance.{elf,hex,bin}
make clean
  • Toolchain: make uses the GCC bundled with STM32CubeIDE (/opt/st/stm32cubeide_*) when one is installed, and otherwise arm-none-eabi-gcc on PATH.
  • Flashing and debugging: use STM32CubeIDE over the SWD header.
  • Optional: Tests/fs_check.sh checks the USB volume with real FAT tools (needs mtools and dosfstools).

Data on the device

  • Flash layout: the firmware takes the first 72 kB of the 128 kB flash; the last 56 kB (from 0x08012000) is reserved for data by the linker script.
    • Its first page: configuration (device ID).
    • The other 27 pages: the attendance log, 6,858 records.
  • Records: each record is 8 bytes (card number and seconds since 2000-01-01), exactly one flash double-word. Lecture markers are records with reserved IDs from 0xFFFFFF00 up.
  • Setting up a device: nothing is needed for it to log. The clock starts from the firmware's build time until it is set with #TIME in SETTINGS.CSV (the companion app does this when you start a lecture, or with Set device time).

Companion app

Companion/ is a desktop app for the PC the device is plugged into. It runs entirely on that computer, with no internet. It finds the device, reads its taps into a local SQLite database, keeps student names and cards (register a card by tapping it on the plugged-in device), starts lectures, shows the device's battery, and saves attendance lists as CSV or PDF.

Installers

PlatformGet itBuild it yourself
WindowsCompanion/dist/AttendanceLogger-Setup-1.0.0.exe (see above)Companion\packaging\build_windows.bat on Windows (Python 3 and Inno Setup 6), or sh Companion/packaging/build_windows_docker.sh from Linux (Docker)
Linuxbuild it, or download from GitHub Actionssh Companion/packaging/build_linux.sh: a .deb (sudo apt install ./attendance-logger_*.deb) and a portable .tar.gz

GitHub Actions (.github/workflows/companion-installers.yml) builds both whenever Companion/ changes; the files are under the run's Artifacts on the Actions tab. Pushing a tag such as companion-v1.2.0 builds that version and attaches the installers to a GitHub release. Builds land in Companion/dist/; only the Windows .exe is committed.

Running from source

Needs Python 3.8 or newer. From Companion/:

sh
python -m venv .venv
.venv/bin/pip install -r requirements.txt     # Windows: .venv\Scripts\pip install -r requirements.txt
sh start.sh                                   # Windows: start.bat
python attendance_qt.py --demo                # made-up data, no device needed

Repository layout

text
Firmware/            STM32CubeIDE project + standalone Makefile
  App/               application logic (portable, host-tested)
  Bsp/               board support: HAL drivers, ST25R3916 driver, USB MSC glue
  Core/              CubeMX-generated startup code (edit only inside USER CODE blocks)
  Drivers/           ST HAL and CMSIS
  Middlewares/       ST USB Device Library (core + MSC)
  Tests/             host test harness and tools
  docs/              ARCHITECTURE.md (design), USER_GUIDE.md (for users)
  Card Attendance System.ioc   CubeMX pin and peripheral configuration
Companion/           PC app (Python, Qt): window, database, reports
  dist/              Windows installer (AttendanceLogger-Setup-<version>.exe)
  packaging/         PyInstaller spec, Inno Setup script, installer build scripts
PCB/                 KiCad 10 project, BOMs (bom/) and JLCPCB production files (production/)
Enclosure/           3D-printable enclosure (enclosure.py, STL files in stl/)
LICENSE              MIT

Tools

  • PCB: KiCad 10.0.
  • Firmware: STM32CubeIDE 1.19 (CubeMX 6.15, STM32Cube FW_L4 V1.18.2), or arm-none-eabi-gcc with make.
  • Host tests: any C11 compiler (cc).
  • Companion app: Python 3.8+ with PySide6 (Qt), or none with the installer.
  • Enclosure: Python with manifold3d (and pyvista for the viewer).

Known issues

  • External footprint library. Some footprints come from a SnapEDA library at an absolute path outside the repository, so a fresh clone can't resolve them until the library is added or the paths are updated.

License

MIT. See LICENSE.

Parts

93
QtyValueFootprintReferences
12100nCapacitor_SMD:C_0805_2012MetricC3, C5, C6, C7, C18, C27, C28, C29, C30, C33, C34, C35
510kResistor_SMD:R_0805_2012MetricR11, R12, R13, R16, R17
5470RResistor_SMD:R_0805_2012MetricR3, R4, R5, R14, R15
4150pCapacitor_SMD:C_0805_2012MetricC14, C15, C19, C20
42.2uCapacitor_SMD:C_0805_2012MetricC31, C32, C36, C37
310uCapacitor_SMD:C_0805_2012MetricC2, C25, C26
34.7MResistor_SMD:R_0805_2012MetricR7, R9, R10
3GREENLED_SMD:LED_0805_2012MetricD1, D2, D6
20Resistor_SMD:R_0805_2012MetricR19, R20
210pCapacitor_SMD:C_0805_2012MetricC16, C17
215pCapacitor_SMD:C_0805_2012MetricC12, C13
21uCapacitor_SMD:C_0805_2012MetricC9, C38
2270pCapacitor_SMD:C_0805_2012MetricC23, C24
24.7uCapacitor_SMD:C_0805_2012MetricC1, C4
2470nHInductor_SMD:L_0805_2012Metric_Pad1.05x1.20mm_HandSolderL1, L2
25.1kResistor_SMD:R_0805_2012MetricR1, R2
2600R@100MHzInductor_SMD:L_0402_1005MetricFB1, FB2
268pCapacitor_SMD:C_0805_2012MetricC21, C22
28.2pCapacitor_SMD:C_0805_2012MetricC10, C11
2REDLED_SMD:LED_0805_2012MetricD3, D5
11.5kResistor_SMD:R_0805_2012MetricR18
110k NTCResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P1.90mm_VerticalTH1
110nCapacitor_SMD:C_0805_2012MetricC8
11kResistor_SMD:R_0805_2012MetricR6
12.7MResistor_SMD:R_0805_2012MetricR8
127.12MHzCrystal:Crystal_SMD_3225-4Pin_3.2x2.5mm_HandSolderingY2
132.768kCrystal:Crystal_SMD_EuroQuartz_EQ161-2Pin_3.2x1.5mmY1
1AO3400APackage_TO_SOT_SMD:SOT-23Q1
1Antenna_LoopSnapeda:NFC_Loop_40x30_3TAE1
1BATTERYConnector_JST:JST_XA_B02B-XASK-1_1x02_P2.50mm_VerticalJ2
1BOOT0Button_Switch_SMD:SW_Tactile_SPST_NO_Straight_CK_PTS636Sx25SMTRLFSSW2
1CSIConnector_Wire:SolderWirePad_1x01_SMD_1x2mmJ7
1CSOConnector_Wire:SolderWirePad_1x01_SMD_1x2mmJ6
1LOGOExternal:wxG***
1MCP73833-xxx-UNPackage_SO:MSOP-10_3x3mm_P0.5mmU2
1PN532Connector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_VerticalJ3
1POWERButton_Switch_SMD:SW_Tactile_SPST_NO_Straight_CK_PTS636Sx25SMTRLFSSW3
1RSTButton_Switch_SMD:SW_Tactile_SPST_NO_Straight_CK_PTS636Sx25SMTRLFSSW1
1SS14Diode_SMD:D_SMAD4
1ST25R3916-AQWTExternal:QFN50P500X500X100-33NU5
1STM32L432KBUxPackage_DFN_QFN:QFN-32-1EP_5x5mm_P0.5mm_EP3.45x3.45mmU4
1SWDConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ5
1TPS7A0233PDBVRExternal:SOT23_DBV_TEX-LU3
1USB-CConnector_USB:USB_C_Receptacle_GCT_USB4110J1
1USBLC6-2SC6Package_TO_SOT_SMD:SOT-23-6U1
1VIB_MOTORConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ4

The 89 most common of 93 parts.

Similar boards

  • 2 layers95 × 147.3 mmBadge, the printed circuit board in 3D

    Badge

    hackthenorth/badge-hardware

    KiCAD Files for the 2026 Hacker Badge

    124 parts4
  • 2 layers173.2 × 54 mmMicrocard, the printed circuit board in 3D

    Microcard

    Volkov997/pen-card

    RF Pentesting tool, but small enough for your wallet. Features: Wifi & Bluetooth, NFC, IR, (Sub Ghz, Planned)

    138 parts5GPL-2.0
  • 2 layers40 × 70 mmKikard, the printed circuit board in 3D

    Kikard

    m5kro/KiKard-old

    Non working project

    80 parts1
  • 2 layers43.4 × 63 mmTapper, the printed circuit board in 3D

    Tapper

    rabinniroula/tapper-hw

    KiCad Design Files for Tapper: A hardware tool for LF and HF RFID read, emulation and much more...

    106 parts
  • 2 layers75.7 × 53.7 mmTSSI v2.1, the printed circuit board in 3D

    TSSI v2.1

    SDM-EV/EV-PCB-Dev

    49 parts3
  • 2 layers96 × 50 mmPager, the printed circuit board in 3D

    Pager

    justinlindh/bramble

    Privacy-first LoRa mesh networking for ESP32-S3, built with ESP-IDF

    97 parts2MIT
  • 2 layers76 × 61 mmGemilaimate compact, the printed circuit board in 3D

    Gemilaimate compact

    rico-x/GemilaiMate

    Gemilai 3007Z DIY carrier and standalone firmware. Prototype: hardware not assembled or tested.

    110 parts2

Questions

How big is the Attendance management system PCB?

It measures 60 × 88.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Attendance management system use?

93 parts, built around the ST25R3916-AQWT, USBLC6-2SC6, X32252712MMB4SI and AO3400A. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Attendance management system KiCad files?

From the rajinthanr/attendance-management-system repository on GitHub, at the commit this page was made from: the board is PCB/Attendance Management System.kicad_pcb and its schematic PCB/Attendance Management System.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Attendance management system design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).