Battery Power and The Electron

I have a question which I’m not sure how to handle with the Electron. I am sending an electron within an enclosure to a friend. Since it will only be power by the LiPo battery for many days even weeks how best to handle this, since I keep reading about not letting the battery completely discharge. Seems there are issues if it drains completely.

I don’t want to disconnect the LiPo from the electron since it is in an enclosure and can’t be reconnected unless taken apart. I do have a connection on the enclosure to run the electron normally by a 9 volt adapter.

Is it best to add code in my app. to check for a low Battery 20-25% and put to sleep until charged back to over 20% by the 9 volt adapter? How long can you do this until complete discharge?

Thanks all for your help…

Does not sound like a bad idea or you can have the electron in deep sleep and have a button which will turn on the electron.

That’s what I did and it worked great for a solar-powered project.

I just ran an if statement to check if the battery SOC was below 20% and if it was I put the Electron into deep sleep mode and then had it check SOC again every hour. If the SOC was above 20% the main code ran normally.

Pretty easy to code.

You could also setup an email or text message alert to let you or them know the battery is low and that it needs charged so they don’t let it go forever before charging the battery back up.

1 Like

Thanks for all your answers I do have a reset button on the enclosure and didn’t realize by using

System.sleep(SLEEP_MODE_DEEP, 0); when seconds are 0 this puts the Electron into deep sleep until I have someone hit the restart button.

If that is wrong let me know!

Thanks again.

Not sure if that works but you can test it.

It would still be wise to put the Electron to sleep when the battery gets low.

Thanks… what I found out is that I can put it to sleep by using

System.sleep(SLEEP_MODE_DEEP, 0);

but it doesn’t always want to reset by pushing the reset button I have between the RST and GND.

Do you know if that is the correct way to setup a restart button?

Actually waking from deep sleep is rather done via a rising edge on the WKP pin (as said in the docs too ;-))

Thanks Scruff… I did see that in a post. I saw in the doc. this statement also:

In all cases, if the wake up time seconds is omitted or 0, the application will keep sleeping until the wakeUpPin triggers (if specified) or the user hits the RESET button.

so I was trying to wake up the electron by using the RESET button once I put it to sleep with

System.sleep(SLEEP_MODE_DEEP, 0);

pushing the reset button I have seems to sometimes work and other times not work.

The reason I’m doing this way is I only have one button on an enclosure which is a reset button and trying to use it as a wake up also after put to sleep.

Any ideas why it sometimes works?

Reset should always work. If it doesn’t I’d check the button and wiring again.
Maybe you can check the levels on the RST pin before and during the button press.

1 Like

Looks like a a bad solder connection. I re-solder the switch seems to be working now…thanks to all

3 Likes