adafruit / Adafruit_SleepyDog

Arduino library to use the watchdog timer for system reset and low power sleep.
MIT License
235 stars 66 forks source link

Power consumption higher compared to ArduinoLowPower library? #46

Open SanderM2 opened 1 year ago

SanderM2 commented 1 year ago

Hello,

I wanted to switch from ArduinoLowPower to Adafruit_SleepyDog because I need my device to sleep for less than 1 second (ArduinoLowPower is using the RTC differently so the resolution is 1 second at least). While switching to Adafruit_SleepyDog did work, I noticed that my Arduino MKR WAN 1310 is now using 550uA while sleeping. With ArduinoLowPower it's sleeping at 18uA.

That's a huge difference.

Is there a way I / we can fix this in Adafruit_SleepyDog ?

SanderM2 commented 1 year ago

I was just looking in ArduinoLowPower code and noticed they added USBDevice.detach() in their sleep routing. So I tried adding USBDevice.detach(); in my sketch and the power dropped from 550uA to 29uA.

It's still about 10uA higher compared to ArduinoLowPower but maybe this is normal because the RTC is running in a different mode?