SD Card and Sleep or Low Power Mode

Coding and general discussion relating to user created compiler modules

Moderators: David Barker, Jerry Messina

Post Reply
User avatar
ohararp
Posts: 194
Joined: Tue Oct 03, 2006 11:29 pm
Location: Dayton, OH USA
Contact:

SD Card and Sleep or Low Power Mode

Post by ohararp » Mon Oct 06, 2008 2:00 am

This is question is aimed at Steven, but please feel free to chime in if you know the answer. Basically, I am curious if there is a way to either "un-init" the SD card or put the SD card to sleep?

I am trying to adapt the SD GPS Logger code for use in a glacial monitoring system. But I am currently having trouble with a nagging 8mA that is being drawn in sleep mode. Due to some reliability issues I have had to tie the SD card to the 3.3V regulator so that it always has power. I previously had the SD card sitting behind a mosfet, but was having some issues "re-init" the sd card after cycling the power when using the mosfet.
Thanks Ryan
$25 SMT Stencils!!!
www.ohararp.com/Stencils.html

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Wed Oct 08, 2008 6:24 am

Ryan, I'll look into this - I'm not sure if it should be a problem or not.

Tom Estes
Registered User
Registered User
Posts: 37
Joined: Thu Dec 14, 2006 4:19 pm
Location: Monkey Island, Oklahoma USA

Post by Tom Estes » Wed Oct 08, 2008 1:28 pm

I use Stevens routines on an SD card that is energized every 5 minutes (logging application) with a mosfet in the gnd lead. I do an init every time it is energized. It has been in operation for 6 months with no errors at all.

User avatar
ohararp
Posts: 194
Joined: Tue Oct 03, 2006 11:29 pm
Location: Dayton, OH USA
Contact:

Post by ohararp » Wed Oct 08, 2008 2:46 pm

Tom,

Could you provide a schematic and a part numer for that mosfet?
Thanks Ryan
$25 SMT Stencils!!!
www.ohararp.com/Stencils.html

Tom Estes
Registered User
Registered User
Posts: 37
Joined: Thu Dec 14, 2006 4:19 pm
Location: Monkey Island, Oklahoma USA

Post by Tom Estes » Wed Oct 08, 2008 6:49 pm

I use the Mikro Elektronika MMC/SD board shown here
http://www.mikroe.com/en/tools/mmc/

Pin 10 of that board is ground. Instead of going to ground I tie that pin to the FET (BS170) drain, the source is to ground and the gate is to a PIC pin. That's it.

This way I turn off the whole board so that it's 3V power supply doesn't consume any power while off. You should initialize the SD card as if it was cold started, which it was. In software I give the SD card 100msec after I switch on the FET to power up before initializing. That gives the card time to hardware initilize after power is applied.

User avatar
ohararp
Posts: 194
Joined: Tue Oct 03, 2006 11:29 pm
Location: Dayton, OH USA
Contact:

Post by ohararp » Tue Oct 19, 2010 2:08 pm

Tom just curious if you have a part number for the mosfet that you use.?
Thanks Ryan
$25 SMT Stencils!!!
www.ohararp.com/Stencils.html

Tom Estes
Registered User
Registered User
Posts: 37
Joined: Thu Dec 14, 2006 4:19 pm
Location: Monkey Island, Oklahoma USA

FET used

Post by Tom Estes » Tue Oct 19, 2010 8:03 pm

It was a BS170 FET

Still working fine......

jellyfish
Posts: 4
Joined: Mon May 09, 2011 9:25 pm
Location: Brooklyn

MOSFETs

Post by jellyfish » Wed May 11, 2011 5:56 pm

I've been working with a datalogging project that needs to go low power for extended periods of time. I've been using a P-MOSFET as a power gate on the high side (3V3). As I built up the circuit and tested it, everything was fine, but when I added the SD card, my sleep current jumped from 40uA to 6mA! I tracked it down to the card. It seems that even when disconnected from the power line, the card is able to grab enough current through the SPI lines to continue functioning. Do you have this experience?
Now I'm sitting down for some serious re-work, rerouting the GND so that I can send it to an N-MOSFET. I'll post again when the test is done.
Thanks for the help!

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Post by Jerry Messina » Wed May 11, 2011 6:28 pm

Very few chips are spec'd such that an input pin can exceed Vcc by more than a few tenths of a volt. Usually there's an input clamp diode on the signal pins to Vcc, so if you shut off Vcc the clamp diode conducts and powers the chip via the input line.

How about tri-stating the SPI signals (or setting them all low) when you turn off power?

jellyfish
Posts: 4
Joined: Mon May 09, 2011 9:25 pm
Location: Brooklyn

Post by jellyfish » Wed May 11, 2011 7:17 pm

Yeah, it could very well be the anti-static clamps that are routing power through the SD card. The voltage I get on my meter when the micro is powered down is ~2.4V. Just about right for a diode Vf.
I may be able to set the SPI bus pins as inputs (high Z) before sleep, and that might work... Still in prototype, and if I can fix it in hardware it's still an option.
also, i like the higher currents that the N-MOSFET can provide.
My sand pile has BS250 and BS170 in it.
BS250 = 180mA max
BS170 = 500mA max

User avatar
ohararp
Posts: 194
Joined: Tue Oct 03, 2006 11:29 pm
Location: Dayton, OH USA
Contact:

Post by ohararp » Thu May 12, 2011 1:21 pm

I have had good luck with the FDC6901L Load switches instead of mosfets.
Thanks Ryan
$25 SMT Stencils!!!
www.ohararp.com/Stencils.html

jellyfish
Posts: 4
Joined: Mon May 09, 2011 9:25 pm
Location: Brooklyn

Post by jellyfish » Fri May 13, 2011 9:33 pm

Hi,
I'm able to shut down the whole board with the P-Channel MOSFET (BS250) now, including the SD card, when I set the SS pin as input before I go into power down sleep mode. I did the old process of elimination test, and turns out MOSI and SCK have no effect. SS is the culprit. For the sake of simplicity in the long run, I may move to an N-MOSFET. The N-Channel has alot more going for it. I'm going to run the N- test soon and post the results.
The FDC6901L seems to be end of life. I've looked at Power Switches like this, but their price is too high for me ;)
I do have to re-initialize after waking up, as you mentioned Tom.
Now I'm happily logging data and only drawing ~6nA during sleep.

User avatar
ohararp
Posts: 194
Joined: Tue Oct 03, 2006 11:29 pm
Location: Dayton, OH USA
Contact:

Post by ohararp » Fri May 13, 2011 9:43 pm

Do you mind sharing of your schematic on how you did this?
Thanks Ryan
$25 SMT Stencils!!!
www.ohararp.com/Stencils.html

jellyfish
Posts: 4
Joined: Mon May 09, 2011 9:25 pm
Location: Brooklyn

Circuit

Post by jellyfish » Tue May 24, 2011 2:46 pm

hi, here's a link to the work that I'm doing related to this thread.
http://www.solarduino.net/
Thanks for the help, Swordfish thread!

Post Reply