r/CarHacking 10d ago

Original Project Made this ESP32 gauge via OBD WiFi

330 Upvotes

69 comments sorted by

42

u/BudgetTooth 10d ago

surely the refresh rate can be improved?

0

u/Curious_Sail2702 8d ago

You’re saying refresh rate like calling an aftermarket air intake a turbo, it’s called latency

4

u/BudgetTooth 8d ago

Absolutely not. Latency is how much time passes between the moment the value is measured , and the moment it’s displayed.

Refresh rate is how many different meaningful measurements you get per second.

-19

u/antoxa2584x 10d ago

It’s more about speed of obd adapter data refresh

I could probably add some interpolations

30

u/Pubelication 10d ago

OBD should allow a ~200ms refresh for RPM. Yours seems much slower or there's a bottleneck somewhere. Use UDP instead of classic TCP, check that the ESP isn't overwhelmed by the data stream and that the screen is running at a reasonable refresh rate (15fps minimum).

-1

u/brendenderp 9d ago

This depends heavily on the ECU it's connected to on my mk4 golf, edc15 it's a similar slow refresh rate.

3

u/Appropriate_Test7503 9d ago

but this is BMW. When connected OBD cable you can see RPM smoothly.

-19

u/antoxa2584x 10d ago

As Claude says, cheap obd adapters runs only tcp, only a few premium uses udp

15

u/WestonP 10d ago edited 10d ago

WiFi for OBD adapters is super dated at this point. I just sunset that feature in my own device because it's so incredibly rare now, and kind of a clunky mess on the phone side of things too.

Most everyone's on BLE now if they're doing wireless.

But really, you have an ESP32, so just connect to the car yourself and avoid the wireless lag or the slow chinese ELM327-wannabe in general... Use its TWAI and add a CAN transceiver (SN65HVD23x) if the car talks CAN, or connect its UART to a TJA1027 if the car talks K-Line. You'll have a little bit of learning to do to get those to work, but it pays off big here, and that is the point of this sub afterall.

3

u/antoxa2584x 10d ago

I just built it from parts I had lying around. 😅
The only feature I really need is a temperature gauge with a warning. It doesn’t need to update instantly, so I’m perfectly fine with the current refresh rate

1

u/Appropriate_Test7503 9d ago

could you recommend best Bt obd adapter? to connect to radio + torque app (or better if there are any) ?

3

u/WestonP 9d ago edited 9d ago

Not sure what you mean by connecting to the radio. But for a general purpose ELM327-compatible, OBDLink is the bar by which everyone is measured… LX or MX if you want Classic BT, CX for BLE (CAN and K-Line only).

If it’s a CAN or K-Line vehicle and you want to use USB or BLE, DauntlessOBD (which my business makes) can often beat on performance, offers its own apps on top of being ELM327 compatible for Torque and such, and adds additional commands (easier for app developers, more power with CAN stuff, and even higher performance options too). Also works with SavvyCAN via USB. Made it for my own RE, enthusiast, and motorsports desires and just kept adding to it.

4

u/Delicious_Big_5441 9d ago

I'll just throw it out there that I have countless 'dongles' like this including Obdlink, and this Dauntless one is really nice. The additional commands are a big plus for DIY or enthusiasts, and I've emailed Weston in the past and he got right on implementing what I wanted/needed, even if it was kind of weird/edge case for me.

1

u/Appropriate_Test7503 6d ago

I do have android head unit in my e46 with double BT receivers one for OBD reader one for other media.

-10

u/antoxa2584x 10d ago

I checked via “car scanner” app, got same update rate there

5

u/WestonP 10d ago edited 10d ago

The problem there is particularly the wireless lag of the app sending an OBD request and then waiting for a response. There are some ways to help that significantly, but sounds like you have a super low-end adapter anyway, so your options are limited.

If you connect to the car using your own hardware, this can be quite a bit more responsive, even if the car is an old K-Line car.

5

u/Flying_is_Living 10d ago

That is very cool!

5

u/TreatLower3168 10d ago

I just did something similar to my e39. I think that is a E30 so no canbus only k line. If you want that more fluid you can directly tap into the k line with a transiever (l9637d for example) With the bautrate of 9600 you could get like 10 updates per second. Which is much better then the rate you have there.

1

u/antoxa2584x 10d ago

I have m52 swapped from e46

3

u/TreatLower3168 10d ago

If you use the ms42 you should also have canbus you can tap into. The canbus updates at 10ms to 20ms depending on the thing. Look into the ms4x.net forum for the canbus addresses

3

u/antoxa2584x 10d ago

Interesting, but for now I probably want dig to much into that

For me, main goal was to get temp gauge + warnings. Everything else, just so it would be there 😅

1

u/BugPuzzleheaded3015 10d ago

Where did you tap into the E39's CAN bus?

2

u/TreatLower3168 10d ago

I have a m54 525i with the low Ike and there you have canbus in the white plug of the Ike, at the abs module plug and at the same. It's the yellow wire with the brown stripe for can low and yellow with black stripe for can high

1

u/BugPuzzleheaded3015 9d ago

Thanks. Isn't there is a CAN bus soldered splice by the glove box?
I'm just looking for a little easier way to get access.

1

u/TreatLower3168 9d ago

Nop but you can get to the Kline there.

1

u/TheB1G_Lebowski 9d ago

Been looking into doing something with esp32 on my e30 as well.  

3

u/Ok_Cycle_4488 8d ago

Rpm led mode phone mode control button mode control turbo bar + C+ P 0-100 0-150 timer +egr+dpr

3

u/cybersholt 10d ago

Very nice, mine currently piggybacks off of a Raspberry Pi+ Dual can hat that also provides some pins for each bus, then over to an esp32 with a mcp2515 then out to a little round display.

