For car enthusiasts and DIYers, accessing real-time vehicle data can unlock a deeper understanding of your car’s health and performance. One crucial parameter is the engine coolant temperature, a key indicator of engine health and efficiency. This project guides you through building a simple and cost-effective coolant temperature display using an Obd2 Bluetooth Module, an Arduino microcontroller, and an LCD screen. This setup allows you to wirelessly retrieve and visualize your car’s coolant temperature data, providing a handy dashboard addition or a valuable tool for monitoring your vehicle’s condition.
Understanding the Basics: OBD2 and Bluetooth Modules
Modern vehicles are equipped with an On-Board Diagnostics II (OBD2) system, a standardized system that provides access to various vehicle parameters, including engine temperature, speed, and sensor readings. While the OBD2 port is standardized, the communication protocols under the hood are diverse. This is where the OBD2 Bluetooth module comes into play.
These modules, typically based on the ELM327 chip, act as translators. They can communicate with your car’s ECU (Engine Control Unit) using one of the many OBD2 protocols and then convert this data into a standard serial protocol, which can be easily accessed via Bluetooth. For this project, we’ll leverage a cheap and readily available ELM327 Bluetooth OBD2 adapter to extract the coolant temperature data.
Parts You’ll Need for Your OBD2 Bluetooth Project
To build your coolant temperature display, you will need the following components:
- ELM327 Bluetooth OBD2 Adapter: This is the heart of our project, enabling the interface with your car’s OBD2 system. These are widely available online for a low cost.
- Arduino Uno (or compatible): An Arduino microcontroller will act as the brain, processing the data received from the OBD2 module and displaying it on the LCD. The Uno is a popular and beginner-friendly choice.
- HC-05 Bluetooth Module: While the ELM327 adapter is already Bluetooth-enabled, we will use a separate HC-05 module for a more controlled and potentially reliable Bluetooth connection to the Arduino. This is configured to communicate with the ELM327.
- LCD I2C Display: An LCD screen with an I2C interface simplifies wiring and allows for clear display of the coolant temperature readings. The I2C interface uses only two wires for communication, making the connections cleaner.
These components are inexpensive and easily obtainable from online retailers, making this a budget-friendly project for automotive enthusiasts.
Setting Up the Hardware: Connections and Configuration
Let’s assemble the hardware components. The connections are straightforward and require basic wiring.
Arduino Uno Connections
-
HC-05 Bluetooth Module: Connect the HC-05 module to the Arduino as follows:
- HC-05 TX pin to Arduino RX pin
- HC-05 RX pin to Arduino TX pin
- HC-05 VCC to Arduino 5V
- HC-05 GND to Arduino GND
Note: It’s crucial to connect the HC-05 TX to Arduino RX and vice versa for serial communication.
-
LCD I2C Display: Connect the LCD I2C module to the Arduino I2C pins:
- LCD I2C SDA to Arduino SDA (Analog pin 4)
- LCD I2C SCL to Arduino SCL (Analog pin 5)
- LCD I2C VCC to Arduino 5V
- LCD I2C GND to Arduino GND
Note: On some Arduino boards, the SDA and SCL pins are also mirrored to dedicated pins; refer to your Arduino board documentation.
HC-05 Bluetooth Module Configuration (Master Mode)
We need to configure the HC-05 module to act as a Bluetooth master and automatically connect to the ELM327 (which will be the slave). This involves using AT commands.
-
Enter AT Command Mode: To enter AT command mode on the HC-05, you typically need to hold down a button on the module (if present) while powering it up. When in AT command mode, the LED on the HC-05 usually blinks slowly (e.g., every 2 seconds). Consult your HC-05 module’s datasheet for the specific method to enter AT command mode.
-
Connect via Serial Monitor: Open the Arduino Serial Monitor or a similar serial communication tool and connect to your Arduino’s COM port at a baud rate suitable for AT commands (often 38400 or 9600 – check your HC-05 documentation).
-
Issue AT Commands: Type the following AT commands one by one, pressing Enter after each, to configure the HC-05:
AT+RESET
(Resets the module)AT+ORGL
(Sets to original configuration – optional, but good practice)AT+ROLE=1
(Sets the HC-05 to Master mode)AT+CMODE=0
(Sets connection mode to connect to a specific address)AT+BIND=1234,56,789c72
(Binds to the ELM327 Bluetooth address. You must replace1234,56,789c72
with the actual Bluetooth address of your ELM327 adapter. You can usually find this address printed on the ELM327 adapter or by using a Bluetooth scanning app on your phone.)AT+INIT
(Initializes Bluetooth)AT+PAIR=1234,56,789c72,20
(Pairs with the ELM327. Again, use your ELM327’s address.,20
sets a 20-second timeout for pairing)AT+LINK=1234,56,789c72
(Attempts to establish a permanent link with the ELM327 on startup)
Note: To find your ELM327 Bluetooth address, you might need to use a Bluetooth scanning app on your smartphone or computer to detect Bluetooth devices in range when the ELM327 is plugged into your car’s OBD2 port and powered on.
LCD I2C Display Setup
Setting up the LCD I2C display is primarily software-based.
-
Install Libraries: You will need to install the
LiquidCrystal_I2C
library for Arduino. You can typically install libraries through the Arduino IDE’s Library Manager (Sketch > Include Library > Manage Libraries…). Search for “LiquidCrystal_I2C” and install a suitable library, often by Frank de Brabander. You may also need theWire.h
library, which is usually included with the Arduino IDE. -
Example Code Snippet: The following code snippet shows how to initialize the LCD I2C display in your Arduino code:
#include <Wire.h> #include <LiquidCrystal_I2C.h> // Set the LCD address to 0x3F for a 16x2 display LiquidCrystal_I2C lcd(0x3F, 16, 2); // Change to 0x27 if your display uses that address void setup() { lcd.init(); // Initialize the LCD lcd.backlight(); // Turn on backlight lcd.print("Coolant Temp:"); // Print initial message } void loop() { // ... (Your code to get coolant temperature and display it) ... }
Note: The I2C address of the LCD (e.g.,
0x3F
or0x27
) can vary. If your display doesn’t work with0x3F
, try0x27
or use an I2C scanner sketch to determine the correct address.
Putting It All Together: Arduino Code and Retrieving Coolant Temperature
Now, you’ll need to write the Arduino code to communicate with the ELM327 module, request coolant temperature data, and display it on the LCD. This involves sending OBD2 commands to the ELM327 and parsing the responses.
(Example Arduino Code – Conceptual Outline):
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h> // If using software serial for HC-05
// LCD setup (as above)
LiquidCrystal_I2C lcd(0x3F, 16, 2);
// Bluetooth Serial (adjust pins if needed)
SoftwareSerial bluetoothSerial(10, 11); // RX, TX (Example using software serial pins 10 & 11)
void setup() {
lcd.init();
lcd.backlight();
lcd.print("Coolant Temp:");
bluetoothSerial.begin(38400); // Or appropriate baud rate for HC-05
delay(1000);
// Initialize OBD2 communication
bluetoothSerial.println("ATZ"); // Reset ELM327
delay(100);
bluetoothSerial.println("ATE0"); // Turn off echo
delay(100);
bluetoothSerial.println("ATSP0"); // Set protocol to automatic
delay(100);
}
void loop() {
// Request coolant temperature (PID 05)
bluetoothSerial.println("0105"); // OBD2 PID for coolant temperature
delay(100);
if (bluetoothSerial.available()) {
String response = bluetoothSerial.readStringUntil('>'); // Read until prompt
// Parse the response (example - needs robust parsing)
if (response.indexOf("41 05") != -1) { // Check for correct PID response
int tempHexStart = response.indexOf("41 05") + 6; // Start of temperature hex value
String tempHex = response.substring(tempHexStart, tempHexStart + 2); // Assuming 2 hex chars
int tempC = hexToInt(tempHex) - 40; // Convert hex to Celsius (OBD2 formula)
lcd.setCursor(0, 1);
lcd.print(tempC);
lcd.print(" C "); // Add units and clear extra chars
} else {
lcd.setCursor(0, 1);
lcd.print("Error "); // Display error if no valid response
}
}
delay(2000); // Update every 2 seconds
}
// Hex to Integer conversion function (simple example - needs error handling)
int hexToInt(String hexStr) {
int val = 0;
for (int i = 0; i < hexStr.length(); i++) {
char c = hexStr[i];
int digit = isDigit(c) ? c - '0' : toupper(c) - 'A' + 10;
val = val * 16 + digit;
}
return val;
}
(Important Notes on the Code):
- SoftwareSerial: The example code uses
SoftwareSerial
for Bluetooth communication, allowing you to use digital pins for serial communication instead of the Arduino’s hardware serial pins (pins 0 and 1). Adjust pin numbers as needed. If you are not programming while the HC-05 is connected (recommended), you could potentially use hardware serial. - Baud Rate: Ensure the
bluetoothSerial.begin()
baud rate matches the communication speed of your HC-05 module. 38400 is a common value. - OBD2 PIDs:
0105
is the standard PID (Parameter ID) for coolant temperature. OBD2 PIDs are standardized codes used to request specific data from the ECU. - Response Parsing: The code includes basic response parsing. Robust error handling and more sophisticated parsing are recommended for a reliable application. OBD2 responses can vary slightly.
- Hex to Celsius Conversion: The formula
tempC = hexToInt(tempHex) - 40
is the standard OBD2 conversion for coolant temperature in Celsius. - Error Handling: Basic error handling is included, but more comprehensive error checking is crucial for a production-ready project.
- Libraries: Ensure you have installed the necessary libraries (
LiquidCrystal_I2C
, potentiallySoftwareSerial
).
Conclusion: Monitor Your Coolant Temperature Wirelessly
This project provides a foundation for building your own OBD2 Bluetooth coolant temperature display. By combining readily available and affordable components like an OBD2 Bluetooth module, Arduino, and an LCD screen, you can gain valuable insights into your vehicle’s engine temperature. This DIY project is not only a fun and educational endeavor but also a practical tool for car enthusiasts and anyone interested in monitoring their vehicle’s health. From here, you can expand the project to display other OBD2 parameters, create a more sophisticated dashboard, or even log data for further analysis. Understanding your car’s data opens up a world of possibilities for vehicle diagnostics and performance monitoring.