Can lipo be specified as power source in code?

boron
Tags: #<Tag:0x00007fe21c3e1ba0>

#1

Afternoon folks,

On a Boron LTE I have a 12v battery connected to VUSB (via an external 5v regulator) and a backup lipo in the JST connector (Li+). I can read the 12v battery voltage and would like to switch to the backup at a certain level of 12v battery discharge. Is this possible to specify in code?

Thanks!


#2

Not possible in code alone. You would need some external circuitry to switch the power sources. As is though, your 12V battery will keep the LiPo charged until it drains, and then the Boron will use the LiPo at that point automatically. You may need to play with the PMIC settings some to set the minimum charge voltage.


#3

Thanks. I thought that might be the case. I’ve decided to have a power save mode on the device to extend 12v battery life as long as possible when it starts getting low. Lipo will be emergency backup only.

I’ll look into PMIC settings, would be nice to only recharge the lipo when the 12v source is getting charged.

Thanks.


#4

How long are you wanting the Boron to run on battery? What is your application? Maybe we here can offer suggestions.


#5

If your application is outdoor or close enough why dont you consider a solar powered tender for your 12 volt source …the drain of a Boron isn’t that much unless your regulating circuit could be the culprit for the drain on your 12 volt …just thoughts.


#6

Six months at least on about 50 mah battery without going below 12v. Boron LTE wake every 15 minutes to publish heartbeat and alert if certain conditions are met.

At this point I’m trying to get a lot more energy efficient. I’m draining a 1.2 ah test battery in about 12 hours (solar panel brings it back up during the day) publishing every 15 minutes and sleeping in between: On wakeup turn cell chip on, connect to cloud(s), publish, disconnect from cloud, turn cell chip off, then System.sleep(sleepWakePin, CHANGE, 900).

Things I still need to try:

Reduce publishes to absolute minimum #

Try sleep_mode_deep (lose ability to store variables for unknown gains)

Instrument actual consumption and check against specs / community observations (any help here would be nice in terms of simplest way to sample consumption over time)

Try keeping cellular connection up instead of connecting and disconnecting (system mode semi-automatic (cell connection but no cloud) and sleep with SLEEP_NETWORK_STANDBY). Unlikely to show gains with LTE, but what the heck.

What else?

Edit: Changed 1.2 ah battery drain in 24 hours to 12. Solar panel brings it back up, and it drains over night (under 12v).


#7

Solar is ideal case, and I have one set up, but I want to build for least ideal case to also work.

Your point about the regulator is well taken. I’m not sure how efficient it is, I’ll check the specs again. I have 12v->5 regulator and then the built in one on the Boron, too.

Edit: its a MP2307, “up to 95% efficiency” https://cdn-shop.adafruit.com/datasheets/MP2307_r1.9.pdf

Pretty sure it’s never getting more than 15v from the solar charge controller and load <=0.5a…so 85-90% efficient?


#8

I’m thinking your Boron isn’t sleeping properly.


#9

It’s technically sleeping based on the charge led blinking furiously and it coming back up after the specified time…but maybe I need to let it go to sleep more gracefully. I saw some posts between you and BlueCheese on this: Low power sleep on Boron LTE


#10

@RobotChicken, I went through a similar project where I was using Borons and I could only use battery w/o solar. Maybe there is some helpful info in this post for you Boron - High Cellular Usage.


#11

@Backpacker87, very helpful. I skimmed through most of that thread and realized that I don’t necessarily have to use the Particle Cloud either. I’m sending my variables to a different cloud service anyway. Also, I’ll have to tackle data consumption issues soon enough, so this is a step in the right direction for both power and data savings. I’m already manually controlling the connection, might as well just not call Particle.connect() except for very special occasions.


#12

@RobotChicken, remember that you won’t be able to OTA to the Boron unless you are cloud connected. :wink:


#13

@RobotChicken, @peekay123 makes a great point.

I have not been able to try it yet, but collectively the group came up with the idea of having a button on the 3rd party cloud (I like Ubidots) like a “OTA” button which when sending data to the 3rd party cloud it checks the status of this button. If it is clicked, then the boron will do a Particle cloud connect. In theory, this could allow you to have your cake and eat it :slight_smile:


#14

Quick Calc’s
I assume your test battery is a 12V SLA, rated at 1,200 mAh.
1,200 mAh over 12 hours = 100mA load
100 mA @ 12V = 1,200 mW average.

We know that your Boron LTE isn’t doing that without a lot of help externally, especially if it’s sleeping.
Awake, a Boron LTE averages ~ 75 - 100 mW, depending on cloud activity.

So, what does your entire circuit/system look like ?
I assume you are measuring the 12V battery with a Voltage Divider, what value resistors ?
Something is wasting a lot of energy…and it’s probably not the Boron.

You might want to simplify your setup for a quick test.
Just use the 12V panel and 12V SLA directly with the Boron LTE (no 5V regulator), no voltage divider, etc. You don’t even need to Sleep the Boron for the test.
You should notice a significant improvement verses your previous results.


#15

Not necessarily. You can use OTA updates (of your user firmware and DeviceOS) without Particle Cloud. I posted a working example here: OTA over HTTP working example!


#16

I was thinking a physical button that would pull it out of sleep, connect, and keep awake until an OTA could be performed. But an app-based OTA enable button such as you suggest, @Backpacker87, would be even better. Or maybe both…

@picsil, :astonished: :clap:


#17

Wow, that does put it in perspective. To refine the numbers a little, it goes from about 12.7 - 11.4 volts in ~ 17 hours, or 12.7-12.0 in about 12 hours. Depends on sun into evening / early morning, etc.

Hooked up I have an OLED (not displaying anything atm), as well as an ina219 (w/ 0.1 ohm, 1% sense resistor) to monitor the battery. Should probably take the OLED off first and test. I do have an e-Ink display I’ve been meaning to play with…

I could hook up another Boron and load it with the same code powering from 12v battery as you suggest and let it discharge over night. Be easier than pulling the current install apart.


#18

Then you can directly measure the current going into and out of the battery, with the INA219.

I looked at Adafruit for the regulator you mentioned (MP2307) and only found a UBEC, here:

If that is what you are using, then it’s your problem most likely.


#19

That buck converter is exactly what I’m using. The way I have the INA219 hooked up I cant measure current, only voltage.

I’ll hook up a Boron without the converter and see what happens.

Thanks!


#20

Waited for the 12v battery to drain to see how long the backup lipo lasted. It dropped about 1-2% every 15 min publish cycle on a 400 mah lipo:

|Time----|Batt|% |
|14:36:00|Lipo|37|
|14:52:00|Lipo|35|
|15:07:00|Lipo|33|
|15:22:00|Lipo|31|
|15:38:00|Lipo|29|
|15:53:00|Lipo|27|
|16:09:00|Lipo|25|
|16:24:00|Lipo|23|
|16:39:00|Lipo|21|
|16:55:00|Lipo|19|
|17:10:00|Lipo|17|
|17:26:00|Lipo|15|
|17:41:00|Lipo|14|
|17:57:00|Lipo|12|
|18:12:00|Lipo|11|
...