Mark III:
powering GearSense from the bike itself.

The cargo bike's lowest assist level is still too fast for genuinely slow riding. The fix isn't a software tweak to the controller — it's GearSense talking to the throttle line directly. That single decision shapes everything about Mark III: how it's wired, how it's powered, and what it can become next.

4.65V
throttle rail voltage — the new power source
~5.1V
target boost output for the ESP32 regulator
2A
rated capacity of the MT3608 boost module on order
0
LiPo cells in the Mark III design

Why throttle injection

The cargo bike runs a Bafang-family setup — a GD06 display, paired with one of the generic "DC MOTO/JN" style controllers that ship under that display. Assist is selected via the display's five PAS levels, and even PAS 1 delivers more speed than is wanted for slow, careful riding — around pedestrians, in tight spaces, on the cargo runs where control matters more than speed.

The controller's PAS curves and assist levels are a fixed lookup table — there's no way to ask for "a little less than PAS 1." But GearSense already knows the rider's cadence and the detected gear. If it can write directly to the throttle line, it can compute its own desired output and bypass the PAS table entirely. That's Phase 3, and it's the reason Mark III will exist.

A hardware-agnostic, two-tier plan

Client bikes will have wildly different controllers, so the injection approach is split into two tiers — deliberately ordered so the universal case ships first.

Tier 1 — Analog injection

Works on any controller with a conventional Hall-effect throttle input — the large majority of budget hub-motor kits, including this cargo bike. GearSense's DAC output replaces the throttle signal. This is the Mark III target.

Tier 2 — Digital protocol injection

For CAN/UART controllers (Bafang CAN, KT/Lishui, open-firmware BBS02/BBSHD via bbs-fw). GearSense commands power/speed digitally and reads the controller's own PAS/wheel sensors over the same link — a future "clean install" tier, not being built now.

The same protocol knowledge that lets GearSense write commands on Tier 2 also lets it read the controller's existing sensors, which would eventually mean GearSense needs no sensor wiring of its own on compatible bikes. Noted for the roadmap; Tier 1 comes first.

What's actually on the throttle line

Before any injection circuitry can be designed, the existing throttle line needed to be characterised. Three wires, measured at the connector:

Measured (to be re-measured methodically)
Line A: ~4.65V constant (power) · Line B: ~3.65V idle → ~0.85V full throttle (signal) · Line C: ground
Line B is inverted relative to the typical pattern described in hobbyist literature (usually ~0.8V idle rising to ~4.2V at full throttle). On this controller, DECREASING voltage means INCREASING throttle. Firmware's DAC output mapping will need to invert accordingly once Phase 3 lands.
Action item These voltages were measured once, informally. Before any injection circuit is built, they need to be re-measured methodically — idle and full-throttle, with notes — to confirm the true min/max range and that the rail itself is stable.

The power decision: no LiPo

Mark II ran on a LiPo. Mark III won't. Line A — the same ~4.65V rail that will eventually carry the injected throttle signal — is also the power source, stepped up through a small MT3608-based boost converter to roughly 5.0–5.2V for the ESP32's onboard regulator.

The step-up is necessary, not optional: AMS1117-style regulators need roughly 4.4–4.6V minimum input due to their 1.1–1.3V dropout. 4.65V direct is too marginal once the display, BLE, and WiFi are all drawing current at once. A 2A-rated (1A continuous recommended) MT3608 module, ~93–97% efficient, is on order and arrives Monday, June 15. One-time calibration: bench-power the module at ~4.65V and trim its onboard pot until VOUT reads 5.0–5.2V — output must exceed input for the MT3608 to regulate — verified with a multimeter before it ever sees the ESP32.

Why drop the battery A smaller case, no charge-cycle management, nothing to remember to charge, and a single connector handling both power and (eventually) throttle — using the M6/M8 Y-connectors already on hand. The trade-off is that a disconnected connector means an instant reboot. That's judged acceptable: Mark III's improved connectors should make disconnects rare, and a mid-ride reboot just means the in-session gear ladder rebuilds — low-stakes, in keeping with "5 of 7 is still better than nothing, and improves over time." LiPo remains the right call for the Tier 2 CAN variant, which needs its own power source regardless of GearSense.

Two measurements stand between here and a soldering iron

The build plan

Mark III is, first and foremost, a rewire — and it directly addresses the connector/magnet issue diagnosed in the previous post. New M6/M8 waterproof connectors (2/3/4-pin) and 10m runs of 2-wire and 3-wire cable, matching the cargo bike's existing connectors, are already in hand.

What comes next

The boost converter arrives Monday. Once it's calibrated and the two outstanding measurements are done, Mark III goes back on the bike — sensors rewired, throttle line in place but dormant, running on rail power for the first time.

  1. Measure ESP32 current draw under full display+BLE+WiFi load
  2. Measure throttle rail stability under load, with oscilloscope check for ripple
  3. Calibrate and bench-test the MT3608 boost module
  4. Rewire PAS/wheel sensors with new waterproof connectors
  5. Run (but don't connect) the throttle line to GPIO17/GND
  6. First Mark III ride on bike-supplied power, no LiPo

Comments

Loading…

Leave a comment