Case study · Personal project
Auris2 Module
An ESP32-C6 listens to the CAN bus of a Toyota Auris 2 Hybrid in listen-only mode and streams the frames over BLE to an Android application.
Context
A modern car lets its control units talk over a CAN bus, accessible through the OBD2 port. On a Toyota Auris 2 Hybrid, this bus carries about 1000 frames per second. They tell everything: speed, engine speed, pedals, steering wheel, lights, doors. The challenge is to capture them without disturbing anything, then make sense of them.
Goal
Build a module that listens to the CAN line of the OBD2 port and forwards every frame over Bluetooth Low Energy to an Android application that decodes, displays and records them. The module never transmits on the car's bus.
Block diagram
- Toyota Auris 2 Hybride : les calculateurs diffusent leurs trames sur le bus CAN à 500 kbit/s.
- OBD2 port : CAN-H sur la broche 6, CAN-L sur la broche 14, masse et +12 V pour l’alimentation.
- Transceiver SN65HVD230 : convertit le signal différentiel du bus en niveaux logiques 3,3 V.
- XIAO ESP32-C6 : son contrôleur CAN intégré lit les trames en écoute seule, les regroupe en paquets numérotés et les diffuse en BLE.
- Écran OLED 128 × 64 : débit CAN en trames par seconde, état du Bluetooth, état du réseau, compteurs d’erreurs.
- Application Android : décodage des signaux, tableau de bord, vue voiture isométrique, enregistrement .log.
Approach
- Listen safely: the CAN controller runs in listen-only mode so the car is never disturbed. Power is planned to come from the +12 V pin of the port, through a 12 V to 5 V converter.
- Identify the signals: nine guided captures, one action at a time (idle, accelerator, brake, steering wheel, gears, lights, air conditioning, doors, driving), then a comparison of the frames to spot the ones that change.
- Transmit: frames are grouped into numbered BLE packets, which lets the app detect losses.
- Display: the app offers a tile dashboard, a raw frame table, settings, and an isometric car view driven by the signals.
- Record: frames are written to a .log file in candump format, which can then be replayed on a PC.
The car view, demonstrated
In the app, an isometric car reacts live to the frames received. The demo below reuses this principle with simulated signals: each tile matches a signal actually decoded on the Auris.
- Speed– km/h
- Engine speed– rpm
- Gear–
- Accelerator–
- Brake–
- Steering wheel–
- Lights–
- Driver door–
- Trunk–
- Fan– / 7
Tests
- ≈ 1000frames per second on the bus
- 120different messages at idle
- 9guided captures on the car
- Captures on the vehicle: speed, combustion engine speed, pedals, steering wheel angle, engaged gear, lights, air conditioning, driver door and trunk were each confirmed on the Auris from a dedicated capture.
- Unit tests: the app logic (packet parsing, truncated or corrupted packets, loss detection, signal decoding, log format) is checked automatically at every build.
- Module self-test: the signal extraction functions are checked by a built-in self-test.
- Off-vehicle trial: a test setup validated the board and the transceiver at 500 kbit/s.
Limitations
- The hybrid battery state of charge is not broadcast on the bus: it would require querying a control unit, which a listen-only module does not do.
- Turn signals are not visible on the OBD2 port. In the app they are drawn but greyed out.
- An attempt to query the control units (read-only) failed: each request caused errors on the bus. Tests were stopped, with no warning light or fault code on the car, and the module remains strictly passive.
- The order of the four wheels in the wheel speed frame remains to be verified.