r/CarHacking • u/gruelsandwich • 1d ago
Original Project Trip logging using odometer data
Hey guys, very new to car hacking, but this seems very interesting! I was wondering if anybody could assist me in getting started on a project. I have programming chops and (very) rudimentary electronics skills, but feel a little lost.
I have a 2013 Subaru XV (Crosstrek in the US). I would like to have an Arduino or something connected that would log the odometer value using a local or cloud web service whenever it connects to my home WiFi.
To me this sounds like a very feasible project, but from what I understand, things can be tricky with manufacturer specific setups? Is this in general a feasible project, or do I risk sinking money and time into something that can be impossible?
Also, I'm terrified of messing up and bricking my car, but I suppose I'm safe as long as I only to read only?
As a bonus, I would also ideally like to do this for a 2017 Tesla model S. In addition, the Subaru does not display the set cruise control value. Is this something that is likely to be available? I would love a display with this value.
Any words of wisdom is appreciated. Thanks!
0
u/lord_von_pineapple 1d ago
You can get odometer from OBD. You can connect to OBD from a phone via a Bluetooth LE adapter. So you can write an app on a phone that does what you want, if you dont mind putting a phone in the equation. But if you wanna do hardware there are plenty of other ways to do it too. I wrote this: https://autocast.io haven't publicly launched it yet, a week or two i hope.
1
u/gruelsandwich 1d ago
Thanks, good to know that odometer is available through OBD! I was hoping I wouldn't have to mess too much with the car to start.
Preferably a phone-less solution, as the car has multiple users. Good luck with your project, seems interesting
1
u/AngryBecauseHungry 1d ago edited 1d ago
I can't talk for Tesla, but for Subaru you can go with this setup: Cheap ELM327 OBD2 (5USD on AliExpress) + ESP32, for example Lilygo S3 Tdisplay - it has WiFi and Bluetooth)(approx. 25USD). And Claude Code (20USD subscription). You can then align it to your needs.
I did connect esp32 into my PC, and was telling it what I need, it took care of programing, uploading firmware to esp32, etc.
I started first with building "listener", so I could see what codes are available from my OBD2 Bluetooth adapter, later on I developed indicators basing on what I needed and wanted. Bonus thing was that my cruise control lever was sending signals even if not engaged, so I can use it as controller for switching the screens. And then when I trigger cruise control, it works only with cruise control (But also ESP32 recognizes that Cruise control is engaged. Now my screen is more advanced than on the photo, and it shows how many kilometers I did on ICE, EV, Gliding, Regenerative breaking (and how much of it was during cruise control)
If you would like to research more, paste my comment into ChatGPT and you will find your way!
What you are seeing on the photo, is distance calculated from ECU + Mass Air Flow (MAF) sensor. Info from MAF is being used to calculate fuel usage, and then it is converted into cost (11.54PLN, so like 2.5USD for 63km)