Skip to the content
2 layers32.9 × 33.4 mmEmotionTracker, the printed circuit board in 3D

EmotionTracker

sullyjason/MoodLogger

A tiny, battery-powered button logger. Press one of (at least) four buttons and the device wakes up, appends which button was pressed at what time to a CSV file, and goes back to sleep.

Size
32.9 × 33.4 mm
Copper layers
2
Thickness
1.6 mm
Parts
30
Nets
33
Pads
101
Tracks, vias
183, 28
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
7 Jul 2026
Updated
16 Jul 2026

Overview

EmotionTracker is an open-source printed circuit board by sullyjason, from the sullyjason/MoodLogger repository on GitHub. It is a 2-layer board of 32.9 × 33.4 mm with 30 parts on 33 nets, routed with 183 tracks and 28 vias.

It is built around the PCF8523T. Its parts include 12 resistors, 6 switches, 5 capacitors, 2 ICs and 1 diode. It belongs with the SAM D and SAM boards of this library.

Main components

1

README

README.md

MoodLogger

Attribution note: This README (state documentation, roadmap) and the Proposed v1 architecture section were drafted by Claude (Fable 5) on 2026-07-07 and updated as the design converged (part selection finalized 2026-07-10 with Claude (Opus 4.8)), based on the KiCad files in this repo, the project motivation, and the Picoclick-C3 reference project. Sections contributed by Claude are marked with 🤖. Hardware design decisions, part orders, prototypes, and project direction by Silvan Roth.

A tiny, battery-powered button logger. Press one of (at least) four buttons and the device wakes up, appends which button was pressed at what time to a CSV file, and goes back to sleep. To get the data, you plug the device into any USB host (cable or docking station) and it shows up as an ordinary USB flash drive — no companion app, no driver, no cloud. Grab the CSV, done.

Design goals

  • ≥ 4 buttons, each press logged as timestamp, button to a CSV file
  • Wake on button press, sleep otherwise — the device spends almost all of its life asleep
  • Battery life measured in months: recharging should rarely, ideally almost never, be necessary
  • Host-agnostic data access: the device enumerates as USB mass storage (a flash drive), so any OS can read the CSV without extra software
  • Accurate timestamps from a dedicated RTC that keeps time even while the MCU sleeps

Current state

Two prototype PCB revisions exist, both built around a Seeed Studio XIAO ESP32-S3 module. They differ only in the RTC chip. Both are functional as prototypes but share one critical flaw (see Known problems).

Common to both boards

  • MCU: XIAO ESP32-S3 (U1) — provides USB-C, LiPo charging, and deep sleep
  • 4 tactile buttons (SW1–SW4, C&K PTS125) on XIAO pins D0–D3, each with a 10 k pull-up and 1 k series resistor, used as wake-up sources
  • I²C RTC on D4/D5 (SDA/SCL)
  • CR1216 coin cell (BT1) as RTC backup so time survives even when the main battery is empty
  • SPDT slide switch (SW5) in the battery line as a hard power switch
  • Main power from a LiPo cell on the XIAO's battery pads

Version A — DS3231 (EmotionTracker_DS32/)

Board silkscreen: EmotionLog v0 8.2025

  • DS3231M (U2, SOIC-16): temperature-compensated RTC with internal oscillator — very accurate, no external crystal needed, but comparatively power-hungry

DS3231 version — layout and 3D render

Version B — PCF8523 (EmotionTracker_PCF8523/)

  • PCF8523T (U3, SOIC-8) with an external 32.768 kHz crystal (Y1) — much lower current draw than the DS3231, at the cost of needing the crystal and being less accurate over temperature
  • Adds a status LED (D1), an extra small push button (SW6), and BATin/BATout solder pads in the battery path for measuring battery current / inserting protection circuitry
  • Dummy device/ contains a mechanical dummy PCB of the same outline for enclosure fitting

PCF8523 version — layout and 3D render

Firmware (Firmware/)

Only a bring-up sketch exists so far: Mood_track_v0/Mood_track_v0.ino is a WS2812B/FastLED color-cycle test. The actual logging firmware (RTC, deep sleep, CSV writing, USB mass storage) has not been written yet.

Known problems