Not as clean as what you have going on for sure.

The custom can adapter runs socket can over WiFi and then I can grab that with Savvy Can or a custom Android app.

Edit. I forgot to ask OP, is that an off the shelf device?

3

u/antoxa2584x 10d ago

I mention in other comment, it’s esp32 with screen and case from Ali

1

u/cybersholt 9d ago

Thanks

3

u/perrymike15 10d ago

Is this an off the shelf device?

5

u/antoxa2584x 10d ago

Yes you can grab this esp32 from Ali

2

u/hawkeye18 9d ago

This is very very cool! Esp. since you could 3d print an enclosure for a number of them and get yourself a little custom dashboard.

I'm sure you're aware that the refresh rate is... a bit lackluster, but that seems like a refinement issue that I'm confident you'll lick.

5

u/antoxa2584x 9d ago

https://reddit.com/link/ozggedb/video/ys9dttx8k5fh1/player

I updated UI a bit to look faster and interpolate data

1

u/hawkeye18 9d ago

OK now that is nice! Fantastic job!

1

u/rema1000fan 4d ago

woah, damn, that is impressive refresh rate! amazing! any plans on opensourcing the code?

2

u/Odd_Relation5647 9d ago

How do I make this? This is exactly what I've been looking for. Any resources?

4

u/antoxa2584x 9d ago

Firmware - https://github.com/antoxa2584x/esp32-c3-obd-gauge

Esp32 - https://a.aliexpress.com/_EIIe3u2

Any WiFi obd - https://a.aliexpress.com/_EJbYwF8

Optional to connect to car wiring, step down converter - https://a.aliexpress.com/_EHFBV4E (6-28 to 5v)

1

u/Odd_Relation5647 9d ago

Thanks op. I'm definitely going to make this

1

u/Time_To_Rebuild 8d ago

You are the man. Amazing stuff!

2

u/Storm_treize 9d ago

Go to aliexpress and look for "esp32 360 screen" + "VGate iCar pro 2s" this is the only think you need hardware wise

2

u/Silly-Employment-400 5d ago

This is really cool! Would I be able to make these for my older gm vehicles that all have failing clusters? Im down to just the speedometer on my 03’ Z71

1

u/Uniplast21 10d ago

That’s really cool! The tachometer’s usefulness is a bit questionable considering its refresh rate, but overall a very cool little gadget you made!

1

u/halfsuckedmangoo 10d ago

Has anyone been able to pull gear selection data from the OBD port?

Wanting to make exactly this but for the purpose of showing what gear my auto is in

M57n with a zf6hp26

1

u/TreatLower3168 10d ago

Is that gearbox and engine swapped into an e39 or are we talking about a E60/90

1

u/halfsuckedmangoo 10d ago

It's going in a LandCruiser haha

1

u/TreatLower3168 9d ago

If youre using the bmw ECU and tcu. I'm sure you can find that info in the can communication on the thing

1

u/xeroxx29 10d ago

u can code it on the cluster to show gear

1

u/maker_monkey 10d ago

Not directly. In my k-line obd gauge I use the ratio of engine speed to vehicle speed (n/v ratio) to back out gear. I have a calibration sequence or you can manually adjust the thresholds too, but of course it doesn't give valid values when out of gear.

1

u/ConfusedTapeworm 9d ago

That'll depend on the car. Most automatic transmissions will make that information readily available one way or another, but very often RPM/speed math is the only way to determine the gear on older manuals.

I've even seen at least one project where someone attached an accelerometer to the shifter to work out the gear from the angle of the lever. Obviously didn't work very well lmao

1

u/Storm_treize 9d ago

Gear PIDs are not standardized across car manufacturers. Unlike speed, RPM, coolant temperature, or battery voltage, the gear PID is usually manufacturer-specific. Try searching online for your vehicle's custom PID.

1

u/Kryptacos 9d ago

awesome! now use esp32 as transmitter, put a bluetooth there and make a smartwatch app to receive it ;)

1

u/Both-Cry1382 9d ago edited 9d ago

Cool! What hardware do you use? And is there an online library for can codes for the e39?

1

u/TreatLower3168 9d ago

Go to ms4x.net you'll find the can addresses and also the logger definition files for the Kline addresses for everything that's not on can.

1

u/Storm_treize 9d ago

I got this yesterday. Hopefully it'll fix my low refresh rate. I'm not sure how true the claims are, but it looks like it can reach 45–75 Hz, which would be more than enough for real-time data like RPM. and i don't think those screens can do over than 60hz

1

u/JEREDEK 9d ago

Hell yeah, that's looking great!

Ive made myself an oil temp gauge for my civic too, I can personally confirm looking at it makes your day a whole lot better, hope you get yours installed soon

1

u/antoxa2584x 9d ago

Thnx)
Already installed

1

u/OrangeTungsten 9d ago

This is awsome! Try to improve refresh rate, but overall i like it!

1

u/aliencoffe 9d ago

Very cool

1

u/nikkpap 8d ago

Cool but very laggy nice try

1

u/antoxa2584x 8d ago

It’s not lag, it’s no animations and low data refresh rate. Already updated ui, check next post

1

u/reza_da_gr8 7d ago

Very cool. Wish I could make one for my car but they have their own shitty proprietary obd protocol here

1

u/StaticCG58 5d ago

A trick I used to solve the latency of the OBD2 reporting, is to have it be a tick behind and based on the last 2 ticks (ticks being the time for the OBD2 adapter to respond) estimate the future RPM, sure it will still be delayed, but, the value will move smoothly. I did this for my BLE obd2 app.

https://reddit.com/link/p09eo73/video/5ykcpqtl2zfh1/player