Weird voltage readings with Notecarrier X

Hi All,

I am using a Notecarrier X, with a 1600 mAh LiPo cell. The power is from a 5 volt supply connected to the VUSB pin of the notecarrier. The results are the same if I power it from the notecarrier USB port.

When the power is connected and the backup cell is charged, I call card.voltage and get a meaningful response such as usb=true; value=4.2, which agrees with my measurement of the battery voltage.

When I unplug the power I get USB=false but the reported voltage jumps to over 5.2 volts. As the cell discharges, the reported voltage stays high but, but the difference drops from over 1 volt to 0.3 of a volt. When the cell voltage is 3.5, the reported voltage is still around 3.8.

This did not happen with my old Notecarrier B based design.

Is there a way to get a reasonably accurate measurement of the cell voltage as it discharges? Am I doing something wrong?

Feature request: It would be really nice to be able to shut down a peripheral device, such as the MCU, when cell voltage gets low. Mine keeps browning out and restarting.

Thanks in advance,

Rob

2 Likes

Hi Rob,

I’ve been trying to reproduce your reported voltage jump up to 5.2V but I’m not seeing the voltage reading behave like that on my hardware. Would it be possible for you to share a photo of how the Notecarrier X is configured / connected?

I am however noticing that the readings for the card.voltage response seems to vary +/- ~0.3V from the true measured voltage of the cell. I wonder if this is perhaps the spike you are observing.

Regarding a more accurate measurement of cell voltage as it discharges, I’d recommend you take a look at the Mojo, our Notecard companion device for measuring Voltage and mAh in battery-powered systems. I’ve been testing Mojo alongside investigating your query and the Mojo is giving me a significantly more accurate value for Voltage (card.power) compared to the card.voltage request (using an external voltmeter to verify).

Below is the output from both requests when on battery power (with USB connected) on a Notecarrier X.

> {"req":"card.voltage"}
{
 "usb": true,
 "alert": true,
 "mode": "usb",
 "value": 3.461890327113012,
 "sync": true
}
> {"req":"card.power"}
{
 "temperature": 24.07709655761721,
 "voltage": 3.63740234375,
 "milliamp_hours": 2145.1854606000106
}

I’ll raise your feature request internally; it seems like a useful feature to have as a possible alternative function of the AUX pins on the Notecard. Perhaps something like setting it LOW or HIGH depending on a voltage threshold, which could then be tied to a MCU’s Power regulator’s ENABLE pin?

Thanks,
Alex

1 Like

Hi Alex,

That is interesting. I will give it a go. The jump seems to have gone. My old PlatformIO project used card.voltage and was always reliable. I will use that.

I am using a Seeed Xiao module which browns out when its main supply drops to 3.4 volts. I have overcome that problem with a boost regulator. This is a small volume thing, and power consumption doesn’t matter. The prime time unit will be more elegant.

The feature you mention would be really good depending on how much current could I draw from an AUX pin? The current kludge uses about 80 mA including indicator LEDs. Alternatively I could use a FET to cut power from the MCU, or use an input to tell the MCU not to try booting if the AUX pin is not asserted.

Thanks,

Rob

Hi again Alex,

I’m not really interested in using the Mojo. The backup needs to last 12 hours and it currently lasts 20, so there is no problem. I would like to get an approximate voltage reading so I can alert the user that mains power has been lost.

I am definitely getting inconsistent readings.

With USB connected, the reading is 4.24 volts and measured battery voltage is 4.19.

When discharging, the reading is 4.40 volts and the measured battery voltage is 4.15.

I am working with a sample of one, so I will need to try a few more examples before working out what to do.

Regards,

Rob

@rlkeith The Notecard uses an ADC on its internal STM32 to measure the voltage; this isn’t particularly precise or accurate, it’s intended to be a ‘free’ utility to provide a ballpark measurement of the voltage of the power supply. We do provide a card.voltage argument for calibration, which might help with the offset you’re seeing, but it’s designed to accommodate for the voltage drop of the diode between the battery and the Notecard (in the Notecarrier) rather than provide measurement improvements.

It sounds like you have the Notecarrier wired up in a standard configuration, but I might be missing something. If you could share a photo of how it’s set up, I can double-check for anything that might be related to this.

Regarding the discussed AUX feature, you’d need to use a FET because you can only safely source 20mA from an AUX pin.

Thanks,
Alex