M5Stack OBD2 Bluetooth Connection: Seeking Guidance for a DIY Car Diagnostics Project

I recently purchased an M5Stack Grey with the exciting idea of using it for a custom car diagnostics project. While I have some experience with Arduino-like platforms, specifically using a Teensy in C for a gaming mouse project, delving into OBD2 and Bluetooth communication is new territory for me.

My goal is to replicate a project similar to the one described in this guide: https://sites.google.com/site/grcbyte/electronica/arduino/obdii-bluetooth. Essentially, I want my M5Stack to wirelessly communicate with an OBD2 (ELM327) scanner via classic Bluetooth. The aim is to retrieve real-time engine data, such as RPM, and display it on the M5Stack screen, updated continuously.

Imagine this setup: the M5Stack and OBD2 scanner are in my car. Upon ignition, the M5Stack automatically connects to the OBD2 reader, requests data, and displays it on its screen. While the potential for displaying various car parameters is vast, I’m starting with something simple, aiming for a shareable project for friends who also own older cars that may not be compatible with off-the-shelf OBD2 displays.

Following the guide, I understand most of the steps for interfacing with the OBD2 scanner and displaying data on the M5Stack. However, I’m encountering a roadblock right at the beginning – with the AT commands necessary for Bluetooth setup.

I’ve installed ESP-IDF and explored the AT application available here: https://github.com/espressif/esp32-at. Frankly, it seems overly complex and there’s a steep learning curve associated with it. Looking at examples using the HC-05 Bluetooth module, the AT command process appears much simpler. In fact, I’ve ordered an HC-05 as a backup and to get a quicker start to my project, as establishing the Bluetooth connection is the first hurdle.

With the HC-05, sending AT commands seems straightforward – press the AT button, use serial communication, and you’re in. But with the M5Stack and its built-in ESP32 Bluetooth, there’s no physical button, and I’m unsure if the firmware readily supports all the necessary AT commands. It doesn’t seem to be a simple button-press and command-send procedure.

Ideally, I’d prefer to utilize the M5Stack’s integrated Bluetooth. It seems inefficient to add an external HC-05 when the M5Stack already has Bluetooth capabilities.

I’ve watched these videos, hoping for clarity: https://www.youtube.com/watch?v=HBrEMIzm_uY and https://www.youtube.com/watch?v=j6lNyjQ4x0Y. However, they introduce complexities, like using dual USB ports for flashing and AT commands, which I don’t fully grasp.

I must admit, the difficulty has surprised me. I anticipated a smoother initial setup. Perhaps it is easy, and I’m simply missing crucial information amidst the vast resources available. It feels like finding a needle in a haystack when you’re trying to achieve one specific task within a broad ecosystem.

Therefore, my core question is: Am I on the right track using esp32-at for establishing this Bluetooth OBD2 connection with my M5Stack? Or is there a more streamlined, perhaps simpler method that I’ve overlooked? Any guidance or pointers would be greatly appreciated as I navigate this DIY car diagnostics journey.

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 *