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.

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.
MoodLogger v1 is an open-source printed circuit board by sullyjason, from the sullyjason/MoodLogger repository on GitHub. It is a 2-layer board of 30 × 30 mm with 48 parts on 78 nets, routed with 6 tracks and 0 vias.
It is built around the ATSAMD21G18A-AU, W25Q32JVSSIQ and AP2112K-3.3TRG1, with the MCP73831T-2ACI/OT-HXY, RV-3028-C7 and DMG3415U among its other parts. Its parts include 20 resistors, 12 capacitors, 5 ICs, 5 switches and 2 connectors. It belongs with the SAM D and SAM boards of this library.
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.
timestamp, button to a CSV fileTwo 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).
EmotionTracker_DS32/)Board silkscreen: EmotionLog v0 8.2025
![]()
EmotionTracker_PCF8523/)Dummy device/ contains a mechanical dummy PCB of the same outline for enclosure fitting![]()
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.
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.
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.
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.
Both were considered — the deciding factor was PCB simplicity for a first custom board that may be partly hand-assembled:
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.
| Block | Part | Notes |
|---|---|---|
| MCU | ATSAMD21G18A (TQFP-48) | 256 KB flash / 32 KB RAM, native USB, crystal-less USB via clock recovery |
| RTC | RV-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 storage | W25Q32JVSSIM (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 protection | BQ29700DSER | Over-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 LDO | AP2112K-3.3 | Sits 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 |
| Charger | MCP73831-class | Charge current set by R_prog for the chosen small cell |
| Latch + button OR | P-FET high-side switch + Schottky diode-OR | Clone the Picoclick C3T latch topology (in the submodule) |
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.
timestamp,button to CSV (FatFs on NOR flash) → release latch.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.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.
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.| Path | Contents |
|---|---|
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 |
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.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 6 | 1uF | Capacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolder | C1, C10, C15, C16, C17, C18 |
| 4 | 1k | PCM_Resistor_SMD_AKL:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R10, R11, R20, R21 |
| 4 | SW_MEC_5E | PCM_SparkFun-Switch:Push_SMD_5.2x5.2mm_h2.5mm | SW2, SW3, SW5, SW6 |
| 3 | 100kΩ | PCM_Resistor_SMD_AKL:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R16, R17, R18 |
| 3 | 10k | PCM_Resistor_SMD_AKL:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R9, R12, R19 |
| 3 | 10kΩ | PCM_Resistor_SMD_AKL:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R6, R22, R23 |
| 2 | 10uF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C19, C20 |
| 2 | 22pF | Capacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolder | C22, C23 |
| 2 | 5.1k | PCM_Resistor_SMD_AKL:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R1, R2 |
| 1 | 100kΩ | PCM_JLCPCB:R_0402 | R13 |
| 1 | 100nF | Capacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolder | C6 |
| 1 | 100Ω | PCM_Resistor_SMD_AKL:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R7 |
| 1 | 10K\ | PCM_Resistor_SMD_AKL:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R15 |
| 1 | 10k | Resistor_SMD:R_0603_1608Metric | R3 |
| 1 | 10µF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C21 |
| 1 | 1K | PCM_Resistor_SMD_AKL:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R14 |
| 1 | 32.768kHz | PCM_SparkFun-Clock:Crystal_SMD_3.2x1.5mm | Y1 |
| 1 | AP2112K-3.3TRG1 | PCM_Package_TO_SOT_SMD_AKL:SOT-23-5 | U5 |
| 1 | ATSAMD21G18A-A | Package_QFP:TQFP-48_7x7mm_P0.5mm | U1 |
| 1 | DMG3415U | PCM_Package_TO_SOT_SMD_AKL:SOT-23 | Q1 |
| 1 | JST_2mm_LiPo | PCM_SparkFun-Connector:JST_1x02_P2.0mm_Horizontal_SMD | J3 |
| 1 | MBR120 | Diode_SMD:D_SOD-123 | D2 |
| 1 | MCP73831T-2ACI/OT | Package_TO_SOT_SMD:SOT-23-5 | U6 |
| 1 | ORANGE | LED_SMD:LED_0402_1005Metric_Pad0.77x0.64mm_HandSolder | CHG2 |
| 1 | RV-3028-C7 | Package_SON:MicroCrystal_C7_SON-8_1.5x3.2mm_P0.9mm | U2 |
| 1 | Slide_Switch_SPDT | Button Switch SMD:SW_SPDT_PCM12 | SW4 |
| 1 | USB_C_Receptacle | PCM_SparkFun-Connector:USB-C_16 | J2 |
| 1 | W25Q32JVSS | Package_SO:SOIC-8_5.3x5.3mm_P1.27mm | U7 |
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.
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.
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.



ryanfobel/Feather-M4-Express-clone.kicad
KiCad clone of Adafruit's Feather M4 Express PCB design files

oomlout/oomlout_oomp_project_bot_v_2

maholli/SAM32
Feather-sized SAMD51 with M4 core serving as UART bridge to WROOM ESP32

joeycastillo/The-Open-Book
For details on how to build, test and use Open Book, I've made documentation available here.

jpconstantineau/NRF52-Board
This Repository is a collection of NRF5x boards.

It measures 30 × 30 mm and has 2 copper layers, 1.6 mm thick.
48 parts, built around the ATSAMD21G18A-AU, W25Q32JVSSIQ, AP2112K-3.3TRG1 and MCP73831T-2ACI/OT-HXY. 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.
From the sullyjason/MoodLogger repository on GitHub, at the commit this page was made from: the board is MoodLogger_v1/MoodLogger_v1.kicad_pcb and its schematic EmotionTracker_DS32/EmotionTracker_DS32.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask sullyjason before reusing the design.