Connecting a car’s internal computer network to the outside world opens up a realm of possibilities for monitoring and understanding vehicle performance. This project focuses on building a simple coolant temperature gauge using an Elm327 H Obd2 Obdii Bluetooth adapter, readily available online for around $5. This guide outlines the necessary components, connections, and code to display real-time coolant temperature data on an LCD screen.
While the OBD2 connector itself is standardized, the communication protocols used by different car manufacturers vary. The ELM327 chip acts as a translator, converting these diverse protocols into a single, understandable language. This allows a microcontroller, like the Arduino Uno, to receive and process the data.
Parts Required for the Project
This project utilizes readily available and affordable components:
- ELM327 H OBD2 OBDII Bluetooth Adapter: (~$5) This adapter connects to the vehicle’s OBD2 port and transmits data wirelessly. Ensure you select an adapter with the “H” version of the ELM327 chip for best compatibility.
- Arduino Uno: (~$5) This microcontroller receives data from the ELM327 and controls the LCD display.
- HC-05 Bluetooth Module: (~$5) This module allows the Arduino to communicate wirelessly with the ELM327.
- I2C LCD Display: (~$5) This display shows the coolant temperature reading. A 16×2 character display is sufficient.
Hardware Connections
Arduino Uno Connections:
- Connect the HC-05 TX pin to the Arduino RX pin.
- Connect the HC-05 RX pin to the Arduino TX pin.
- Connect the LCD I2C SDA pin to the Arduino A4 pin (SDA).
- Connect the LCD I2C SCL pin to the Arduino A5 pin (SCL).
HC-05 Bluetooth Module Setup:
The HC-05 needs to be configured as the master device to initiate the connection with the ELM327 (slave).
-
AT Command Mode: Before powering the HC-05, press and hold its button. Power on the module while holding the button. It should blink slowly (every 2 seconds), indicating AT command mode.
-
Connecting to ELM327: Use a serial monitor or terminal program on your computer to connect to the HC-05 via its serial port. You’ll need the Bluetooth address of both your ELM327 and HC-05. You can find these using AT commands like
AT+ADDR?
. Execute the following AT commands, replacing the placeholder addresses with your actual device addresses:
AT+RESET
AT+ORGL
AT+ROLE=1
AT+CMODE=0
AT+BIND=1234,56,789c72 (Replace with your ELM327 address, adjusted for the command format)
AT+INIT
AT+PAIR=1234,56,789c72,20
AT+LINK=1234,56,789c72 (Replace with your ELM327 address, adjusted for the command format)
I2C LCD Display Setup:
- Ensure the I2C library is installed in your Arduino IDE. The necessary library is typically named
LiquidCrystal_I2C
. You might need to copy theWire.h
library from the Arduino installation directory to your Arduino libraries folder. - In your Arduino code, initialize the LCD with its I2C address. A common address is
0x27
or0x3F
. Use an I2C scanner sketch if you’re unsure.
Arduino Code Implementation
Include the necessary libraries:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
Initialize the LCD:
LiquidCrystal_I2C lcd(0x3F, 16, 2); // Adjust I2C address if necessary
Within the setup()
function, initialize the serial communication for the HC-05 and the LCD:
void setup() {
Serial.begin(9600); // Baud rate for HC-05
lcd.init();
lcd.backlight();
}
The loop()
function will handle receiving data from the ELM327, parsing the coolant temperature, and displaying it on the LCD. This will involve sending specific OBD2 commands (e.g., Mode 01, PID 05 for coolant temperature) to the ELM327 and processing the response. You’ll need to consult the ELM327 datasheet and the OBD2 standard for the appropriate commands and data format.
Conclusion
This guide provides the foundation for building a custom coolant temperature gauge with an ELM327 H OBD2 OBDII adapter. Further research into OBD2 commands and data parsing will be required to complete the Arduino code. This project showcases the accessibility and affordability of vehicle diagnostics and customization using readily available hardware and open-source software. Remember to consult your vehicle’s specific documentation for compatibility and safety precautions.