No battery over-discharge protection. The XIAO ESP32-S3 has a charging circuit but no discharge cutoff, so when the device sits unused, the quiescent draw slowly pulls an unprotected LiPo below its safe minimum voltage and permanently damages it. This has already killed one battery. Nothing on either PCB revision protects against this.

The XIAO is oversized for the job. A full ESP32-S3 module with WiFi/BLE is overkill for "log a timestamp and sleep", and its deep-sleep and regulator overhead works against the battery-life goal.

Roadmap

  1. Software safety first (works on existing boards): monitor battery voltage from firmware and put the device into its lowest-power shutdown state below a cutoff threshold (with hysteresis so it doesn't oscillate near the limit). On the PCF8523 board the BATin/BATout pads can be used to hook up voltage sensing. This only mitigates the problem — even in deepest sleep the board still draws a few µA, so a fully drained device left on the shelf long enough can still damage the cell.
  2. Hardware protection: add a proper battery protection IC (over-discharge cutoff) to the next board revision, or use protected cells in the meantime.
  3. Custom v1 design: move away from the XIAO to a leaner MCU (the ATSAMD21G18) with a Picoclick-style soft power latch and native USB mass-storage, designed from the start around the goals above — see Proposed v1 architecture below. Parts are ordered.

Proposed v1 architecture 🤖

Section author: Claude (Fable 5, refined with Opus 4.8), 2026-07-07 / 2026-07-10. Based on the boards above and the Picoclick-C3 reference project (fork in Reference Projects/). Parts are selected and ordered but not yet built or bench-verified — treat as a design proposal, not a validated design.

Proposed v1 block diagram

Core idea: soft power latch instead of deep sleep

The key technique to adopt from the Picoclick is its soft-latching power circuit: between presses the MCU is not asleep, it is completely unpowered. A button press physically connects the battery to the regulator; the firmware's first act is to hold that connection via a latch GPIO, it logs the event, then releases the latch and the device switches itself off. The Picoclick C3 reaches < 200 nA idle this way — roughly three orders of magnitude below the XIAO's deep sleep — and it doubles as the discharge-protection strategy: a device that draws almost nothing cannot slowly kill its LiPo. A dedicated protection IC remains as the hard backstop.

Why the ATSAMD21G18 (not the RP2040)

Both were considered — the deciding factor was PCB simplicity for a first custom board that may be partly hand-assembled:

  • Leaded package: the SAMD21 is a TQFP-48 (0.5 mm, gullwing leads) — hand-solderable and inspectable. The RP2040 is a QFN-56 (0.4 mm, leadless + thermal pad) that effectively needs stencil + hot-air.
  • Fewer mandatory parts: the SAMD21 has 256 KB internal flash and does crystal-less USB (clock recovery off the USB frame), so it needs no boot-flash and no crystal. The RP2040 has no internal flash (external QSPI flash is mandatory just to boot) and needs a 12 MHz crystal.
  • Native USB either way: both enumerate cleanly as USB mass storage. (The Picoclick's own ESP32-C3 does not — its USB is a fixed Serial/JTAG peripheral — which is why its MCU was not reused.)

The RP2040 remains a reasonable alternative (faster boot for the latch, larger storage headroom); it just makes the board harder. The nRF52840 is the single-chip option if avoiding external flash matters more than assembly ease.

Chosen parts (ordered)

BlockPartNotes
MCUATSAMD21G18A (TQFP-48)256 KB flash / 32 KB RAM, native USB, crystal-less USB via clock recovery
RTCRV-3028-C7~45 nA, internal crystal, ±1 ppm; runs on the always-on rail so time survives with the MCU off. (DS3231M / PCF8523 are the higher-draw fallbacks proven on the existing boards)
Data storageW25Q32JVSSIM (SOIC-8, 4 MB)External SPI NOR for the FAT/CSV volume. Chosen over internal-flash-only for write endurance (~100 k vs ~25 k erase cycles) — each logged press is one FAT-metadata write, so endurance, not capacity, is the limit
Battery protectionBQ29700DSEROver-discharge / over-current cutoff — the hard backstop for the failure that killed the prototype battery. Controller only: needs an external dual N-channel MOSFET (e.g. FS8205) in the cell's ground path
3.3 V LDOAP2112K-3.3Sits after the latch, so its ~55 µA quiescent is irrelevant (only powered when the device is awake). Regulates the 3.0–4.2 V cell down to a SAMD21-safe 3.3 V
ChargerMCP73831-classCharge current set by R_prog for the chosen small cell
Latch + button ORP-FET high-side switch + Schottky diode-ORClone the Picoclick C3T latch topology (in the submodule)

Buttons, wake, and logging flow

Each of the four buttons does double duty: all are diode-ORed (Schottky) into the latch enable, so any press powers the board, and each also drives its own sense GPIO with a small RC hold so firmware can still read which button fired after boot. USB VBUS feeds the same latch OR, so plugging into any host wakes the device.

  • Log event: boot → grab latch → read RTC over I²C → append timestamp,button to CSV (FatFs on NOR flash) → release latch.
  • USB attached: enumerate as USB MSC exposing the FAT volume; pause logging while mounted.
  • Setting the clock without an app: the firmware reads the modification timestamp of a marker file (e.g. the user saves an empty settime.txt to the drive) — FAT directory entries carry the host's local time, so any OS can set the RTC just by writing a file. Set-on-flash as baseline.

Power budget (estimate)

A log event costs roughly 1 µAh (~30 mA for ~100 ms); 20 presses/day is ~0.5 mAh/month. Standby is dominated by the latch leakage plus the protection IC's quiescent draw (sub-µA). Even a 100 mAh cell lasts multiple years and is realistically limited by self-discharge — with the protection IC cutting the cell off safely at the end instead of destroying it.

Key design notes (SAMD21)

Captured so the board doesn't have to relearn them:

  • VDDCORE is a regulator output — decouple it to ground with 1 µF and connect nothing else. Tying it to 3.3 V is the classic dead-SAMD21 mistake.
  • No crystals. Crystal-less USB (enable USBCRM in firmware) plus the external RV-3028 for timekeeping means neither a 12 MHz nor a 32.768 kHz crystal is needed.
  • Power the RV-3028 from the raw/always-on rail (ahead of the latch) so it keeps time while the MCU is off; put the I²C pull-ups on the switched 3.3 V so they don't leak from the battery in standby.
  • BQ29700 needs external FETs. It's a protection controller — pair it with a dual N-channel MOSFET in the cell's ground path; it does not switch current on its own.
  • AP2112K goes after the latch, where its ~55 µA quiescent is a non-issue. Never put it on the always-on rail.
  • The latch is the only non-textbook subcircuit — clone the Picoclick C3T topology from the submodule rather than inventing one, and give it enough RC hold to survive the SAMD21 boot time before firmware grabs the latch GPIO.
  • Fixed USB/SWD pins: USB D−/D+ on PA24/PA25, SWD on PA30/PA31. I²C and SPI go on any valid SERCOM pads (confirm against the pinmux table).

Repository layout

PathContents
EmotionTracker_DS32/KiCad 8 project, DS3231 revision (production/ has JLCPCB gerbers, BOM, placement files)
EmotionTracker_PCF8523/KiCad 8 project, PCF8523 revision + mechanical dummy board (production/ as above)
Firmware/Mood_track_v0/Arduino bring-up sketch (LED test only, no logging yet)
Reference Projects/Picoclick-C3-Logger (git submodule, fork of makermoekoe/Picoclick-C3) — reference for the latch circuit and battery protection
docs/Architecture diagrams

History

The concept was first prototyped on a breadboard with a XIAO ESP32-S3 and a DS3231 RTC module. That prototype worked, but the lack of discharge protection destroyed the battery — which is what motivated the roadmap above.

Parts

30
QtyValueFootprintReferences
610kResistor_SMD:R_0603_1608MetricR1, R3, R5, R7, R9, R10
51kResistor_SMD:R_0603_1608MetricR2, R4, R6, R8, R11
41uFCapacitor_SMD:C_0603_1608MetricC1, C2, C3, C4
4SW_MEC_5EButton_Switch_SMD:SW_Push_1P1T_NO_CK_PTS125Sx43PSMTRSW1, SW2, SW3, SW4
2TestPointConnector_Wire:SolderWirePad_1x01_SMD_1x2mmBATin, BATout
110uFCapacitor_SMD:C_0805_2012MetricC5
1CR1216Battery:BatteryHolder_LINX_BAT-HLD-012-SMTBT1
1Crystal_32.768kHzCrystal:Crystal_SMD_Abracon_ABS25-4Pin_8.0x3.8mmY1
1LEDLED_SMD:LED_0603_1608MetricD1
1PCF8523TPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU3
1Push_ButtonButton_Switch_SMD:SW_SPST_B3U-3000P-BSW6
1RResistor_SMD:R_0603_1608MetricR12
1SW_SPDTButton_Switch_SMD:SW_SPDT_PCM12SW5
1SeeeduinoXIAOSeeed Xiao:Seeeduino XIAO-MOUDLE14P-2.54-21X17.8MMU1

More from sullyjason/MoodLogger

3
  • 2 layers30 × 30 mmMoodLogger v1, the printed circuit board in 3D

    MoodLogger v1

    sullyjason/MoodLogger

    A tiny, battery-powered button logger. Press one of (at least) four buttons and the device wakes up, appends which button was pressed at what time to a CSV file, and goes back to sleep.

    48 parts
  • 2 layers32.9 × 33.4 mmEmotionTracker DS32, the printed circuit board in 3D

    EmotionTracker DS32

    sullyjason/MoodLogger

    A tiny, battery-powered button logger. Press one of (at least) four buttons and the device wakes up, appends which button was pressed at what time to a CSV file, and goes back to sleep.

    27 parts
  • 2 layers20.3 × 22.9 mmDummy device, the printed circuit board in 3D

    Dummy device

    sullyjason/MoodLogger

    A tiny, battery-powered button logger. Press one of (at least) four buttons and the device wakes up, appends which button was pressed at what time to a CSV file, and goes back to sleep.

    4 parts

Similar boards

  • 2 layers19 × 106 mmPetRockMain1, the printed circuit board in 3D

    PetRockMain1

    jsenzel1/petrock

    Eurorack components and footprints for KiCad.

    117 parts48
  • 2 layers158 × 85 mmPiPLC Mainboard, the printed circuit board in 3D

    PiPLC Mainboard

    Chrismettal/PiPLC

    Glorified breakout board + DIN rail case for Pis

    154 parts19
  • 2 layers36 × 29.3 mmBle mvp 1b rev0, the printed circuit board in 3D

    Ble mvp 1b rev0

    saewoonam/ble_adv_covid

    Repo to implement the advertise and scanner portion for bluetooth to enable encounter/exposure tracing (e.g. Apple/Google / TCN / etc...) on a nRF52840 based battery powered dongle/device

    71 parts10
  • 2 layers115 × 100 mmCog1, the printed circuit board in 3D

    Cog1

    diegodemarco/cog1

    cog1 is an open-source industrial IoT gateway (hardware and software) built as a motherboard hosting an Orange Pi Zero 3 Linux SBC.

    133 parts6MIT
  • 2 layers104 × 43.3 mmSerial snooper, the printed circuit board in 3D

    Serial snooper

    can-caglar/Data-Logger-STM32

    The Serial Snooper is a UART data logger with automatic baud rate detection, real-time data stamping and a command-line-interface for configuration, running on an STM32F3 microcontroller.

    101 parts4
  • 2 layers49.5 × 106 mmSupra board, the printed circuit board in 3D

    Supra board

    jsenzel1/supra

    is multimode Eurorack module with 4 different experiments in long term time. you can run up to 2 modes at once. use the 4 way joystick and buttons to interact with the modes on the oled

    119 parts4
  • 2 layers48.3 × 123.8 mmAltimeter v2, the printed circuit board in 3D

    Altimeter v2

    pimbongaerts/altimeter

    Underwater sonar/USBL interface for photogrammetry surveys. PCB design files and Arduino code.

    74 parts4
  • 2 layersGenesis, the printed circuit board in 3D

    Genesis

    iffycodes/Genesis

    Genesis Board design

    98 parts2

Questions

How big is the EmotionTracker PCB?

It measures 32.9 × 33.4 mm and has 2 copper layers, 1.6 mm thick.

What parts does the EmotionTracker use?

30 parts, built around the PCF8523T. 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 EmotionTracker KiCad files?

From the sullyjason/MoodLogger repository on GitHub, at the commit this page was made from: the board is EmotionTracker_PCF8523/EmotionTracker.kicad_pcb and its schematic EmotionTracker_DS32/EmotionTracker_DS32.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the EmotionTracker design in my own project?

Its repository states no licence, so its author keeps all rights: ask sullyjason before reusing the design.