Real-time High Voltage (HV) current monitor for Toyota Hybrid vehicles, featuring Bluetooth OBD-II connectivity and LCD display.
This project reads the High Voltage (HV) battery current from Toyota hybrid vehicles using the OBD-II protocol. Data is retrieved via Bluetooth connection to an ELM327 adapter and displayed on a 1602 I2C LCD screen.
- π Real-time HV current reading (200ms update rate)
- π Battery state display: Charging, Discharging, or Idle
- π± Wireless connection via Bluetooth
- π₯οΈ Clear LCD 1602 display
- π§ Digital filter for stable readings
| Component | Description | Quantity |
|---|---|---|
| ESP32 DevKit V1 | Microcontroller with Bluetooth | 1 |
| LCD 1602 I2C | 16x2 LCD with I2C interface | 1 |
| ELM327 Bluetooth | OBD-II adapter with Bluetooth | 1 |
| Jumper Wires | Dupont connection wires | As needed |
| Power Supply | 5V USB or car cigarette lighter | 1 |
ESP32 LCD I2C
βββββββββββββββββββββββββ
GPIO 21 β SDA
GPIO 22 β SCL
3.3V β VCC
GND β GND
β οΈ LCD I2C Address:0x27(configurable in line 6 of code)- π If LCD doesn't work, try scanning I2C addresses:
i2cdetect - π ESP32 connects to computer/power supply via USB
- π‘ ELM327 connects to vehicle via OBD-II port (usually below steering wheel)
MAC Address: 98:D3:33:F5:C0:E6 (configurable in line 10)
PIN Code: 3080 (configurable in line 180)
Protocol: ISO 15765-4 (CAN)
LCD display showing startup screen during initialization
Code is optimized for Toyota/Lexus Hybrid vehicles:
- Toyota Prius (Gen 2, 3, 4)
- Toyota Aqua
- Toyota C-HR Hybrid
- Lexus CT200h
- Lexus ES Hybrid
- Other vehicles with THS (Toyota Hybrid System)
- DID (Data Identifier):
221F9A2(HV current) - CAN Header:
7D2(Hybrid system ECU) - Response:
7DA(ECU response) - Current Format: 2 bytes signed, Big Endian, units: 0.1A
# Install PlatformIO
pip install platformio
# Clone the project
git clone https://github.com/amir684/ESP32_OBD.git
cd ESP32_OBD# Compile
pio run
# Upload to ESP32 (connect ESP32 via USB)
pio run --target upload
# View Serial output (optional)
pio device monitor// Line 10 in main.cpp
uint8_t OBD_ADDR[6] = { 0x98, 0xD3, 0x33, 0xF5, 0xC0, 0xE6 };How to find the address? Search for the ELM327 via your phone's Bluetooth settings.
// Line 6 in main.cpp
LiquidCrystal_I2C lcd(0x27, 16, 2); // Change 0x27 to your address// Line 169 in main.cpp
Wire.begin(21, 22); // SDA, SCLsrc/
βββ main.cpp # Main code
βββ ISO-TP # ISO-TP protocol implementation
βββ ELM327 # ELM327 initialization
βββ LCD UI # Display interface
βββ Loop # Main loop
SerialBT.begin("ESP32-OBD", true); // Master mode
SerialBT.setPin("3080");
SerialBT.connect(OBD_ADDR);The code implements ISO-TP protocol (ISO 15765-2) for ECU communication:
- Single Frame: Single message (up to 7 bytes)
- First Frame: Start of multi-frame message
- Consecutive Frame: Continuation of message
filtA = 0.85f * filtA + 0.15f * amps; // Low-pass filterSimple IIR filter for data smoothing.
Line 1: I: +12.3A (HV Current)
Line 2: DISCHG OBD:OK (Status)
States:
DISCHG- Discharging (electric motor active)CHG/REG- Charging/Regeneration (braking)IDLE- Idle
- β Check that ELM327 is powered (LED blinking)
- β Verify MAC address is correct
- β Try resetting ELM327 (disconnect and reconnect)
- β Check PIN code matches (3080 or 1234)
- β Check pin connections (SDA/SCL)
- β Verify I2C address is correct (0x27)
- β Check backlight is on
- β Adjust contrast (potentiometer on LCD back)
- β Ensure vehicle is on (key in ON position)
- β Check ELM327 is connected to OBD-II port
- β
Try diagnostic commands via Serial Monitor:
ATZ - Reset 0100 - Test connectivity
Code already includes filtering, but you can increase it:
filtA = 0.90f * filtA + 0.10f * amps; // Stronger filter- Add SOC (State of Charge) reading
- Data logging to SD Card
- Real-time graphs
- WiFi + Web Server
- Support for Hyundai/Kia vehicles
- DTC error logging
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Pull Requests are welcome! Please open an Issue first for major changes.
- GitHub: @amir684
- Email: amir684684@gmail.com
- ELM327 - Elm Electronics
- Arduino-ESP32 - Espressif Systems
- LiquidCrystal_I2C - F. Malpartida
Made with β€οΈ for Toyota Hybrid Owners
