How to reduce power consumption while using micro SD card with microcontroller - Page 1
Forum section: electronics / projects

author: tapasxplore
author_rank: Contributor
timestamp: June 21, 2017, 06:04:16 am
content: 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.

author: Jeroen3
author_rank: Super Contributor
timestamp: June 21, 2017, 06:24:45 am
content: 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.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: June 21, 2017, 08:16:47 am
content: Quote from: Jeroen3 on June 21, 2017, 06:24:45 amYou 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.

author: Jeroen3
author_rank: Super Contributor
timestamp: June 21, 2017, 08:24:49 am
content: 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.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: June 21, 2017, 08:34:49 am
content: Quote from: Jeroen3 on June 21, 2017, 08:24:49 amBut a battery powered system should already have protection to limit current in a fault condition.

author: tapasxplore
author_rank: Contributor
timestamp: June 21, 2017, 09:07:28 am
content: It is possible to reduce power without changing the schematic. How to reduce micro SD card power consumption.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: June 21, 2017, 09:13:24 am
content: Quote from: tapasxplore on June 21, 2017, 09:07:28 amChoose the lowest power card you can find.Still won't make anything like as much difference as doing it properly by switching the power

author: amyk
author_rank: Super Contributor
timestamp: June 21, 2017, 10:19:14 am
content: Keep in mind that an SD card itself has arather 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.

author: MosherIV
author_rank: Super Contributor
timestamp: June 21, 2017, 10:24:18 am
content: QuoteIf 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)

author: tapasxplore
author_rank: Contributor
timestamp: June 21, 2017, 10:56:56 am
content: Can any one help with the command which can put SD card in the power blocking mode, I am using FatFs library.

author: MosherIV
author_rank: Super Contributor
timestamp: June 21, 2017, 11:06:18 am
content: You searchfoo is weak young onehttps://www.sdcard.org/developers/overview/sdio/sdio_spec/Simplified_SDIO_Card_Spec.pdfThere is an entire section on power control.QuoteIf 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)

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: June 21, 2017, 11:37:41 am
content: Quote from: tapasxplore on June 21, 2017, 10:56:56 amThe 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.

author: Jeroen3
author_rank: Super Contributor
timestamp: June 21, 2017, 12:34:02 pm
content: There are some reports on the internet about sd card power consumption. But they are dated.https://electronics.stackexchange.com/a/123386/148363

author: MosherIV
author_rank: Super Contributor
timestamp: June 21, 2017, 07:11:29 pm
content: 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.

author: d-smes
author_rank: Regular Contributor
timestamp: June 22, 2017, 10:32:30 am
content: 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.

author: tapasxplore
author_rank: Contributor
timestamp: June 25, 2017, 04:27:40 pm
content: 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.

author: tapasxplore
author_rank: Contributor
timestamp: June 25, 2017, 04:38:03 pm
content: Will the load switch from TI such as TPS22910 will work. Can any one help with part number.

author: Jeroen3
author_rank: Super Contributor
timestamp: June 25, 2017, 08:59:45 pm
content: 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!

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: June 26, 2017, 08:19:27 am
content: 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.

author: Fungus
author_rank: Super Contributor
timestamp: June 26, 2017, 10:14:08 am
content: Quote from: Jeroen3 on June 25, 2017, 08:59:45 pmWhoah!

author: Ash
author_rank: Regular Contributor
timestamp: June 26, 2017, 10:30:23 am
content: Quote from: tapasxplore on June 25, 2017, 04:38:03 pmI'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 implementAsh.

author: Psi
author_rank: Super Contributor
timestamp: June 26, 2017, 10:38:44 am
content: 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.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: June 26, 2017, 11:02:52 am
content: Quote from: Ash on June 26, 2017, 10:30:23 amControlling 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

author: tszaboo
author_rank: Super Contributor
timestamp: June 26, 2017, 12:03:11 pm
content: Quote from: tapasxplore on June 25, 2017, 04:27:40 pmA micro sd card can take up to 100mA or 200mA in worst case conditions.Quote from: Psi on June 26, 2017, 10:38:44 amThat 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.