Sleep mode & USART Wakeup

I thought that putting the Arduino to sleep in power down mode disabled so much, including the USB Serial. Which would mean that waking up the Arduino via the Serial Monitor was impossible.

But in the Arduino example of SleepCode (Arduino Playground - ArduinoSleepCode) they put it to sleep using PowerDown and use the Serial Monitor input to wake.

Or did I understand this wrong?

It says:

use a resistor between RX and pin2. By default RX is pulled up to 5V

  • therefore, we can use a sequence of Serial data forcing RX to 0, what
  • will make pin2 go LOW activating INT0 external interrupt, bringing
  • the MCU back to life

But in my opinion this page is confusing and I believe some parts are wrong. Read this instead: Gammon Forum : Electronics : Microprocessors : Interrupts

You can also use something like this to save as much power as possible while keeping Serial alive:

void sleep()
{
  Serial.println( "sleeping\n" );
  Serial.flush();
  set_sleep_mode( SLEEP_MODE_IDLE );
  power_all_disable();
  power_usart0_enable();
  sleep_mode();
  power_all_enable();
  Serial.println( "awake" );
}

Requires avr/power.h

"other i/o"

Oh I think I know what's going on. They're not using the serial port to wake up, theure using it to put it to sleep :slight_smile: