Tapatalk

Reading VBAT

Reading VBAT

15

PostOct 03, 2018#1

Hi,

To read the bat voltage i have to solder jumpers JP5 and JP7?
To make it the post power eficient possible  i should only place A0 to high when i whant to read pin A6 voltage and then back to low?
Is there any building lib function for it? I searched but didn't found one.
Sorry for the basic questions, but i prefer to ask before having some magic smoke :p

Thanks in advance

1885
1885

PostOct 03, 2018#2

No modifications are needed for that. If you look at the documentation some jumpers are already in place.

Just download and upload the voltage TX and RX example from Talk2 library to two boards. It demonstrates how to use this feature.

15

PostOct 04, 2018#3

Thanks for the help.
I used:
     uint16_t voltage = 0;
     voltage = T2Utils::readVoltage(T2_WPN_VBAT_VOLTAGE, T2_WPN_VBAT_CONTROL);
     Serial.println((7.282 * (voltage)) / 1024);
     Serial.println(voltage);

and i got 

9.87
1388

Im using a AA battery so i should get 1,5v, what i'm i missing?

1885
1885

PostOct 04, 2018#4

The function returns in millivolts. You're getting 1388 millivolts.

15

PostOct 06, 2018#5

Now i feel dumb... guess i need a better multimeter.
Thanks for the help