How to calculate the minimum sleep time that makes sense for MCU in low power mode?
Hi everyone
I'm working with a battery-powered sensor and I'm interested in minimizing power consumption while maintaining functionality.
I have a question regarding low power and sleep modes in microcontrollers. Is there a way to calculate the minimum sleep time that makes sense for a microcontroller (MCU) in low power mode? For instance, does it make sense to put an MCU to sleep for just 1 second? Are there any specific calculations or rules to define this minimum sleep time?
#mcu-mpu-and-firmware
6 Replies
1 second is an eternity to a uC and usually
go to sleep
is a small enough instruction set that it can be done.thanx, @ZacckOsiemo , can i ask what factors should be considered when deciding on the sleep time
How long it takes you to go to sleep and how long it takes you to power on. And what does your application need. I have seen people use sleep rather than delay ...
@wafa_ath if the task you’re performing after waking up can be completed quickly, then sleeping for even short durations can save energy. However, if the wake-up and task completion take a significant amount of time, the sleep duration needs to be longer to be beneficial.
Solution
@wafa_ath here is a sleep implementation you can use.
GitHub
uCDSP/Src/main.c at 185795eb45aa8523278c1570932b413adca80748 · zacc...
Contribute to zacck/uCDSP development by creating an account on GitHub.