From jumper wires to a PCB.
I want to see how far my bike leans in a corner. Getting that measurement off the workbench has meant chasing loose contacts, a power path that changed on battery, and a box that had to fit the bike as well as the electronics.
The logger has recorded bench data. The after-ride tools have also processed a synthetic ride. The first PCB (board B) is in hand and tested on the bench, and the first ride was done on 15 October 2026 on it, on a wet road with little lean; the data is being analysed. The slim enclosure for it is designed and has a print and assembly guide, but it is not printed yet. The Garmin data field has only run in the simulator, and its grip level is a model-based estimate that has not been compared with real rides.
Why I am choosing a PCB-
The idea
A lean angle I can look at after the ride.
The starting point was a feeling I already knew from cycling. A corner can feel fast or cautious, but I wanted a trace that showed how the bike actually leaned through it. That gave the prototype a concrete job: record orientation and keep the data for the ride home.
I kept the first version focused on an ESP32, a motion sensor and a microSD card. Live data on a bike computer can come later. First I need a logger that starts, records on battery and gives me a file I can trust. A number on a display would not prove any of those things.
What I learned: A useful first version has to deliver a complete log before it needs a live display.
-
First connections
A working connection is only the beginning.
The first connections on the breadboard were a way to get the boards talking without committing to an enclosure. The BNO055 talks to the ESP32 over I²C; the SD module uses SPI. Separating those connections made it possible to check the sensor and the card before joining them into one logger.
That stage was easy to rearrange and easy to disturb. I could see readings over USB, but every jumper lead added a contact that could move. Power, ground and the exact pin labels mattered as much as the code. A pin map became more useful than another list of numbers once I had to reconnect the real boards.
What I learned: A successful USB session proves that wiring worked for that session. It does not prove it will survive a ride.
-
Dupont and perfboard
Loose wires became a mechanical problem.
Dupont jumpers made the early build quick. They also left a bundle of plugs, bends and small joints between the boards. Contact trouble kept turning into sensor or storage trouble, so I explored a soldered perfboard carrier to give the connections a fixed place.
That meant designing more than a rectangle around the parts. I had to allow for headers projecting from both sides, cable bends, solder joints and access to the screws. A printed dry-fit template exposed an SD module that extended beyond its reserved space. Later, the drilling and assembly work became too much for the first ride, so I simplified that version to retain the existing wiring in a printed box. The full perfboard assembly is not the version I am taking out first.
What I learned: The outline of a module is only part of its size. Connectors, wires and assembly tools need space too.
-
BNO055
The sensor mount is part of the measurement.
I chose the BNO055 because it produces an orientation estimate as a quaternion. I can store that orientation and work on the lean calculation after the ride, rather than start by writing my own sensor-fusion system. The logger uses IMUPLUS mode, with accelerometer and gyro fusion and no magnetometer in that fusion.
Calibration still needed real checking. Writing offsets after a fixed delay was not enough: the sensor could still be in the wrong mode and silently ignore them. Reading the mode back, writing the offsets and checking the registers made the restore observable. The physical mount matters just as much. If the board can rock inside the box, the log includes that movement as well as the bike’s lean.
What I learned: Stored calibration and a rigid sensor mount are measurement requirements. Bench results still need checking on a moving bike.
-
SD logging and power
A missing row is a clue, not an empty corner.
The logger attempts a reading 20 times a second and stores orientation, timing and calibration status on microSD. Writing and flushing the file can interrupt that rhythm. Long pauses came back at flush boundaries in bench logs, so I kept the timing evidence instead of calling the problem fixed after one quiet run.
Power and contact failures complicated the same job. A brownout is a restart caused by a supply voltage drop; a brief loss of power at the sensor can interrupt useful readings without restarting the ESP32. A later file alone may miss an earlier ride segment after a reset. I therefore need to retrieve every relevant log and inspect gaps. The readout also checks file length and CRC32, because copying text from a serial-monitor window once lost the beginning of a file.
What I learned: Increasing row counts and a finished download do not establish a complete ride. Timing, startup records and transfer checks matter.
-
Battery and regulator bypass
USB had hidden the SD module’s power path.
The SD adapter has a VCC input that feeds an onboard 1117 regulator. On USB it had the input supply it expected. On battery, the ESP32 board’s 5 V pin did not power it. Feeding that regulator from 3.3 V was not the same as delivering 3.3 V to the card: the regulator dropped the output further.
The working modification supplies the regulator’s output side from the ESP32 board’s 3.3 V rail. The unused VCC pin stays isolated because the regulator can feed voltage back toward that input. After the bypass, the logger ran through a USB-to-battery transition and later recorded a bench run lasting 14 hours and 48 minutes on one cell. That is an observed run in that setup, not a promise of battery life on a bike.
What I learned: Check the complete power path in battery-only operation. A design that works with USB connected can still fail when USB is removed.
-
The enclosure and mount
The first ride needs a box that fits.
The original under-saddle carrier grew around wiring, battery support and fasteners. A CAD model could close and still leave a screw impossible to reach. Printed parts added another check: a USB dust plug that looked snug in the model fell out of the actual opening.
I cut back the first-ride build to one printed enclosure on the existing bottle-cage mounts, with the BNO055 screwed to rigid standoffs. The down-tube position left too little clearance near the chainring, so the current plan uses the seat tube. The closed assembly still needs its clearance and fastening checked on the bike. The tube angle also exposed an analysis error: leaning about the sensor’s own tilted axis gave the wrong result. A synthetic ride checked the corrected calculation with a fixed mounting tilt.
The box for the PCB is a smaller one, drawn as a slim, aero-shaped fairing that clamps to the saddle rails under the saddle. In CAD the clamp bridge is 78.8 mm wide and the jaws 71.8 mm, and the tail ends about 22 mm behind the saddle’s rear edge, which I accepted for the sake of the shape. Rail contact is computed at 20–40 mm from a scaled photo of my own saddle. The aerodynamic idea is a design aim, not a measured drag result.
Around that model there is now a print and assembly package. The parts are meant for ASA on a Bambu P1S, with PETG as the spare, and a print-check script passes all nine of its checks. A screw table fixes the hardware: four M4×30 for the bridge, four M4×27 for the jaws, four M3×8 for the tail cone, with the heat-set inserts tried first on a small test coupon. A seven-step guide with exploded renders covers the order of assembly. Everything is checked in CAD and with scripts only. Nothing is printed yet, so the first print is what will show the fit.

