Questions tagged [sleep]

Use this tag for questions concerning low power sleep states, eg. a battery powered circuit waiting for an external event to happen.

Sleep mode usually describes circuit states where almost no power is consumed, waiting for some event to occur, like a realtime clock alarm, some sensor reading, incoming communication or a button press.

This mostly applies to microcontroller operated circuits, where the microcontroller may be put in a low power state, just waiting for external interrupts to occur.

137 questions
22
votes
3 answers

Low Battery Indicator

I'm looking to make a battery life indicator that I can use in conjunction with a micro-controller. I'm hoping that I can then read the current battery life remaining and increasingly put the micro-controller to sleep to preserve battery life.
littlebirdceo
  • 4,697
  • 8
  • 41
  • 61
19
votes
5 answers

Best pattern for WFI (wait-for-interrupt) on Cortex (ARM) microcontrolers

I'm looking into developing battery-powered software using the EFM Gekko controllers (http://energymicro.com/) and would like the controller to be asleep whenever there's nothing useful for it to be doing. The WFI (Wait For Interrupt) instruction…
supercat
  • 45,939
  • 2
  • 84
  • 143
12
votes
3 answers

Microcontroller Sleep Race Condition

Given a microcontroller that is running the following code: volatile bool has_flag = false; void interrupt(void) //called when an interrupt is received { clear_interrupt_flag(); //clear interrupt flag has_flag = true; //signal that we have…
TRISAbits
  • 1,348
  • 1
  • 13
  • 25
12
votes
3 answers

How to Sleep Arduino

How do you program a sleep mode for your Arduino? Especially for battery powered designs, what are good techniques for sleeping the CPU but waking up only when needed?
littlebirdceo
  • 4,697
  • 8
  • 41
  • 61
10
votes
1 answer

Detect which momentary switch caused a STM32 cpu to wakeup

Edit: This question is wrong. The stm325105 has only one wakeup pin. But other ST-parts has more than one wakeup pin, so the given answer is valid for those. I have a stm32f105 that has two momentary buttons connected to the wakeup inputs. The…
Daniel Näslund
  • 227
  • 2
  • 10
8
votes
7 answers

ESP32: how to keep a pin high during deep sleep (RTC GPIO pull-ups are too weak)?

I'm using an ESP32 in a battery-powered device. The ESP spends most of the time in deep-sleep to save power. The device also has some 5V-powered sensors which I'm feeding from a MCP1640 step-up converter, which is on during the brief active part,…
anrieff
  • 5,199
  • 1
  • 27
  • 46
7
votes
2 answers

Bluetooth power saving mode for ArduinoBT

I'm trying to get my ArduinoBT to be a bit more power friendly, I have it running in a sensor network and it is constantly drawing power. I want to be able to turn off or put the Bluetooth module to sleep for durations when it isn't in use. I've…
Jess
7
votes
2 answers

Need help understanding Ultra Low Power Wakeup on PIC16F887

I am trying to implement the "Ultra Low Power Wake Up" feature on a small PIC project. The idea is the chip will go to sleep, and then be woken up in the future by the ULPWU interrupt. The idea behind the ULPWU is that you connect a capacitor to…
Michael
  • 948
  • 1
  • 7
  • 23
7
votes
1 answer

STM32 Sleep Mode: Interrupt gets executed but the CPU stays in WFI

I'm fairly new to the ARM architecture and I'm working with a board that contains STM32F0 microcontroller and an RF modem, which sends an interrupt every time it receives a message. I'm trying to implement a sleep mode in a microcontroller to save…
aljaz41
  • 73
  • 1
  • 1
  • 5
6
votes
1 answer

Actual power consumtion of xbee series 2 in sleep/power down mode?

According to user manual and several other official documents from Digi, xbee in the power down/sleep mode can consume as low as 1uA. But somehow such a low power consumption seems simply unachievable on my hands. The following is my setup: the…
Zhiyong Li
  • 262
  • 3
  • 10
6
votes
1 answer

AVR startup time w/ external xtal/osc

When using an external xtal/osc with an AVR, you get several startup time options when setting the fuses, such as: 6 CK/14 CK + 0 ms 6 CK/14 CK + 4 ms 6 CK/14 CK + 64 ms Now... does anyone know if these startup times apply when resuming my AVR…
David Högberg
  • 1,835
  • 2
  • 21
  • 34
6
votes
1 answer

STM32F103 low power mode (stop)

I've got a project where I'm trying to get the power consumption down as low as possible (on an STM32F103RCT6). I looked at ST's document on getting the STM32F2 power consumption down as low as possible, and tried to follow its…
Gordon Williams
  • 1,023
  • 4
  • 11
  • 17
6
votes
1 answer

How to make SMT32 chip programmable while it stuck in Standby mode?

From my mislead I put HAL_PWR_EnterSTANDBYMode() in the code whithout any wakeup behaviour, which made my chip unable to debug via SWD interface. So I can not either erase, upload new code or do anything with this chip. I have an Aliexpress ST-Link…
Roman Matveev
  • 2,942
  • 7
  • 32
  • 75
6
votes
1 answer

How is this Pushbutton Debounce code?

I am monitoring a pushbutton with a microcontroller where I am trying to take care of four things together: 50-msec debounce upon push-begin and 25-msec debounce upon push-release identify a short-press, defined as when button released within < 1…
boardbite
  • 4,892
  • 11
  • 47
  • 73
6
votes
3 answers

How to turn on ATmega every 6 hours?

The board which is made with Atmega operates on battery, it should turn on every 6 hours and log some data, then go back to deep sleep to save battery consumption. Atmega32 is used and not Atiny because of complexity of tasks and sensors connected…
hkoosha
  • 235
  • 1
  • 3
  • 8
1
2 3
9 10