Vincent Vanhegan

BEng Mechatronic Engineering (Hons)

Born and raised in Nottingham, I hold a First-Class BEng in Mechatronic Engineering from Manchester. I work at the intersection of hardware and software, stay active with Kabaddi, Volleyball, and Rock Climbing, and contribute to the community through nature-based volunteering and beekeeping.

Serial Decoding

Serial Decoding

Goal

Build a Python decoder that reads an encoded binary log byte-by-byte (simulating a live serial stream) and reconstructs human-readable telemetry frames against a published protocol specification

What I did

  • A streaming decoder in Python that processes one byte at a time, locating frame boundaries on the fly by scanning for the protocol’s ~~ start-of-frame marker — the same frame-synchronisation pattern used in real serial receivers.
  • Per-frame parsing of a 26-byte protocol covering device IDs, sequence number, RPM and voltage as big-endian uint16, current as little-endian int16, MOSFET and capacitor temperatures via lookup table, a 64-bit Unix microsecond timestamp, and a one-byte checksum — handled cleanly using Python’s struct module.
  • A multi-layer corruption-detection pipeline: validating the P payload and T timing markers, catching lookup-table misses on temperature bytes, and verifying the protocol’s 255 − (sum mod 256) checksum on every frame.
  • CSV export with corrupt frames retained but flagged, per the brief.

Outcome

Decoded 628 complete frames from the assigned binary; 16 flagged as potentially corrupt; all timestamps successfully resolved to Tuesday, 19 April 2005