mega 2560 low power or sleep mode

Hi I'm working on a solar project that hopefully be my base for all my projects under the sun. :slight_smile:

currently I charge my battery with a solar panel and read the battery voltage.

I would like to put my board into a sleep/ off/ low power mode) for a minute

and check the measurement.

I would like to disconnect my solar panel if the battery voltage is too high.
than repeat/check next minute

other than removing parts from my board therefore making it low power

what does Arduino offer in its tool bag?
can this be done using the watchdog function?
or perhaps a timer ?
any other ideas

thanks in advance

I did find this but trying to use what I have .. my mega 2560

https://www.gammon.com.au/power

Did you have a look into the datasheet? Usually the first pages of the electrical characteristics give you a good idea where all your power options are.

For instance:

  • IIL/IIH Input Leakage current I/O pin 1uA means every pin set to input will cost you 1uA when pulled LOW or HIGH and even more when left floating, page 72. 13.2.6 Unconnected Pins tells you what to do
    This also means if you do not need all the pins, use a smaller package

  • Power down mode WDT enabled will cost you 5-15uA no WDT only costs 1-7.5uA
    Additionally its given at 3.3V at 5V the values will be higher. But then you might not be able to run at the maximum frequency as shown on the next page.

The datasheet also has a section about sleep modes and power reduction for peripherals.

  • you could have a timer run during shutdown and wake you up
  • some applications use the analog comparators to wake the device by charging a small capacitor with a large resistor, this works without clocks but is less accurate and might not work with all microcontrollers

Klaus_K:
Did you have a look into the datasheet? Usually the first pages of the electrical characteristics give you a good idea where all your power options are.

For instance:

  • IIL/IIH Input Leakage current I/O pin 1uA means every pin set to input will cost you 1uA when pulled LOW or HIGH and even more when left floating, page 72. 13.2.6 Unconnected Pins tells you what to do
    This also means if you do not need all the pins, use a smaller package

  • Power down mode WDT enabled will cost you 5-15uA no WDT only costs 1-7.5uA
    Additionally its given at 3.3V at 5V the values will be higher. But then you might not be able to run at the maximum frequency as shown on the next page.

The datasheet also has a section about sleep modes and power reduction for peripherals.

  • you could have a timer run during shutdown and wake you up
  • some applications use the analog comparators to wake the device by charging a small capacitor with a large resistor, this works without clocks but is less accurate and might not work with all microcontrollers

ive looked for documentation on the mega 2560 and did not find what you described do you have a link or attachment.?

found some watchdog info here at this thread

https://forum.arduino.cc/index.php?topic=63651.0

thx

Sure here you go:

Atmel ATmega 2560 Datasheet (original Atmel version)

Atmel ATmega 2560 Datasheet (new Microchip version)

If you download the PDF file you can use the bookmarks in Acrobat Reader to jump around the document. It has a few hundred pages. So, scrolling in the web browser is not the best option.