// WAVESHARE UPS HAT (E) — TECHNICAL SPECIFICATION //
| PARAMETER | VALUE | NOTES |
| Input voltage range | 5V – 20V | USB-C PD negotiates 9V/3A = 27W from car charger |
| Output to Pi | 5V / 6A (30W) | Regulated boost converter — stable even when cells are at 3.2V |
| Cell configuration | 4S1P (4 cells series) | Nominal 14.4V pack, 4000mAh per cell |
| Charge IC | BQ25895 (Ti) | Smart PD negotiation, thermal regulation, MPPT |
| Gas gauge IC | BQ40Z80 (Ti) | I2C @ 0x36 — reports SOC, voltage, current, temp, health |
| I2C address | 0x36 | SDA → GPIO 2, SCL → GPIO 3 (Pi standard) |
| Low-battery shutdown | Configurable <5% | HAT cuts power after Pi OS halts cleanly |
| Auto-boot on power | Hardware enable | Set via raspi-config → Boot on power restore |
| Estimated runtime | 8–12 hrs | Pi4 + 7" screen + OBD dongle ≈ 6–8W total draw |
// BQ40Z80 I2C READABLE REGISTERS //
0x00
RelativeSOC
Battery % (0–100)
0x09
Voltage
Pack voltage (mV)
0x0A
Current
Charge/discharge (mA)
0x08
Temperature
Cell temp (°K × 10)
0x0F
RemainingCap
mAh remaining
0x10
FullChargeCap
mAh at full (ages)
0x11
RunTimeToEmpty
Minutes remaining
0x16
BatteryStatus
Status flags byte
📦
Order: Waveshare UPS HAT (E) + 4× Samsung 40T 21700 Cells
The UPS HAT stacks directly onto the Pi 4 via pogo pins — physically no different to installing any HAT, but electrically it becomes the Pi's power source. The Pi doesn't see a battery — it just sees clean 5V. The HAT decides where that 5V comes from. Get genuine Samsung 40T or Molicel P42A cells. Avoid AliExpress clones — they lie about capacity and have no thermal protection.
Waveshare UPS HAT (E) ............ ~¥4,500 # model: E specifically — has PD input
4× Samsung 40T 21700 (4000mAh) .. ~¥3,000 # genuine from reputable seller
65W 12V→USB-C PD charger ........ ~¥1,500 # must support PD negotiation
Add-a-Circuit fuse tap (mini) .... ~¥300 # mini fuse size for CR-Z
USB-C cable (right-angle, 1m) .... ~¥400 # right-angle fits under dash cleaner
──────────────────────────────────────────
TOTAL PHASE 0 .................... ~¥9,700
← SWIPE TO SCROLL →
🔌
Car Side: Tap Fuse 13 (CR-Z Interior Fuse Box — Under Dash Driver Side)
Fuse 13 is the Accessory Socket fuse — ignition-switched, cuts when key is off. The Add-a-Circuit tap is literally a fuse with a second output — no cutting, no splicing. Completely non-destructive. Remove it and the car is factory stock again.
CR-Z HONDA INTERIOR FUSE BOX (dash, driver side)
└── FUSE 13 [ACCESSORY SOCKET · 15A · ignition-switched]
└── Add-a-Circuit tap (mini blade · add 10A fuse)
└── 12V line → 65W 12V→USB-C PD Charger
└── USB-C cable (1m, right-angle)
└── → UPS HAT (E) USB-C INPUT
│
┌───────────┴──────────────────┐
│ UPS HAT (E) │
│ BQ25895 (charge IC) │
│ BQ40Z80 (gas gauge, 0x36) │
│ 5V/6A boost output │
└──────┬──────────────┬─────────┘
│ pogo pins │ 4× 21700
┌──────▼──────┐ ┌───▼────────┐
│ Pi 4 (5V) │ │ Battery │
└────────────┘ └────────────┘
← SWIPE TO SCROLL →
🎛️
Optional: GPIO 17 Ignition Detection Circuit
A second thin wire from the same fuse tap goes through a resistor divider to GPIO 17. This brings 12V down to Pi-safe 3.3V. Total cost: ¥20 in resistors from any electronics shop.
# VOLTAGE DIVIDER — 12V → 3.2V (Pi GPIO safe)
# 3.2 = 12 × 47k / (100k + 47k) = 3.224V ✓
Fuse 13 (+12V) ──[100kΩ]──┬──[47kΩ]── GND
│
GPIO 17
# ~3.2V when car ON · ~0V when car OFF
# Parts: 100kΩ + 47kΩ resistors (~¥10 total)
← SWIPE TO SCROLL →
🐍
Software: Ignition Monitor systemd Service
Reads GPIO 17 (ignition) and I2C battery level every second. Key off → Joe speaks shutdown line → 60s timer → halt. Battery below 5% → emergency halt in 30s. Auto-starts on boot via systemd.
# /home/pi/kitt/ignition_monitor.py (key excerpt)
while True:
now = GPIO.input(17)
batt = read_battery_pct()
if was_on and not now:
speak("Engine cut. Shutdown in 60s. Good run tonight.")
graceful_halt("ignition_off", 60)
if batt <= 5:
speak("Battery critical. Shutting down in 30 seconds.")
graceful_halt("low_battery", 30)
was_on = now
time.sleep(1)
← SWIPE TO SCROLL →
🖥️
raspi-config: Two Critical Settings
I2C enables the UPS HAT gas gauge. Auto-boot makes the Pi start when the car key turns on — without it the Pi stays off even with power present.
sudo raspi-config
→ Interface Options → I2C → Enable
→ System Options → Power Button → Boot on power restore
# Verify I2C sees UPS HAT:
sudo i2cdetect -y 1 # should see 0x36
# Read battery %:
python3 -c "import smbus2; b=smbus2.SMBus(1); print(b.read_word_data(0x36,0x00),'%')"
← SWIPE TO SCROLL →
📐
Physical Stack: Under-Dash Sled
Full stack (Pi + UPS HAT + cells) ≈ 100×70×50mm. Velcro or 3D-printed bracket under the dash. The single USB-C cable is the only car connection. Unplug it and the whole sled is a portable battery unit.
PHYSICAL STACK (top → bottom)
┌──────────────────────────────┐
│ Waveshare 7" HDMI Screen │ ← dash mount
└──────────────┬───────────────┘
│ HDMI + USB
┌──────────────▼───────────────┐ ← velcro/sled under dash
│ Raspberry Pi 4 (4GB) │
└──────────────┬───────────────┘
│ pogo pins
┌──────────────▼───────────────┐
│ Waveshare UPS HAT (E) │
└──────────────┬───────────────┘
│ wire leads
┌──────────────▼───────────────┐
│ 4× Samsung 40T 21700 │
└──────────────────────────────┘
USB-C → PD Charger → Fuse 13
GPIO 17 → voltage divider → Fuse 13
USB-A → ELM327 → OBD2 port
← SWIPE TO SCROLL →
DEMO MODE: Unplug the one USB-C cable from the fuse tap and the sled is a fully self-contained battery device. obd_bridge.py falls back to SimOBD automatically. Dashboard, Joe, arcade — all runs identically. Walk into Daikoku with the screen already running. No CRZ required.