Plan: ride through cranking, shut down at ignition off

UPS input comes from the ignition-switched socket via a 15 V PD
trigger, so input loss means cranking or ignition off. The INA219
(monitor-only) gives the battery current sign; a host service would mark
cranks, then after a grace period close the recording and power off,
with a voltage floor as backstop. Records the open hardware problem:
after poweroff the UPS keeps the board powered, so it drains and
doesn't auto-start at ignition on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mikkeli
2026-10-09 17:10:51 +09:00
parent 0b3783dac0
commit fe284ce540
2 changed files with 54 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
---
type: plan
status: active
updated: 2026-10-09
---
# Car Power: Ride Through Cranking, Shut Down at Ignition Off
## Power chain
```
cigarette socket (ignition-switched, 65 W class, crank-sensitive)
→ USB-C PD charger → 15 V PD trigger (15 V / 3 A) → DC jack
→ Waveshare UPS Power Module (C), 3S 21700, 15–19 V in, pass-through
→ Orin Nano carrier
```
Socket power is ignition-switched, so **UPS input loss = ignition off or cranking**. The UPS rides through cranking
(bench: ≥ 20 s holdover across a supply swap). See [BOM](../../BOM.md#waveshare-ups-power-module-c).
## Detection
INA219 on I²C bus 7, `0x41`, monitor-only (the UPS has no control lines). Battery current from the shunt-voltage register (0x01, 10 µV/LSB):
about 0 or positive (charging) with input present, **clearly negative** (discharging) when input is lost. Battery voltage (0x02) is the backstop.
To confirm on the bench: the sign convention and the discharge magnitude at the Orin's real load (pull the UPS input and read).
## Policy (to build)
A small host service polling the INA219 about every 1 s:
| State | Condition | Action |
|---|---|---|
| on input | current ≥ about 0 | nothing |
| on battery | discharging, < grace | publish `system/power` "on battery"; **a short episode that recovers is a crank**: stamp it into the recording |
| ignition off | discharging continuously for grace (start at 60 s; tune after the car crank test) | publish "shutting down" → stop capture (close the session cleanly) → optional parked-at-home step → `systemctl poweroff` |
| battery low | voltage below a floor (around 10.5 V for 3S, to confirm), at any time | `systemctl poweroff` immediately |
Optional parked-at-home step: if home WiFi/LAN is reachable at ignition off, stay up long enough to copy recordings off over the LAN
(same LAN-only rule as map sync, project-yukart decision 10), within a hard time cap, then shut down.
## Open: getting the Orin back on at ignition on
After `poweroff` the UPS keeps supplying the board from its battery:
1. **Standby drain:** the halted Orin still draws some power, so the pack drains while parked, until the UPS's over-discharge protection cuts out.
2. **No auto-start:** the dev kit powers on when power *appears*. If the UPS output never dropped, ignition on doesn't boot the Orin.
Candidate fixes (hardware, to evaluate):
- Cut the UPS output after shutdown (a latching relay or a timer on the output), so the next ignition-on is a real power-up.
- Pulse the carrier's power-button header from a small circuit when socket power returns.
- Suspend (SC7) instead of poweroff, with wake on a GPIO tied to socket power. Untested on this board, and still drains.
Until this is solved, ignition-off shutdown leaves the car unit off until someone power-cycles it.