

Totper schematic, pcb design and firmware
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 5
- Nets
- 16
- Pads
- 28
- Tracks, vias
- 27, 0
- Routed
- Yes
- KiCad
- KiCad 9.0 (file 20241229)
- Created
- 28 Mar 2026
- Updated
- 28 Mar 2026
Overview
Totp is an open-source printed circuit board by Filippo-Carta, from the Filippo-Carta/Totper-Device repository on GitHub. It is a 2-layer board with 5 parts on 16 nets, routed with 27 tracks and 0 vias.
Its parts include 3 connectors and 2 switches.
README
README.mdESP32 TOTP Firmware
TOTP (Time-based One-Time Password) generator running on an ESP32-C3, controlled via USB serial from the companion Android app. No WiFi, no cloud, no internet connection required at any point.
Overview
TOTP secrets are stored exclusively on the physical ESP32 device in non-volatile storage (NVS). The device has no network interface — time is supplied by the Android app over USB serial each time it connects. Once synced, the ESP32 tracks elapsed time internally using its own clock, so codes remain valid for the entire session.
Access to the device is protected by a 5-digit PIN entered via two physical buttons. After 5 failed attempts, all stored accounts are permanently wiped and the device reboots.
Hardware
All of the necessary schematic are available in the /schematic/ folder in the repository. You can print the pcb by exporting the files and sending them to a pcb manufacturer.
| Component | Details |
|---|---|
| Microcontroller | ESP32-C3 |
| Display | SSD1306 OLED, 128x32, I2C |
| Button 1 (Cycle) | GPIO 5 — cycles digits / switches account |
| Button 2 (Confirm) | GPIO 6 — confirms digit / advances to next |
| I2C SDA | GPIO 4 |
| I2C SCL | GPIO 3 |
Dependencies
Install these libraries via the Arduino Library Manager or PlatformIO:
- Adafruit SSD1306
- Adafruit GFX Library
Preferences— built into the ESP32 Arduino corembedtls/md.h— built into the ESP32 Arduino core
Security Warning
This firmware stores TOTP secrets in ESP32 NVS flash in plaintext. NVS is not encrypted by default.
This means that anyone with physical access to the device and a USB connection can dump the entire flash contents using standard tools and read every stored secret directly — regardless of the PIN. The PIN only protects the serial interface. It does not protect the flash memory itself.
If you do not enable flash encryption, physical possession of the device is equivalent to full access to all your TOTP secrets.
Without flash encryption this device should be treated as a convenience tool only, not as a secure hardware token. With flash encryption enabled, physical attacks become significantly harder.
Serial Protocol
Communication runs at 115200 baud, 8N1 over USB CDC. All commands are newline-terminated (\n).
| Command | Response | Auth required |
|---|---|---|
TIME <unix> | OK:time_set:<unix> | No |
STATUS | OK:ready:<n> | Yes |
LIST | JSON array [{index, name}, ...] | Yes |
ADD <n> <base32> | OK:added:<idx>:<n> | Yes |
REMOVE <idx> | OK:removed:<idx>:<n> | Yes |
CLEAR | OK:cleared | No |
Any command requiring auth while the device is locked returns ERR:locked.
TIME and CLEAR are always permitted regardless of lock state. CLEAR wipes all accounts and reboots the device.
Constraints
- Account name: maximum 12 characters
- Base32 secret: minimum 8 characters, uppercase, standard Base32 alphabet
PIN System
The PIN is 5 digits, entered using the two physical buttons:
- Cycle button — increments the current digit (0-9, wraps around)
- Confirm button — confirms the digit and advances to the next position
On first boot, the device enters a PIN setup flow before doing anything else. The PIN is stored in NVS alongside the accounts.
To change the PIN, hold the Confirm button while powering on the device. The change flow requires the current PIN before setting a new one.
After 5 consecutive wrong PIN attempts, all data is wiped via nvsClearAll() and the device restarts.
Time Sync
The device has no RTC and no network access. On every USB connection, the Android app sends:
TIME <unix_seconds>The firmware records the Unix timestamp and the value of millis() at that moment. From then on, the current time is calculated as:
currentTime = baseUnix + (millis() - baseMillis) / 1000Until a TIME command is received, the display shows "Waiting for time sync" and no TOTP codes are generated.
TOTP Implementation
The firmware implements RFC 6238 using HMAC-SHA1 from the mbedTLS library (bundled with the ESP32 Arduino core). The time step is 30 seconds and codes are 6 digits.
counter = currentTime / 30
TOTP = HOTP(secret, counter)NVS Storage Layout
All data is stored under the totp namespace in NVS flash.
| Key | Type | Description |
|---|---|---|
pin | String | 5-digit PIN |
count | Int | Number of stored accounts |
name_N | String | Account name at index N |
sec_N | String | Base32 secret at index N |
fail_cnt | Int | Consecutive failed PIN attempts |
Companion App
The Android app that communicates with this firmware is available at:
https://github.com/filippo-carta/Totper
License
Copyright Filippo Carta — CC BY-NC-ND 4.0
Free to use and share with attribution. Modification and commercial use are not permitted.
HAVE FUN!
Parts
5| Qty | Value | Footprint | References |
|---|---|---|---|
| 2 | Conn_01x08_Pin | Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_Vertical | J2, J3 |
| 2 | SW_Push_Dual | Button_Switch_THT:SW_PUSH_6mm | SW1, SW2 |
| 1 | Conn_01x04_Pin | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J1 |
Similar boards
- 2 layers98 × 27 mm

- 2 layers21 × 33 mm

24g2usb pico2w
joypad-ai/joypad-os
Universal controller firmware for building adapters, dongles, and custom controllers.
5 parts1.7kApache-2.0 - 2 layers53.2 × 59.6 mm

A10 OLinuXino Lime Rev B SHIELD TEMPLATE
OLIMEX/OLINUXINO
OLINUXINO is Open Source / Open Hardware, low cost from EUR 24 Linux Industrial grade Single Board Computer capable to operate -25+85C
5 parts1.5k - 2 layers30 × 11 mm

Main control board servo tester
jamro/tiny-engineer
A small desktop robot that brings an AI coding assistant to life, physically acting out when it reads files, thinks, writes code, and finishes work.
5 parts1.1k - 2 layers78.8 × 35.3 mm

KiCadTest
hackclub/OnBoard
💡 Join 1,000 teenagers and make your first PCB with a $100 grant!
5 parts915 - 2 layers50 × 23 mm

- 2 layers43.2 × 28.5 mm

- 2 layers20.3 × 15.2 mm

L0 light sensor
Luos-io/luos_engine
Open-source and real-time orchestrator for cyber-physical-systems, to easily design, test and deploy embedded applications and digital twins.
5 parts546MIT
Questions
What parts does the Totp use?
5 parts. 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 Totp KiCad files?
From the Filippo-Carta/Totper-Device repository on GitHub, at the commit this page was made from: the board is schematic/totp.kicad_pcb and its schematic schematic/totp.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Totp design in my own project?
Its repository states no licence, so its author keeps all rights: ask Filippo-Carta before reusing the design.