Notecarrier B v3.1 LiPo charging status?

Hi -

I have a Notecarrier B v3.1 (yep, I know I need to transition to the XM) with a Notecard LoRa. My plan is to have this run from a LiPo battery. My understanding is that the Notecarrier B has the capability to charge the battery. So … I have the battery connected to the Notecard, which is also connected to USB … and I presume that the battery is being charged. But how do I know? There doesn’t seem to be any indication of charging/charged status. I see that @drewcssv asked a similar question a while ago, regarding the Notecarrier F, and one suggestion was to use the {“req”: “card.voltage”, “mode”:”?”} command, which of course I can do via the online monitor at dev.blues.io, since I have the USB plugged into a laptop. But that gives the response {“value”: 4.653…, “usb”: true} because the USB is connected - not much help in figuring out whether the LiPo is charging/charged. Any suggestions?

Hi @darkerenergy

Beyond using card.voltageto see the Voltage is above the LiPo’s (5 V USB > 4.2 V for a charged LiPo), what indicator would you need/want to determine if the LiPo is charging?

Alternatively, if you wanted to measure the current flowing into the battery, you could use a MoJo which is designed to measure energy usage in a battery-powered system (both in and out of the system). Once connected to your Notecarrier (and Notecard), you can use card.powerto retrieve the cumulative number of milliamp hours (mAh) consumed since the last reading. This value will decrease upon current flowing into the battery (charging) and vice-versa when discharging. This will show you when the battery is charging / discharging.

Thanks,

Alex

Hi @abucknall

Thanks for getting back to me. My apologies - I’m just not understanding. If I have the USB connected to the Notecard (so I can use card.voltage), then isn’t it the case that I’m just going to see the voltage from the USB input? If I disconnect the LiPo, then card.voltage gives a reading of 4.734. With the LiPo connected, card.voltage gives a reading of 4.653. As you say, somewhat higher than I would anticipate even for a fully-charged LiPo. So is that 4.653 the voltage from the LiPo, or from the USB? It isn’t clear to me which voltage source card.voltage is reporting, when both the LiPo and USB are connected. I’m not looking for some sort of charging/charged LED on the Notecard (the fewer LEDs the better when running on battery). I was just hoping that there was some variant of card.voltage which would tell me definitively the voltage from the LiPo. Or some other command which would let me find out the status of an attached LiPo via the In-Browser terminal.

As regards the MoJo, that’s a bit of a sore point. I’d love to be able to use one, but unfortunately it isn’t supported for the Notecard LoRa.

Cheers,

Chris

@darkerenergy

You are absolute right, I missed that you mentioned Notecard LoRa!

I think I understand your issue. Unfortunately, due to the Notecard LoRa, it does mean there are limitations with which APIs are available to it. There is an API for card.carrier which connects the battery charger’s STAT pin (typically used to indicate charging via an LED) to the Notecard’s AUX_CHARGINGpin but this API isn’t available on the Notecard LoRa either.

I think what you are trying to achieve will be difficult using Notecard LoRa alone, but perhaps you might be able to use your Host? Could I ask what Host MCU and what firmware/SDK (Arduino, FreeRTOS, Zephyr, etc.) you are using?

Thanks,

Alex

Hmmm… I hadn’t thought of using the host. I’m using an STM32 (U083RC), with custom firmware over FreeRTOS/CMSIS2. I didn’t know there was a charger STAT pin on the Notecarrier B… I’m not sure what you were thinking I could try on the host side.

Or maybe this is one more reason to swap out my Notecarrier B and replace with Notecarrier X, which does at least have a NCHG pin that is “active LOW when charging attached LiPo”…

@darkerenergy

It would certainly be the most straightforward path to swap to a Notecarrier X as you mentioned the NCHGoption. Would monitoring for activity via polling or interrupt from your host be sufficient for your application?

@abucknall

The short answer is yes. It isn’t ideal, for a few reasons - the most obvious of which is that my original goal was to be able to charge the LiPo using the Notecard’s charger in isolation (with no host present) and I simply wanted to be able to know whether the charging process was complete without disconnecting the battery and using a multimeter. But, I can live with needing to have a host around while charging.

So… I think that’s going to the plan going forward. Swap the Notecarrier B for a Notecarrier X, connect NCHG to a host, and modify the host firmware to indicate when charging is complete.

Thanks for your patience and assistance in working through this, Alex. I’ll close this ticket.

1 Like

@darkerenergy

I do have a further thought about doing this without a host but it would still require a Notecarrier X.

You could connect NCHG to one of the AUX pins of the Notecarrier and put the Notecard into GPIO mode, for example here using AUX1:

{
  "req": "card.aux",
  "mode": "gpio",
  "usage": ["input", "off", "off", "off"],
  "sync": true,
  "file": "charging.qo"
}

In this AUX mode (using"sync":true), the Notecard would log state changes to a Notefile called charging.qo. You could then access this in Notehub upon a hub.sync or if you wanted to query the pin state from the host:

{"req":"card.aux","mode":"gpio"}

You can read more about it here → Working with the Notecard AUX Pins

Would that work for you?

1 Like

@abucknall

That’s an interesting idea, thanks!

Chris

1 Like