0

Super low-power feather sensor?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Super low-power feather sensor?

by jensbjorgensen on Thu Mar 04, 2021 10:29 pm

Hello,

As a fun little project I'm creating an outdoor gate sensor. I've puchased a couple of Feather nRF52840 Express and the magnetic sensors, plus a couple of 2500mAh lipos. I wrote up the code in arduino and implemented a BLE interface where you can subscribe to a single variable which expresses the state of the sensor. The circuit/hardware works great. To measure power usage I took a JST male-to-female cable and cut a break in the + side (Red, right?!) so I could use my fluke meter to measure current. It seems to run steadily at 8mA. Which on the one hand is pretty amazing it can run on that. But on the other hand I realize with the 2500mAh lipo would run theoretically about 13 days before it would need a fresh battery. A bit too inconvenient. Ideally I'd like at least a month. So I need to get my average power draw down to 3.5, or a reduction of 57%.

I don't need to check the sensor often, so for sensor purposes it's fine to do plenty of low-power sleeping--even checking once a second is fine. The problem of course is the bluetooth stack needs to keep running and I'm sure that doesn't work so hot when the processor is asleep. Or does it? I guess I'd need some tips on low-power sleeping code in arduino.

Anyone have some suggestions about this? Would I be better off with a different MCU or radio? i'd love to hear anything that doesn't involve creating a custom circuit and doing reflow soldering etc. I'm just a software guy!

jensbjorgensen
 
Posts: 9
Joined: Mon Apr 30, 2012 8:29 pm

Re: Super low-power feather sensor?

by adafruit_support_mike on Tue Mar 09, 2021 8:20 pm

You can switch the whole system on and off with a TPL5110 low-power timer:

https://www.adafruit.com/product/3435

The leakage current is about 20uA, mostly through the LED that shows when the power is on. If you cut the jumper to that, the only thing left to draw current is the TPL5110 itself. The banner spec in the datasheet is 35nA (about three years per 1mAh of battery), but in practice you only hit that level when the supply voltage is below 2.5V. At 3.3V, the current load is about 100nA (about one year per 1mA of battery).

Left to itself, the TPL5110 will connect power every T seconds, then disconnect power for about 50ms before connecting it again. But it also has a DONE pin so the microcontroller can shut off power at any time during the cycle.

If you adjust the TPL5110 to turn on once every 5 seconds, your Feather will boot, start the BLE radio, read the sensors, and can then spend maybe 1 second waiting for a connection from a central device. If it doesn't see anything, it can toggle the DONE pin and shut itself off for the rest of the interval. If it does see a connection, it can stay running as long as necessary to handle the job (within the 5-second window).

With those numbers the Feather will only draw power about 20% of the time, extending the life of the battery about 5x.

The parameters of interest are:

- how long it takes the Feather to boot, read its sensors, and get the BLE running
- how long it takes to recognize an incoming connection from a central device
- how long you wait to see an incoming connection
- how long you're willing to wait for the Feather to reboot and look for connections again

The first two are limits you'll have to observe for the system to work at all. The second two let you play with the duty cycle to find a balance between power savings and responsiveness that you like.

adafruit_support_mike
 
Posts: 62788
Joined: Thu Feb 11, 2010 2:51 pm

Re: Super low-power feather sensor?

by jensbjorgensen on Mon May 10, 2021 9:32 pm

So just to follow up on this, the whole thing is deployed and working nicely. I'm using the 6600 mah battery and my first 'run' of using it happened last week. So I forgot to keep track of exactly how long it'd kept going but it was 5-6 weeks which is workable. I've got a whole "system" working now where a linux box inside the house with a small server script running that monitors the two sensors in the box I've mounted on the gate (magnetic "open" sensor and also an inward-facing PIR sensor). It sends me alerts via Telegram when either of the sensors is triggered and now I always know when UPS delivers my latest adafruit gear ;-).

It might even be worthy of a "learning" article write-up on it, I'd be happy to include the Arduino sketch I'm using as well as the linux python server. One interesting bit I've not sorted out yet is the strange thing that I'm unable to use the script on a raspberry pi. Ultimately I want it to run there as I'll use that as my sensor hub. Could be due to the module I'm using, I'm sure I'll sort it out eventually.

jensbjorgensen
 
Posts: 9
Joined: Mon Apr 30, 2012 8:29 pm

Re: Super low-power feather sensor?

by adafruit_support_mike on Mon May 10, 2021 11:13 pm

Glad to hear things are working.

I'll mention it to the folks who handle the Learning System, but can't make any promises.

adafruit_support_mike
 
Posts: 62788
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.