← Crafts
Charge preview

Charge

Embedded research Solo engineer

Piso WiFi coin-slot controller firmware — hardware-independent timing logic that validates pulses, accumulates paid time, and drives relay state.

Problem

Coin-operated Wi-Fi hotspots need dependable timing logic that survives power glitches and noisy coin acceptors. Charge implements a testable controller module that owns pulse validation, countdown, NVM recovery, and relay decisions while delegating GPIO to a thin hardware layer.

What it covers

  • 1 ms tick contract for paid-time countdown accuracy
  • Coin pulse debounce and consecutive invalid sequence tracking
  • Two-copy NVM configuration recovery
  • Display update scheduling decoupled from relay decisions
Coin acceptor Pulse ISR Debounce + validate Paid time ledger 1ms tick loop Relay driver Display scheduler
Coin to relay timing
/*
  pc_tick_1ms() must be called once per millisecond.

  Owned by this module:
  - coin pulse validation
  - paid-time accumulation
  - countdown timing
  - relay state decision
  - configuration validation
  - two-copy NVM recovery
*/
Charge Piso WiFi controller placeholder
Hardware photo placeholder — swap for the coin acceptor and timer display.