Monitor Your Car’s Health Wirelessly: OBD2 Bluetooth, Android Torque & Node-RED

Are you fascinated by what’s happening under the hood of your car? Want to access real-time data about your vehicle’s performance and health right on your phone or even display it on a custom dashboard? With the power of OBD2 Bluetooth adapters, the Torque Pro Android app, and Node-RED, you can unlock a wealth of diagnostic information and create your own car monitoring system.

This guide will walk you through setting up a system to wirelessly transmit data from your car’s OBD2 port to Node-RED, a powerful flow-based programming tool. We’ll focus on using a Bluetooth OBD2 adapter, the popular Torque Pro app for Android, and Node-RED to visualize and even log your car’s data.

What You’ll Need to Get Started

Before we dive into the setup, gather the necessary components:

  • An OBD2 Bluetooth Adapter: These inexpensive adapters plug into your car’s OBD2 port (usually located under the dashboard) and transmit data wirelessly via Bluetooth. Make sure it’s compatible with Android devices.
  • An Android Smartphone or Tablet: You’ll need an Android device to run the Torque Pro app.
  • Torque Pro App: This powerful OBD2 app is available on the Google Play Store and is essential for reading and transmitting data from your OBD2 adapter.
  • Node-RED: A free, open-source flow-based programming tool. You can run Node-RED on various platforms, including Raspberry Pi, computers, or cloud servers. Ensure Node-RED is installed and accessible on your network.
  • A Web Browser: To access your Node-RED dashboard and view the car data.

Step-by-Step Guide: Connecting Torque Pro to Node-RED

Let’s break down the process into manageable steps:

1. Connect Your OBD2 Bluetooth Adapter

  • Plug your OBD2 Bluetooth adapter into your car’s OBD2 port.
  • Turn your car’s ignition to the “ON” position (no need to start the engine for initial setup).
  • On your Android device, go to Bluetooth settings and pair with your OBD2 adapter. The adapter’s name usually appears as “OBDII” or similar. The pairing process might require a PIN, often “1234” or “0000”.

2. Configure Torque Pro for Web Server Upload

Torque Pro is incredibly versatile and allows you to send data to various destinations. We’ll configure it to send data to Node-RED via HTTP.

  • Open Torque Pro app on your Android device.

  • Tap the Settings icon (usually a gear icon).

  • Navigate to Data Logging & Upload.

  • Check the “Upload to web server” option.

  • Tap on “Webserver URL”.

  • Enter the URL of your Node-RED HTTP endpoint. This will be in the format http://your.node-red.server:1880/torque/. Replace your.node-red.server with the IP address or hostname of your Node-RED server and ensure the port 1880 is correct if you haven’t changed the default Node-RED port. The /torque/ part is the endpoint we will configure in Node-RED.

    Alt text: Screenshot of Torque Pro app’s Data Logging & Upload settings, highlighting “Upload to web server” and “Webserver URL” options.

  • Select “What to log” and choose “All PIDs” or customize it to select specific parameters you want to monitor. PID stands for Parameter ID, which represents specific data points from your car’s computer, like RPM, speed, coolant temperature, etc.

3. Set Up Your Node-RED Flow

Now, let’s configure Node-RED to receive and process the data sent by Torque Pro.

  • Access your Node-RED interface in your web browser (usually at http://your.node-red.server:1880).

  • Create a new flow or open an existing one.

  • Drag and drop an “http in” node from the input palette to your flow.

    • Double-click the “http in” node to edit its properties.
    • Set the Method to “GET”.
    • Set the URL to /torque. This must match the endpoint you configured in Torque Pro.
    • Click “Done”.
  • Drag and drop an “http response” node from the http palette to your flow and connect it to the output of the “http in” node.

    • Double-click the “http response” node.
    • In the Headers section, add a header with Name as OK! and leave Value empty. This sends a simple “OK!” response back to Torque Pro, which Torque Pro expects to confirm successful data transmission.
    • Click “Done”.

    Alt text: Screenshot of Node-RED flow editor showing “http in” node configured with URL “/torque” and “http response” node with “OK!” header.

  • To visualize the data, drag and drop “gauge” nodes from the dashboard palette for each parameter you want to display (e.g., RPM, Speed, Coolant Temperature).

  • Connect “change” nodes between the “http in” node and the “gauge” nodes to extract specific data points from the incoming JSON payload and map them to the gauge inputs.

    For example, to display RPM:

    • Drag a “change” node and connect it after the “http in” node.
    • Double-click the “change” node.
    • In “Rules”, add a rule: Set msg.payload to payload.kc (assuming kc is the PID code for RPM reported by Torque Pro – you may need to adjust this based on your car and Torque Pro configuration). You might need to use the “move” operation instead of “set” depending on your Node-RED version.
    • Add another rule: Set msg.topic to torque/vehicle/rpm (this is for organization and can be customized).
    • Click “Done”.
    • Connect the output of this “change” node to the input of a “gauge” node.
    • Configure the “gauge” node with appropriate labels, units, and ranges (e.g., Title: “RPM”, Label: “RPM”, Min: 0, Max: 7000).

    Repeat this process for other PIDs you want to monitor, using the correct PID codes from Torque Pro (you can find these in Torque Pro settings or online OBD2 PID lists) and creating corresponding “change” and “gauge” nodes.

  • Deploy your Node-RED flow by clicking the “Deploy” button in the top right corner.

4. Start Your Car and Monitor the Data

  • Start your car’s engine.
  • In Torque Pro, ensure data logging is active. It usually starts automatically when you configure web server upload.
  • Access your Node-RED dashboard in a web browser (usually at http://your.node-red.server:1880/ui).
  • You should now see real-time data streaming from your car, displayed on the gauges in your Node-RED dashboard!

Expanding Your Car Monitoring System

This setup is just the beginning! You can further enhance your system:

  • Data Logging: Use Node-RED nodes to store the incoming data in databases like MySQL or InfluxDB for historical analysis and trend tracking. The original code snippet included MySQL integration as an example.
  • MQTT Integration: Use MQTT nodes in Node-RED to publish the car data to an MQTT broker, allowing you to integrate it with home automation systems like Home Assistant or openHAB. The provided code also shows MQTT output configuration.
  • Custom Dashboards: Create more sophisticated and visually appealing dashboards in Node-RED to display a wider range of data and customize the presentation.
  • Alerts and Notifications: Set up rules in Node-RED to trigger alerts or notifications (e.g., email, SMS) based on specific data conditions, such as high coolant temperature or low battery voltage.

Conclusion

By combining an OBD2 Bluetooth adapter, the Torque Pro app, and Node-RED, you can create a powerful and customizable car monitoring system. This setup allows you to tap into the wealth of data available from your car’s OBD2 port, visualize it in real-time, and even integrate it with other smart home or data logging systems. Start exploring the possibilities and gain deeper insights into your vehicle’s performance and health today!

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *