8 years, 3 months ago.

Read supply voltage

Is there facility in the library, or planned for the library for reading the mDot supply voltage?

Thanks

Andrew

Question relating to:

Library for LoRa communication using MultiTech MDOT. Lora, mdot, multitech

2 Answers

8 years, 3 months ago.

Hi Andrew,

We don't have any support for this in the library at the moment and I think yours is the first request we've had for that feature.

Take a look at the STM32F411 reference manual page 212. There is an internal ADC channel connected to VBAT. We have VBAT connected to VDD on the mDot, so you should be able to use that mechanism to read the supply voltage.

Cheers,

Mike

Accepted Answer

Thanks Mike, I'll take a look. Is for a battery powered application, the mDot is currently running on a 3.6V Tadiran battery so deep sleep mode and the ability to monitor battery are important for this.

Thanks

Andrew

posted by Andrew Lindsay 14 Jan 2016

Andrew,

I just realized that we have a regulator (outside the processor) on the mDot. That means the VBAT voltage won't be your raw battery voltage, but the voltage coming out of the regulator.

Sorry for the confusion and hopefully that is still useful for you.

-Mike

posted by Mike Fiore 14 Jan 2016
8 years, 3 months ago.

You could always divide the input voltage by two using two resistors and connect it to an unused analog input.

That is an option, but was asking if there is anything in the mDot that already does this, not adding additional hardware.

posted by Andrew Lindsay 14 Jan 2016

I was guessing that given their input voltage range of 3.6 to 5V they have a regulator down to 3.3V on the board. In that situation the only way the CPU could see the raw input voltage would be if they had added a voltage divider and connected it to a pin already, it would seem a little odd to do that and then not mention it in the documents. Looking at Mike's reply my guess was correct.

You could still tell if the battery was getting below about 3.5V by using the built in voltage monitor Mike mentioned but at that point you're already out of spec.

Given your battery voltage of 3.6V I'm guessing you're using a Li based battery. Voltage is a terrible way to tell their charge percentage, between 90% and 10% it changes more with temperature than charge level. What temperature range do you need? You'll be over about 3.5 for most of your discharge range at room temperature, you may lose about 20% capacity but that's not too bad. Low temperatures are a different matter, around 0C you could easily drop below 3.6 (the min on the mDot spec sheet) while you're still 80% charged. (this is going from memory, it's almost 10 years since I had to worry about this issue)

posted by Andy A 14 Jan 2016

The ADC Vref is internally connected to Vcc in the F411. So reading Vbat would not work since Vbat and Vcc are the same level and the ADC would always report max count. Using an external pin with a voltage divider is the only way to monitor an external voltage. Also, because Vcc is regulated to 3V, this means the max voltage that the ADC can read is 3.0V on the MTDOT.

posted by Timothy Barr 14 Jan 2016