Reading balance voltage off the Vin port

Hi all,

I would like to know if there is any way where I can measure the remaining voltage off the Vin port. My 7.4V lipo battery is connected to the Vin port instead of the battery port on the controller itself, so I can’t use the fuel gauge function as a measure of looking at the remaining voltage.

Thanks.

@NST1992, you could use a resistor divider to lower the voltage below 3.3v and use an analog input pin or use an I2C-based INA219 device.

@peekay123. Thanks, the voltage divider solution solved the problem. Appreciate your help :slight_smile:

1 Like

Hi @peekay123, Sorry to bother you again. It seems that particle electron can only perform analog read when its breathing cyan or connected to the particle cloud. When I tried to send the analog value back to my backend servers, it registered a 0 value even though the voltage passed into the analog pin is above 0 and below 3.3V.

Do you have any known issues of firmware v0.60 with the analog pins?

Have you set a SYSTEM_MODE() and/or are you using SYSTEM_THREAD(ENABLED)?
To run your app while not connected to the cloud you should consider doing so.

Hi @ScruffR ,I have set system mode in manual with this command, SYSTEM_MODE(MANUAL) and I have not enabled any system threads. However, i just switched the pin from A4 to B2 and it worked, but I don’t understand why.