Battery Powered Boron and Motion Sensor (PIR)

@rick.roades peaked my curiosity about using a PIR to wake a battery powered Boron in this post.

I have a Boron already wired to a TPL5111 for an external timer and allows me to Shutdown the Boron with it’s EN pin, So I added a PIR to test.

In addition to the timer function of the TPL, we can also pull the Delay Pin Low to Start a Cycle (Wake the Boron from EN pin Shutdown). The PIR has a very low current and pulls it’s output LOW during Motion.
The PIR and TPL are both powered by the LI+ pin.

The Boron remains in shutdown until Motion is sensed, the PIR pulls the TPL delay pin to Ground, causing the Boron to Startup. It works ! :grin:

Right now, my Code makes the Boron Shutdown 2 minutes (adjustable) after Motion has stopped.
But if a squirrel decided to hang-out in front of the PIR all day, the Boron wouldn’t know how often it’s actually Publishing across EN Pin Shutdowns.
That’s not a big deal for a Solar Boron, but it brings up a Question:

What’s the best method to store the last “TIME related variable” that the Boron Shutdown (that will survive a shutdown from the EN pin being Grounded). I’m looking for a way to prevent continuous Motion causing repeated Startup Cycles, mainly the "motion "publish. I didn’t see BackupRAM or RTC in the Boron Docs. I think I would write to EEPROM (figure out some form of wear leveling), and once Manual System Mode is available have the Boron read EEPROM in setup() and decide if it should continue the boot process (modem, etc) or not. It seems to me this would still be useful when Pin Sleep Mode is available (for non-Solar, Gen3 battery devices).

Any Ideas?
Thanks in advance.

2 Likes

AFAICT the nRF52840 does have a BackupRAM feature, but it might not have been implemented or just wasn’t documented yet.
It’s still worth a try - unfortunately, I haven’t got a device with me right now to test :pensive:, but this code builds without errors

const int LED = D7;
retained int x;
void setup() {
    pinMode(LED, OUTPUT);
    digitalWrite(LED, (x == 123));
    x = 123;
}
2 Likes

Your code appeared to work. No LED on the first run, pressed reset, then LED on.
Unfortunately, it doesn’t survive a Shutdown from the EN Pin (Starts over w/ LED Off until a reset, then On).

It’s good to know the BackupRAM feature works. I’m thinking that’s the best solution for when we get Pin Sleep.
Thanks again @ScruffR

2 Likes

Which PIR sensor are you using?

I’ve tried a few and here is one with a 15uA running current.

It was not my favorite choice but would work for certain scenarios.

1 Like

Its been so long since I purchased them, I don't know what they are exactly.

image

I'm planning on measuring the current today for the Blue and Green Boards.

I designed and laser cut a little acrylic case for these a few years ago.
Maybe I can dig up an enclosure for one.

1 Like

PIR “Only” Currents: 4.00 V input, all measurements after Warm-Up, output pin not connected.

Blue Board
039 µA Watching
180 µA During Motion Output

Green Board
071 µA Watching
211 µA During Motion Output

I’ll put the entire gadget (Boron + TPL + PIR) on the current test rig and let her run for a while.

1 Like