How can I access the Tracker One / SoM VIN voltage?
On the Tracker SoM, it’s the pin VIN, 3.9 to 17 VDC.
On the Tracker One, the enclosure is sealed. The VIN input is on the M8 connector, as VIN, however.
Unlike other devices like the Electron, VIN is not an output when powered by USB.
Thank you for your quick reply.
I understand the VIN specs but I was wondering if VIN is connected to a ADC pin?
And what is the voltage divider factor?
VIN_Voltage = (float)analogRead(VIN_PIN) * ADC_REF / ADC_RANGE * VIN_FACTOR;
Oh, there is no way to read the voltage of VIN using an ADC unless you connect an external voltage divider and connect the center to an ADC.
The value of the resistors will depend on the maximum voltage you expect on VIN. Use the voltage divider formula to reduce your maximum to 3.3V.
If your input voltage may have larger spikes, either size the voltage divider to the spike, or add external diodes to clamp the ADC to a maximum of 3.3V. A double-diode + 3.3V Zener diode TVS works well for this.
Be sure to size the resistors to be large enough so there won’t be excessive current flowing through the voltage divider. Making the total resistance across both resistors be greater than 100K will help with this.
If your VIN source is a battery, you may want to rethink the voltage divider approach entirely and use a chip designed to read the large voltage directly, which will eliminate the constant current loss through the resistor divider.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.