someone22

Well-Known Member
Joined
Jan 10, 2025
Threads
8
Messages
67
Reaction score
56
Location
Europe
Vehicles
2022 PE AWD
I started implementing this feature a few days ago. IT basically uses an ESP32 to connect to a cheap Bluetooth OBD2 dongle (usual name is ELM327 V2.1). Today the CYD (cheap yellow display) got in the mail and ported the UI to the new board.

The reason is that I cannot seem to activate the power meter display in the IPC and can't connect the iPhone to the OBD2 dongle nor want to dedicate another phone or a CarPlay window for this.

The board ($15.28 on ali right now) connects to an OBD2 dongle ($2.9-8) and reads car data as fast as possible, specifically the instant power. Every 1.5s the front and rear motor data is read, every 5s some other slow-changing piece of data. Right now that includes real SoC, internal temperature, battery temperature, battery cooling mode.
The board can be left plugged into the USB port, I also leave the OBD dongle always connected. When the car powers up, the board will spend some time connecting to BT (~20s in my case) then it starts displaying the data in realtime. Power is updated about 10 times per second.

https://shorturl.at/yLqDm

Still left to do:
- 3D print a case that will integrate nicely with the car. Perhaps a UI redesign is needed if I find out that a vertical orientation is better
- trip meters are not implemented, might be a bit tricky to get a reliable value but let's see. Low priority
- handling of different adapters or BT timeouts. A reset now is the only way for the latter.
- second screen (it's a resistive touchscreen) with more data such as LVB voltage and SoH, HVB SoH, motor temperatures, AC or DC charger values, etc. Not sure what would be useful.
- sometimes the motor power (primary?) jumps to negative maximum, perhaps another quirk of the protocol
- day/night theme
- day/night detection from OBD and/or luminance sensor
- initial BT connection might be tricky since it requires a pin (1234), one time, afterwards it works
- animation for values instead of jumping


If there's enough interest and people are willing to test for themselves or even contribute changes, I will open-source the project on github. If there's no interest, I will publish it later anyway.

UI design v0.2
Ford Mustang Mach-E [WIP] Cheap power meter for those unlucky ones 1747751930581-yk


The photo below is from the demo mode, hard to debug all the power ranges in the car and also take a photo.

Ford Mustang Mach-E [WIP] Cheap power meter for those unlucky ones 1747751574514-a


The board and dongles look like these, surely available on the jungle site as well:

Ford Mustang Mach-E [WIP] Cheap power meter for those unlucky ones 1747751686256-uy
Ford Mustang Mach-E [WIP] Cheap power meter for those unlucky ones 1747751787800-hm
Sponsored

 
Last edited:

A-A-Ron

Well-Known Member
First Name
Aaron
Joined
Mar 23, 2022
Threads
16
Messages
1,021
Reaction score
2,808
Location
DFW, TX
Vehicles
'21 MME Premium 4X
Country flag
Very cool. I'd considered doing a project just like this but never found the time.
 
OP
OP

someone22

Well-Known Member
Joined
Jan 10, 2025
Threads
8
Messages
67
Reaction score
56
Location
Europe
Vehicles
2022 PE AWD
Just tested it with the new board inside the car and had to debug 1h because of the quirky BT. It could be a two-step process for new users, since the PIN only has to be entered once.

The display quality is not so good in daylight and seems a bit dim. I'm sure there's a pin (21) which controls brightness but not sure what the default value is. Anyway, for daylight there should be a different theme, either switchable automatically or at least with a button/touch or some boards have a luminance sensor.

The UI is done with EEZ Studio, pretty easy to modify even by someone without coding knowledge. The code will still need to be generated and compiled, but at least the design file is highly portable.

There's a TF slot, it can be used to log driving data for example.

Anyway, I will play with it for the following days and update the more important things in the first post.

Ford Mustang Mach-E [WIP] Cheap power meter for those unlucky ones 1747760460049-dc
 

hack-e

Well-Known Member
First Name
Mark
Joined
Mar 5, 2022
Threads
14
Messages
892
Reaction score
782
Location
Austin, TX
Vehicles
2022 Prem AWD ER MME
Occupation
Robotics Engineer
Country flag
GitHub please. I am interested in tinkering with something like this.
 

ShoreTang

Well-Known Member
First Name
Michael
Joined
Jul 27, 2023
Threads
1
Messages
58
Reaction score
37
Location
USA
Vehicles
2023 Mach-E GT
Occupation
Engineer
Country flag
I’m interested in trying it too. Please place on GitHub. Also a BOM is requested. Thank you.
 


OP
OP

someone22

Well-Known Member
Joined
Jan 10, 2025
Threads
8
Messages
67
Reaction score
56
Location
Europe
Vehicles
2022 PE AWD
Github link: https://shorturl.at/yLqDm but I haven't had a chance to clean up any of the code.
I don't have a BoM but this board is what I've used: https://www.aliexpress.com/item/1005006985049090.html - there are many similar.
The OBD dongle was something cheap I got many years ago off of Amazon/eBay (EU), something similar to this https://www.aliexpress.com/item/1005005758630166.html (v2.1). Newer ones might work better. WiFi ones probably not. My dongle doesn't work with iOS if that's any indication, so I assume it's using the older SPP (bluetooth serial protocol). Anything supported by ELMDuino ( https://github.com/PowerBroker2/ELMduino ) should work with minimal or no changes.

EDITL if some of you have the board or are looking into buying it but have no interest in messing arround, I can provide the firmware and some easy instructions to set it up. It should be this product I assume https://www.amazon.com/DORHEA-Touchscreen-ESP-WROOM-32-Bluetooth-Development/dp/B0DBQB2YV5 (2 for 1) and possibly this one https://www.amazon.com/KVAEY-Car-Auto-Diagnostic-Scanner/dp/B0DKN9VL8Y
 
OP
OP

someone22

Well-Known Member
Joined
Jan 10, 2025
Threads
8
Messages
67
Reaction score
56
Location
Europe
Vehicles
2022 PE AWD
As a side-note, as of now, the power display is updated about 5-10 times per second which is not optimal. It was my first day with EEZ Studio and my third day with LVGL, animations are possible but doesn't seem like the Studio is up to the task and my coding attempt ended up using almost 100% of the CPU. My attempt was to fake the animation (interpolating) between the steps, which is what manufacturers do anyway.
 

N1naz

Well-Known Member
First Name
George
Joined
Aug 16, 2024
Threads
32
Messages
170
Reaction score
152
Location
New Hampshire
Vehicles
2023 Mach-E BD-23/Sep/2023
Occupation
Retired
Country flag
Can we include the SoC of the LVB (12V) and its Voltage.

George
 
OP
OP

someone22

Well-Known Member
Joined
Jan 10, 2025
Threads
8
Messages
67
Reaction score
56
Location
Europe
Vehicles
2022 PE AWD
The display is already crowded and it's not information that changes very fast anyway. There are plans for a second screen as I wrote and you would just be able to scroll left and right.
 

JohnFoxeSheets

Well-Known Member
First Name
John
Joined
Jan 29, 2022
Threads
28
Messages
3,406
Reaction score
5,504
Location
San Francisco
Website
johnfoxesheets.com
Vehicles
2022 Iced Blue Silver Mach E GT
Occupation
Retired Engineer
Country flag
There are plans for a second screen as I wrote and you would just be able to scroll left and right.
Oh, I initially misunderstood your "second screen" to mean second display! I agree that info that doesn't change often could easily go to a secondary screen. Have you tested the touchscreen yet? I'm not sure if resistive ones support swiping per se.

I enjoy doing 3D CAD and I also recent got a 3D scanner, so if you would like help with the housing design, let me know.

Regarding the BT OBD II dongle, it would be a good idea to ensure that not just any device can connect to it. I heard of issues with cars being hacked via OBD dongles. Probability of this happening is certainly low, but I opted for a BT dongle that requires pairing be initiated with a button on the dongle...
 
OP
OP

someone22

Well-Known Member
Joined
Jan 10, 2025
Threads
8
Messages
67
Reaction score
56
Location
Europe
Vehicles
2022 PE AWD
Thanks for the offer, it would be nice of you, of course if you have the board and use for it. I generally use OnShape as the work can easily be shared and was easy to pick up. I don't know yet what a good placement is, but thinking about vent clip keeping it above and to the right of the power button. I think a portrait orientation makes more sense, especially w.r.t. the power wire.

The screen already reacts to scrolling, you just have to press a bit harder. But it doesn't change the screen yet, it snaps back into the center position.

Agree, leaving an OBD2 dongle all the time unattended is not good practice. I don't think multiple clients can connect to it though. While the vehicle is off, only the battery voltage can be read and not much else can be done.
 
OP
OP

someone22

Well-Known Member
Joined
Jan 10, 2025
Threads
8
Messages
67
Reaction score
56
Location
Europe
Vehicles
2022 PE AWD
I spent more time today and basically the entire thing was refactored. So the GitHub repo is already very obsolete.
- switched to LVGL9 from 8, which means meters are not available anymore so had to improvise
- switched to vertical orientation since it makes more sense
- the board has a luminance sensor, it's barely functional but good enough to detect day/night so..
- ..implemented dark and light themes with different backlight values as well
- fixed erroneous values caused by wrong/missing OBD header (not all commands have the same header)
- removed motor power and replaced with torque (faster readings)
- added LVB voltage, current, SoC, added cooler/heater power (not sure what it does), motor coil temperatures; they need more testing
- inching closer to a fast connection with BT ELM327, now down to <5s, by hardcoding the BT MAC address and channel

Next step is to 3D print a case and a mount and figure out what luminance values make sense when inside a case, after which I can start testing.

Would be interesting to see if the battery voltage is stable under load so I don't have to read it so often, then I would increase the motor torque frequency reading. Honestly, all those extra values are pretty useless long-term, but there was space on the UI for them until something more interesting appears.

Ford Mustang Mach-E [WIP] Cheap power meter for those unlucky ones 1747865928284-q
Ford Mustang Mach-E [WIP] Cheap power meter for those unlucky ones 1747865969798-q
 

JohnFoxeSheets

Well-Known Member
First Name
John
Joined
Jan 29, 2022
Threads
28
Messages
3,406
Reaction score
5,504
Location
San Francisco
Website
johnfoxesheets.com
Vehicles
2022 Iced Blue Silver Mach E GT
Occupation
Retired Engineer
Country flag
Thanks for the offer, it would be nice of you, of course if you have the board and use for it. I generally use OnShape as the work can easily be shared and was easy to pick up. I don't know yet what a good placement is, but thinking about vent clip keeping it above and to the right of the power button. I think a portrait orientation makes more sense, especially w.r.t. the power wire.

The screen already reacts to scrolling, you just have to press a bit harder. But it doesn't change the screen yet, it snaps back into the center position.

Agree, leaving an OBD2 dongle all the time unattended is not good practice. I don't think multiple clients can connect to it though. While the vehicle is off, only the battery voltage can be read and not much else can be done.
I'm not sure I'll make this myself, but I'm happy to help just the same. That said, I don't know about clipping it to a vent. That tends to be hard to do (well), and it also means either entirely losing a vent or partially doing so, plus potentially heating the monitor. Not sure that's a great way to go. I've not looked at my interior to see what I think would work better, but I feel confident we can find somewhere.
 
OP
OP

someone22

Well-Known Member
Joined
Jan 10, 2025
Threads
8
Messages
67
Reaction score
56
Location
Europe
Vehicles
2022 PE AWD
The board is light (around 75g - 2.6oz), but there is the cable that's dragging down as well. There are thinner cables since only very light power is needed. The clip would clip it to the vent but the board would stay higher than the vent and only about 10-25% from the vent would be covered.

I never liked vent clips and don't have any ideas to bring it into the field of view. Adhesive sounds like a mess. Clipping to the display is risky because of the piano black. The only other visible place is to the left, which means routing the power wire or getting power from somewhere else.

I don't have any better ideas for now. I will try to improvise something and afix a GoPro, filming with a phone while driving and keeping the camera framed on that small thing proves almost impossible.

Ford Mustang Mach-E [WIP] Cheap power meter for those unlucky ones 1747899258198-gc
Sponsored

 
 







Top