Sleep mode in the ATMega 32U4

Does anybody know how to employ the sleep mode in the ATMega 32U4 running at 3.3V/8MHz?

The data sheet says to enter any of the five sleep modes, the SE bit in SMCR must be written to logic one and a SLEEP instruction must be executed. The SM2, SM1, and SM0 bits in the SMCR Register select which sleep mode (Idle, ADC Noise Reduction, Power-down, Power-save, or Standby) will be activated by the SLEEP instruction.

WHAT DOES THAT MEAN???

Additional info:

  1. The project (Science Museum Active Artwork) runs on solar power and I prefer it not shut down completely so I monitor the battery voltage (through a voltage divider) and shut features off as the battery voltage reduces. It sounds like I can go even deeper into sleep if I can access these features.

  2. The 3.3VDC Pro-Micro currently lights several arrays of LED’s, runs a Servo, and sounds a speaker. I use a transistor to fire a relay that powers a voltage step up to power the servo. When not in use I power down the transistor (and relay, voltage step up and servo).

  3. At full servo operation, it consumes 500 mw but that is infrequent. Normal light operation is about 40 mW and when sleeping it is about 20 mW. I think I can get the 22 mW number lower if I can figure this out.

  4. I chose the Pro Micro - 3.3V/8MHz as it runs without a voltage step up device and this reduces its minimum consumption (those step up devices are not efficient).

Thanks,

Peter

Oh, and here is the link to the ATMega 32U4 datasheet that discusses this power management in chapter 7.

http://cdn.sparkfun.com/datasheets/Dev/ … ga32U4.pdf

Thanks,

Peter

The 32u4 is not much different from the ATMega328. A very detailed tutorial on low power modes for that processor can be found here: http://www.gammon.com.au/power

For using solar power with a supercap instead of a battery, see this tutorial: http://www.gammon.com.au/forum/?id=12821

How do you know if the LiPo battery is low (is this a different thread)? I get the impression that using voltage is not enough as below 3.77 volts, it seems to lose much faster.

I’m using a 3.77 volt LiPo battery and it ran full activity for several days around 3.9 to 3.7 volts (night and day, solar recharging during the day). Last night, it got below a 3.7 volt limit and shut down most functions (LED’s, the servo, and the speaker) but this morning it had dropped to 3.67 volts.

By 9:20, it had dropped to 3.48 volts (everything was still shut down). So it is dying fast!!!

Thanks,

Peter

https://learn.sparkfun.com/tutorials/ba … um-polymer

Ah, it makes more sense now. It must have been ready to die when I shut off the features and it couldn’t survive with what is left.

I think I’ll change it to go into hibernate mode at a higher voltage. If I wait too long, then it falls off rapidly and may not sleep through the night.

What do you think of changing it to efficient mode at around 3.77 volts and reawaken it at 3.9 volts?

Thanks,

Peter