Author Topic: How to reduce power consumption while using micro SD card with microcontroller  (Read 14026 times)

0 Members and 2 Guests are viewing this topic.

Offline tapasxploreTopic starter

  • Contributor
  • Posts: 23
  • Country: in
I am using micro SD card to log reading from four force sensors connected to the microcontroller (MSP430G2553). Controller logs reading to the SD card every 15 minutes and goes to sleep. I am using 1000 mAh battery, which is lasting over a week. Is it possible to reduce the power consumption as to make it last over a month.

(#) Even if the microcontroller is sleeping for 15 minute, SD card is continuously consuming power.

(#) It takes couple of mA to write.

Help with any suggestion to reduce to power consumption drastically.
Schematic is shown below, code is inserted after the schematic.

 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Use a high side switch (like the MIC20xx series) to turn off power to the SD card when you're not using it.
Also add some pull-down/up resistors and put the SDIO interface to high-z.
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13743
  • Country: gb
    • Mike's Electric Stuff
Use a high side switch (like the MIC20xx series) to turn off power to the SD card when you're not using it.
You don't need anything that fancy  - ll you need is a P-channel MOSFET.
Make sure all control lines are set low when turning off to avoid powering it via these.
Just make sure you allow time for the data write to complete before powering down.

Also I've found that power draw varies a lot between different cards, so if you have control over the card selection this may help. But turning it off is going to save by far the most.   

The effect of the current draw while writing is going to be pretty insignificant if you're only doing it every 15 mins, so probably not worth spending time on. If the write takes one second, every mA you save will only save a little over a microamp on avarage.

Something else you could do is put the micro to sleep once you've sent the data to the card and are waiting for it to complete, then when teh write is done, wake up to turn the card off and go back to sleep.
I'm not too familiar with low-level SD stuff but I think  the data-out line changes state when the card goes ready to allow for easy polling - you could use this to generate a wake-up interrupt.
If this is not possible, you can wake after a guesstimate of the write time ( remember this will vary due to internal management), poll the card, and go back to sleep if not ready.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 
The following users thanked this post: Fungus, bitseeker, tapasxplore

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
It will be entirely up the brand of the SD card if and when they enter sleep mode. Some sleep automatically without clock, others are always on.

A power switch is the most compatible way. This can be a mosfet.
The advantage of the powerswitch is the overcurrent trip when a damaged SD card is inserted.
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13743
  • Country: gb
    • Mike's Electric Stuff
It will be entirely up the brand of the SD card if and when they enter sleep mode. Some sleep automatically without clock, others are always on.

A power switch is the most compatible way. This can be a mosfet.
The advantage of the powerswitch is the overcurrent trip when a damaged SD card is inserted.
But a battery powered system should already have protection to limit current in a fault condition.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline tapasxploreTopic starter

  • Contributor
  • Posts: 23
  • Country: in
It is possible to reduce power without changing the schematic. How to reduce micro SD card power consumption.
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13743
  • Country: gb
    • Mike's Electric Stuff
It is possible to reduce power without changing the schematic. How to reduce micro SD card power consumption.
Choose the lowest power card you can find.
Still won't make anything like as much difference as doing it properly by switching the power
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8264
Keep in mind that an SD card itself has a rather powerful microcontroller inside it, and depending on what its firmware does, it may remain active all the time. I agree with all the suggestions about turning it off when not in use, although you should be careful to let writes complete --- and then wait some time after that to allow for internal processing --- before actually powering down.
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Quote
I agree with all the suggestions about turning it off when not in use

If I remember correctly, there should be a command to put the SD card into a 'low power' or 'off' state.
This assumes that you have access to the SD card protocol (ie at driver level)
 

Offline tapasxploreTopic starter

  • Contributor
  • Posts: 23
  • Country: in
Can any one help with the command which can put SD card in the power blocking mode, I am using FatFs library.
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
You searchfoo is weak young one  ;)

https://www.sdcard.org/developers/overview/sdio/sdio_spec/Simplified_SDIO_Card_Spec.pdf

There is an entire section on power control.

Quote
Can any one help with the command which can put SD card in the power blocking mode, I am using FatFs library.
If the power mode is not supported in FatFS then  it is up to you to add it (and share it if you would be so good)
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13743
  • Country: gb
    • Mike's Electric Stuff
Can any one help with the command which can put SD card in the power blocking mode, I am using FatFs library.

The problem is you don't know how well supported power management is on any particular card ( anyone have any experience ?). It is highly possible that a large proportion of cards don't support powerdown, and if they do, powerdown current may still be way higher than you want.
 
It should be possible to do power management pretty much independantly from the filesystem by issuing comamnds at the SD card inerface layer - you just need to tell the filesystem to close down before sleeping the card, and re-mount the card after waking it.

However the only way to be sure is tell your hardware people they screwed up and need to add a power switch.
« Last Edit: June 21, 2017, 01:03:19 pm by mikeselectricstuff »
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
There are some reports on the internet about sd card power consumption. But they are dated.
https://electronics.stackexchange.com/a/123386/148363
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Now that I am not at work, I remembered that FatFS only provides disk file system, it needs a low level driver to talk to the device. This driver layer is where the SD card power control must be implemented, nothing to do with  FatFS.
 

Offline d-smes

  • Regular Contributor
  • *
  • Posts: 101
  • Country: us
If you store your sensor readings in RAM and only write to the SD card when you have a whole block of data to write, that would save power.  Depending on disk file system and SD card, 32K block size might be the right number.
 
The following users thanked this post: tapasxplore

Offline tapasxploreTopic starter

  • Contributor
  • Posts: 23
  • Country: in
Can't we use one of the GPIO pin of the microcontroller to switch off the microSDcard. MicroSD card takes not more than 3 mA, which controller can easily power. Why to use a extra FET. 
 

Offline tapasxploreTopic starter

  • Contributor
  • Posts: 23
  • Country: in
Will the load switch from TI such as TPS22910 will work. Can any one help with part number.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
You can't use a gpio pin. The burst current when writing will be too high.
The load switch you've found should work. But note that it is a 1x1 mm package!
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13743
  • Country: gb
    • Mike's Electric Stuff
You may just get away using one or more gpios, on some cards, if you add a capacitor, and can deal with the current spike wjen you turn it on, but much easier & more reliable to use a pfet for a few cents.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 16642
  • Country: 00
But note that it is a 1x1 mm package!

Whoah!   ???

 

Offline Ash

  • Regular Contributor
  • *
  • Posts: 161
  • Country: au
Will the load switch from TI such as TPS22910 will work. Can any one help with part number.

I've used a MIC94045 for this exact purpose, but it is also tiny..  :-//

I originally tried with a P-channel MOSFT, but if you turn on too "quickly" you better have a damn good power supply - I had some major glitches occurring and had to slow down the turn on. The MIC94045 includes a controlled rise time (1ms) soft start, I think the TPS22910 is similar which was better for my requirements and was smaller (space was a premium) than a MOSFET and R/C combination and easier to implement :)

