FC Monogram Crest
Francesco Castaldi
I. PROJECT MONOGRAPH • SELECTED WORKSFOLIO ID: yaris-hv-fan-optimizer

Yaris HV Battery Cooling Fan Optimizer — CAN/OBD-II Telemetry

Native Android telemetry and ECU coding application developed in Kotlin and Jetpack Compose for the Toyota Yaris MK4 (XP210 series, M15A-FXE). Interfaces with vehicle ECUs via Bluetooth Low Energy (BLE) OBD-II adapters using ISO 15765-4 CAN 500k and UDS diagnostic protocols. Features automatic battery pack thermal derating prevention, manual Denso fan override (Level 6), Dragy 0-100 sprint timing, and customizable cabin/ADAS ECU codings.

AndroidKotlinJetpack ComposeCAN BusOBD-IIUDSBLE 4.0Automotive
Yaris HV Battery Cooling Fan Optimizer
FIGURE: Yaris HV Battery Cooling Fan Optimizer

Overview & Automotive Challenge

The Toyota Yaris MK4 Hybrid (XP210) employs a 4.3 Ah lithium-ion battery pack cooled by a dedicated Denso centrifugal blower fan. Under sustained highway climbs or hot summer conditions (>30°C ambient), battery cell temperatures routinely exceed 36°C–38°C, triggering OEM thermal protection routines that drastically throttle EV electric motor assistance and regenerative braking efficiency.

IMPORTANT NOTICE
The Yaris HV Battery Cooling Fan Optimizer prevents thermal derating by executing proactive cooling curves, keeping battery cell modules latched between 22°C and 26°C via automated UDS Input/Output Control diagnostic frames.

3-Tab Architectural Hierarchy

The application is structured into three dedicated functional modules operating over a background ForegroundService with zero telemetry starvation:

ModuleCore TechnologyAutomotive Capabilities
🏁 CockpitDragy Engine & High-Speed CANLarge digital speedometer (PID 010D), ignition advance (PID 010E), engine load (PID 0104), and Dragy 0–50 / 0–100 km/h sprint timing with persistent PB storage.
🌀 Fan ControlDenso UDS IO Control & ISO-TPContinuous trigger threshold (28.0°C–42.0°C), hysteresis band (1.0°C–5.0°C), manual Level 6 MAX override, and 4-probe module array monitoring (PID 2228C1).
🛠️ ECU CodingMulti-ECU UDS ConfigurationCustomization of Toyota Touch 3 startup animations (GR / HSD), reverse single-beep comfort mode, speed-sensing central locking, and ADAS sensitivity.

*Table 1: Yaris HV Fan Optimizer Application Architecture*

// Automated battery cooling fan IO control dispatch in Kotlin
suspend fun dispatchFanSpeedOverride(fanLevel: Int): Result<ByteArray> {
    require(fanLevel in 0..6) { "Fan level must be between 0 and 6" }
    // UDS Diagnostic Service 0x2F (InputOutputControlByIdentifier)
    // Parameter: 0x5803 (Battery Blower Fan Control), Option: 0x03 (ShortTermAdjustment)
    val udsPayload = byteArrayOf(0x2F.toByte(), 0x58.toByte(), 0x03.toByte(), fanLevel.toByte())
    return obdController.sendRawEcuFrame(targetEcu = EcuAddress.BATTERY_7E2, payload = udsPayload)
}

Standalone Diagnostic Bridge (:sniffer)

The project includes an integrated reverse-engineering utility (Yaris OBD Bridge) distributed as an independent APK. It binds a local TCP socket server on 127.0.0.1:35000, acting as a man-in-the-middle diagnostic sniffer for third-party tools (Dr. Prius, Car Scanner) with millisecond-accurate timestamp logging.

Automated Verification & Test Coverage

  • 100% Passing Test Suite: Over 90 automated unit and integration tests across ISO-TP frame reassembly, ELM327 parser resilience, candidate cooldown state machines, and zero-starvation engine invariants.
  • Supported Adapters: Vgate iCar Pro BLE 4.0+, vLinker MC+/FD+ (recommended for multi-frame ISO-TP), Veepeak OBDCheck BLE, and Carista OBD.

Related Disciplines & Competencies

Automotive Systems & KinematicsHardware Hacking & Reverse Engineering
Examine Upstream RepositoryConsult Live Demonstration
Return to Selected Works