Electron turns off after a while

Hello Everyone,

I am working as an engineer in a private company, we are dealing with IOT and m2m. We have started developing motion detection module using particle electron on pir sensor.

As a prototype, we are testing in real time, i have written a code to publish an event and prolonged with sending an alert email using 3rd party app and webhooks.

it is working fine for one day and started switching off after a day or so. when i measure the battery voltage, it is showing zero. I need that device should be ON for three months. Do I need to change the battery or alter anything in the programming to get it alive for 3 months. project is in final phase, kindly anyone help me to sort out this issue.

Thanks and Regards,

You won’t get that kind of uptime out a 2000mAh battery - just do the math (2000mAh / (avg current draw * 768h))

For 3 months you would need a bigger battery (or means to continually recharge) and power saving strategies (e.g. System.sleep()) in your code.

1 Like

Thanks for your response,

planning to upgrade with 10000mAh with recharge strategy.

I am quite unsure about power saving strategies in the code. If we add System.sleep() wouldn’t be the device goes to sleep, will it be able to wake up device after any motion detected?

if you could show any example code for adding sleep and wake up commands, it would be really helpful