Reputation: 21
I'm developing an mobile app for OBD2 dongle using BLE, but I am facing trouble in getting the battery voltage of the car. Firstly, I am unable to find any specific PID for battery voltage and second I have tried some PIDs which I found on wiki but they are not giving the appropriate data. Also there is some thing called 'Control module voltage' PID: 42, don't know whether this and battery voltage is same or not.
Upvotes: 1
Views: 12913
Reputation: 4684
First, welcome to StackOverflow!
One thing to keep in mind when working with OBD2 is that implementation of the actual PIDs is completely optional, i.e. it is up to the vendor whether they want to export these values. That said, there are two ways to gather battery voltage:
1.) Via the control command ATRV. This is useful on ELM327 (and compatible) chipsets. Use it like that:
> ATRV
12.8V
2.) As you have found out, via the PID 0142
(control module voltage is supposed to be the same as the battery voltage). Make sure you check 0140
to find out whether it's implemented or not. If so, you will receive two bytes (A and B), which result in the voltage by computing (256A+B) / 1000.
Upvotes: 1