Reading Lipo Voltage

I’m testing a mini LiPo battery to see how long it will power a Jeenode. I bought this battery:

It is listed as a 3.7V, 120mAh 1S 14C LiPo battery. It is mainly used in mini RC helicopters.

It appears to have a JST-XH series connector which mates with a JST micro male.

I want to read the voltage of the battery as it runs the sketch.

Connecting a voltage divider to an analog pin allows me to read the voltage of the LiPo. Since:

Vin might be as high as 4.5V. So if R1=4.7k and R2=10k, we get a divider that should give us a range below 3.3V for the analog read. Vin of 4.5V would give a Vo of 3.06V.

To get voltage out we would then need to take the analog read of the pin, map it to 3.3V and divide it by the 0.68 from the resistor dividor. Or:

int volts = (map(led.anaRead(),0,1023,0,3300))/0.68;

The 3300 comes from the 3.3V analog internal reference voltage of the Jeenode.

Fully charged, according to the LiPo charger results in a reading of 4202 or 4.2V. Perfect.

Update: It appears the connector is a micro min JST connector. I can’t find a matching connector from JST, but there are cables on Ebay. JST website isn’t the best to find products…