For car enthusiasts and DIY electronics hobbyists, accessing real-time data from your vehicle’s On-Board Diagnostics (OBD2) system can unlock a world of insights and customization possibilities. In this project, we’ll guide you through creating a straightforward and effective coolant temperature display using readily available components: an Arduino microcontroller, an ELM327 OBD2 adapter, an HC05 Bluetooth module, and an I2C LCD screen. This setup allows you to wirelessly retrieve and visualize your car’s coolant temperature, providing a useful and engaging DIY automotive project.
This project leverages the standardized OBD2 port present in most modern vehicles to tap into the Engine Control Unit’s (ECU) data stream. While OBD2 connectors are physically standardized, the communication protocols vary. This is where the ELM327 chip comes into play. It acts as a translator, interpreting the diverse OBD2 protocols and converting them into a unified language that our Arduino can understand. These ELM327 chips are now widely accessible and affordable, especially in Bluetooth-enabled versions available for just a few dollars online.
To complete this project, you will need the following components:
Required Parts:
- ELM327 Bluetooth OBD2 Adapter: This is the interface to your car’s OBD2 port, retrieving data and transmitting it wirelessly.
- Arduino Uno (or similar): The microcontroller brain of the project, processing data and controlling the display.
- HC05 Bluetooth Module: Enables wireless communication between the Arduino and the ELM327 adapter.
- LCD I2C Display: Provides a clear and simple visual output for the coolant temperature readings.
Wiring and Connections:
The wiring for this project is relatively simple, focusing on connecting the Bluetooth and LCD modules to the Arduino.
Arduino Uno Connections:
- HC05 Bluetooth Module: Connect the HC05 TX pin to the Arduino RX pin and the HC05 RX pin to the Arduino TX pin. Ensure you also connect 5V and GND from the Arduino to the HC05 power and ground pins.
- LCD I2C Display: Connect the LCD I2C module’s SCL pin to the Arduino’s SCL pin (A5 on Uno) and the SDA pin to the Arduino’s SDA pin (A4 on Uno). Power the LCD I2C module with 5V and GND from the Arduino.
HC05 Bluetooth Module Configuration:
For seamless communication, we need to configure the HC05 Bluetooth module to automatically connect to the ELM327 adapter. We’ll set the HC05 as the master and specify the ELM327’s Bluetooth address.
HC05 Setup Steps:
- Enter AT Command Mode: Disconnect the HC05 from the Arduino. Connect the HC05 “EN” or “Button” pin to 5V before applying power to the HC05. This forces the module into AT command mode (indicated by a slow blinking LED).
- Serial Communication: Connect the HC05 to your computer via a USB-to-serial adapter (if not already using the Arduino serial monitor by temporarily disconnecting the microcontroller during programming and reconnecting for AT command input – remember to disconnect Arduino TX/RX during Arduino programming). Use a serial monitor program (like Arduino Serial Monitor or PuTTY) and configure it to 38400 baud rate, no parity, 8 data bits, and 1 stop bit.
- AT Commands: Enter the following AT commands, pressing Enter after each:
AT+RESET
(Resets the module)AT+ORGL
(Restores default settings)AT+ROLE=1
(Sets HC05 to Master mode)AT+CMODE=0
(Sets connection mode to connect to a specific address)AT+BIND=1234,56,789c72
(Replace1234,56,789c72
with your ELM327 Bluetooth address, without colons. Find your ELM327 Bluetooth address through Bluetooth scanning tools on your phone or computer.)AT+INIT
(Initializes Bluetooth)AT+PAIR=1234,56,789c72,20
(Pairs with the ELM327, with a 20-second timeout. Again, replace the address.)AT+LINK=1234,56,789c72
(Initiates the connection to the ELM327.)
Note: Always disconnect the HC05 TX and RX pins from the Arduino when uploading new code to the Arduino to avoid communication conflicts.
LCD I2C Display Integration:
The I2C LCD display simplifies wiring as it only requires two data wires (SDA and SCL). To use the LCD, you’ll need to include the necessary Arduino libraries.
LCD I2C Setup:
- Library Installation: Download and install the
LiquidCrystal_I2C
library in your Arduino IDE (Sketch > Include Library > Manage Libraries…). You might also need to manually copy theWire.h
library to your Arduino libraries folder if it’s not already present in your user profile’s Arduino library directory. TheWire.h
library is typically found within the Arduino IDE installation directory underhardwarearduinoavrlibrariesWiresrc
. - Code Initialization: In your Arduino code, initialize the LCD with its I2C address. The common address for many I2C LCD modules is
0x27
or0x3F
. You can often determine the address by scanning the I2C bus using an I2C scanner Arduino sketch if needed.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F, 16, 2); // Replace 0x3F if your LCD address is different
void setup() {
lcd.init();
lcd.backlight();
lcd.print("Coolant Temp:");
}
void loop() {
// ... (Code to read OBD2 data and display on LCD will go here) ...
}
With the hardware connected and configured, you can now proceed to write the Arduino code to communicate with the ELM327 adapter, request coolant temperature data, and display it on the LCD screen. This project provides a fundamental stepping stone for more advanced DIY car diagnostics and data visualization projects using Arduino and OBD2.