Top view of the tiny enclosure in CAD: the fairing (grey) behind the clamp bridge (dark) on the saddle rails (brown). A photo-scaled model, not a printed part. What I learned: Physical clearance and sensor alignment belong in the same test as the angle calculation. A printed box is not a completed fit check.
-
The website
Make the prototype understandable.

A rider, a bicycle and a corner. The scenes illustrate the idea; they are not recorded rides. The website gives the project a place to explain what a lean angle means and why I want to record it. The corner scenes show the idea in motion, and the calculator gives the relationship between speed, radius and lean a concrete form.
Those scenes are illustrations. Their speeds and angles are not measurements from this logger, and the synthetic ride used to test the tools is not a road test. Writing the story forced me to keep the working bench prototype, the mounting plan and the future live display separate. This page adds the less tidy part: the wiring and power faults that changed the next design decision.
Around the logger there are now two after-ride tools. The analysis page reads a Garmin FIT file and a Krengo log and gives each corner a peak, a side and a grip colour; it has been checked on made-up data only. It now opens on your sharpest corner automatically, and if you choose to remember a corner it compares the same corner on later rides. Everything stays in your browser. The Garmin data field shows angle, grip left in twelve steps (G1–G12) and a pedal warning. It builds for 32 Garmin devices and has run in the simulator, not on a real Edge. A pilot package of builds exists, but it is not published and the field is not in the Connect IQ Store. The grip level is a model of an assumed capacity.
Two more pieces explain the numbers. The lean angle calculator now shows which limit comes first at your speed and radius: grip on dry, wet or gravel surfaces, the pedal warning at 33.2° or the pedal strike at 36.2° (model values). The article Why cyclists crash in corners walks through the same three limits.
What I learned: An explanation is more useful when readers can tell what I built, what I tested and what I still want to try.
-
Now: my own board
I want to spend the next ride riding.
Loose wires and solder joints have caused repeated power and contact faults. Each one has taken time and motivation that I wanted to spend riding and looking at data. The BNO055 module I used on the bench stopped working on 1 October, and a new module would cost about as much as a board. So the next step is my own PCB: one 76 × 50 mm board that carries the ESP32 module, the BNO055, the microSD slot, USB-C and battery charging, with fixed copper connections instead of hand-routed wiring.
Fixed connections and defined mounting positions should make the build easier to repeat. A smaller enclosure is a goal, not a measured result: the board, the battery and service access still have to fit the bike.
What I learned: A PCB changes how the connections are made. It needed electrical checks and physical inspection, and the first ride on it (15 October 2026, in rain) is still being analysed.