I was able to get the battery voltage using FuelGauge getVcell. However, is there a way to get the voltage at the Vin of the M8 connector?
It’s not possible. While the voltage on the M8 is limited to 30V because of the connector specs, the Tracker One power supply is actually rated to 90V if you use the B8B-PH connector inside (or just the carrier board). But you can’t measure the voltage.
@cloud_nine YES, there is a way, if you are inclined to do one (easy) modification:
- The Tracker One had a “useless” internal user button that you cannot access. (item 13 on the particle Tracker One internal picture, link below)
- This button is connected internally to the useful : A1 analog input.
- VIN is protected by an input diode. So your measurement will be “behind” this diode, you have to keep it mind the Vdrop through the diode when you measure it.
- On the same picture, you’ll see two open vias next to number 3. One is VIN (minus the protection diode drop), the other is GND.
- Make a simple voltage divider with two resistors, and connect it to these two points. (to adjust your Vin range to 0-3.3V, which is the safe range of A1 analog input reading).
- Connect this new 0-3.3V signal to the “user” button leg that is going to A1. (I think it’s bottom right on the picture).
Here you have your Vin reading!
I use it in a vehicle, to detect if the alternator is running (14V), or if the tracker is just feeding from the 12V battery (below 12.8V). Works perfectly.
Have fun! (and make sure to calculate your voltage divider correctly).
NOTE: you now lost your useless “user” button.