Hi,
I intend to use Arduino Mega 2560 board for a project that needs to sleep most of the time. I need to achieve low power for a 2AA cell battery based application. So, I removed all the extra components from the board, like, mosfets, regulator, USB to UART, etc. Even the resistors are removed since all I need to do is to poll 20 GPIOs per second. Only the 16mhz XTAL and reset circuitry is retained. I hoped to achieve low power similar to pro mini. The consumption at startup is ~60mA and after entering sleep is ~3.3mA.
Can someone please help me figure out the reason for such high consumption? I believe the chip can hit a few uA in sleep mode. Attached is my sample code.
Regards,
WonderfulIOT
#include<avr/sleep.h>
#define SPEED_FACTOR 1.0
void setup()
{
// put your setup code here, to run once:
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_enable();
for(int i=2;i<=53;++i)
{
pinMode(i,OUTPUT);
digitalWrite(i,0);
}
}
void loop()
{
// put your main code here, to run repeatedly:
Serial.begin(9600*SPEED_FACTOR);
Serial.print("Ok");
delay(1000/SPEED_FACTOR);
Serial.println(" Ok");
delay(1000/SPEED_FACTOR);
// __asm__ __volatile__("sleep");//in line assembler to go to sleep
Serial.end();
sleep_cpu();
}