Ash.

 

Online Psi

  • Super Contributor
  • ***
  • Posts: 9931
  • Country: nz
A small supercap should allow you to use a few GPIO pins to power it.
Assuming you only need to save a small amount of stuff.

Feed the supercap with a resistor that wont overload the GPIO when the cap is discharged,
You could even have an ADC line on the supercap to detect when its charged and ready for a burst write. However a time delay is probably all thats needed.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13743
  • Country: gb
    • Mike's Electric Stuff
Will the load switch from TI such as TPS22910 will work. Can any one help with part number.

I've used a MIC94045 for this exact purpose, but it is also tiny..  :-//

I originally tried with a P-channel MOSFT, but if you turn on too "quickly" you better have a damn good power supply - I had some major glitches occurring and had to slow down the turn on. The MIC94045 includes a controlled rise time (1ms) soft start, I think the TPS22910 is similar which was better for my requirements and was smaller (space was a premium) than a MOSFET and R/C combination and easier to implement :)

Ash.
Controlling turn-on is easy, just put 10-47k in series with the MOSFET gate, the gate capacitance will limit turn-on rate.also good to make sure.you have significantly more capacitance before the switch than after it
« Last Edit: June 26, 2017, 11:21:34 am by mikeselectricstuff »
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7369
  • Country: nl
  • Current job: ATEX product design
Can't we use one of the GPIO pin of the microcontroller to switch off the microSDcard. MicroSD card takes not more than 3 mA, which controller can easily power. Why to use a extra FET.
A micro sd card can take up to 100mA or 200mA in worst case conditions.

A small supercap should allow you to use a few GPIO pins to power it.
Assuming you only need to save a small amount of stuff.

Feed the supercap with a resistor that wont overload the GPIO when the cap is discharged,
You could even have an ADC line on the supercap to detect when its charged and ready for a burst write. However a time delay is probably all thats needed.
That seems to be a perfect way to introduce brownouts and bad writing for the card.

If you really want to reduce the power consumption, dont use SD card. If you have to, use a decent quality card. And I'm not talking about "hey kingston is a good brand, right". I'm talking about panasonic industrial swissbit and so on. Probably they will not fit your budget.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf