0

I'm trying to understand the power requirements of an SD card. I have a cheap breakout board from eBay that includes built-in level shifters, so I can plug it in directly to my Arduino. I provide power from one of the digital pins, and it works. This doesn't make sense to me, as I thought an SD card reader should draw upwards of 50-100 mA, well over the capacity of an individual digital pin on the Arduino. However, at least one SD card manufacturer does this as well, so I'm not making this up.

I have checked, and the data is written no problem. I have connected an ammeter between the Arduino and the SD reader, and it never jumps above 3 mA? The only problem I have is when I switch from using the USB cable (connected to my computer) for power to a battery pack, the SD card starts acting erratically. Which makes sense, if it's not getting enough current.

What I'm wondering is why it ever works when connected to a digital output pin? Clearly I'm missing something important.

Edit: The reason why I thought they required a lot of current: I've seen comments like this on a number of tutorials:

One is that they are strictly 3.3V devices and the power draw when writing to the card can be fairly high, up to 100mA (or more)!

Edit2: @dlu answer lead me to investigate the voltage I was sending to the SD card reader, which turns out to have been the problem. I was supplying the Vin pin with 5.2V, which was regulated down to 4V, presumably too low for the 5V-3.3V step-down at the SD card. Moving the battery power to the 5V pin corrected this. This also introduces some new risk, as the board is now receiving unregulated power. But that is another problem.

Edit3: And finally, answering my original question: I found a note on the Adafruit product page for a similar breakout that indicates:

Onboard 5v->3v regulator provides 150mA for power-hungry cards

So despite only drawing 3mA of current from the Arduino pin, the actual SD card is supplied with > 100mA from the regulator.

1

It seems that you've verified that the power requirements are within the range of a digital pin. Is there a reason why you thought they would be higher?

So, it sounds like the real question is "why does the SD card work with USB power, but not with battery power?" The first thing that occurs to me is that the battery is not providing sufficient voltage. What kind of battery are you using and where do you connect it to the Arduino?

Almost any battery that you use will be able to provide sufficient current for a 3 mA load, but the voltage may not be adequate – especially if you are running a marginal battery (voltage wise) through the onboard regulator.

  • I was plugging the batter into the Vin and GND pins on the Arduino. I added a link to one reference to the high current draw of SD cards in my question. – Tyler Jan 9 '16 at 21:54
  • Forgot, the battery pack is 4 AA rechargeables (1.2V), which are actually producing 5.1V at the moment (from my multi-meter), so presumably they're still well-charged – Tyler Jan 9 '16 at 21:57
  • Checking the voltage drop across the SD card, when plugged in via the USB cable: 4.9; battery connected to Vin: 4.0; battery connected to Arduino 5V pin 4.9. And the SD card works when powered via USB, the 5V pin, but not the Vin pin. I didn't realize Vin and 5V weren't the same thing! – Tyler Jan 9 '16 at 22:11
  • Thanks, that was the nudge I needed to chase down the problem. I've updated my question with additional info and a solution arising from your suggestion. – Tyler Jan 9 '16 at 22:26
2

I just tested a SD card in an adapter (with level shifters). Without any activity the SD card is only drawing around 0.5 mA. So that is in the capability of an output pin.

Doing a directory list appears to use a maximum of 7 mA, so that is OK.

Writing a file used a maximum of 54.3 mA, which is exceeding the absolute maximum ratings for an output pin (40 mA - recommended only 20 mA for continuous current).

Now you may say that "it works" but the question is: for how long? Exceeding absolute maximum ratings is a path to damaging your processor.

If you want to turn the SD card on and off from time to time, to reduce power, I suggest you arrange to switch the 5V line (and not use a digital output). For example from this page about a low-power temperature sensor I have this schematic:

Power switching MOSFET

The MOSFET there switches a 5V line on and off under program control.

That particular design includes a SD card, and that particular gadget has been working for a couple of years now.

Photo of hardware:

Temperature and humidity sensor

  • Thanks Nick. I found your logger while I was researching this issue, it will be a very helpful resource. When I monitor the current of my SD card, it stays below 3 mA even when writing to the card. Is it possible the onboard voltage regulator is this efficient, or is it more likely my current meter is not good enough -- I'm using an INA219 current sensor board. – Tyler Jan 11 '16 at 14:44
  • Measuring burst current isn't the easiest thing in the world. In my case I had my meter on "min/max" mode and hoped it would sample fast enough. My advice is, for the sake on a MOSFET and a couple of resistors: play it safe and switch the power like I showed. – Nick Gammon Jan 11 '16 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.