greiman / SdFat

Arduino FAT16/FAT32 exFAT Library
MIT License
1.09k stars 514 forks source link

CS_PIN and power consumption #201

Open geologic opened 4 years ago

geologic commented 4 years ago

Hi

I've made a simple battery powered program that is sleeping almost the time, so power consumption is only some uA. I added a SPI SD card reader module and at startup i need to check the presence of a SD card, so i'm using your library like this, on setup:

Serial.print(F(" * Checking SD... "));
  if (!SD.begin(SD_CS_PIN)) {
    Serial.println(F(" Not found!"));
  } else {
    Serial.println(F(" found!"));
}

The problem is after adding this code my current consumption goes to 5mA, if i comment the code it gets back to some uA. Looks like something related with SD_CS_PIN initialization.

I tried putting back SD_CS_PIN to low or high, but didn't make any difference.

Any idea?

greiman commented 4 years ago

Edward Mallon has used Arduinos with an SD to log data in caves for months using AA batteries.

His website is here.