How much current is drawn on hot insertion?

When an SD card is hot inserted, what is the typical current draw? What is the range?

You may get a huge spike since most cards have a big cap.

See the Cosideration to Bus Floating and Hot Insertion section..

Chan really knows SD/MMC cards. He has scope traces and suggestions for coping with the surge.

Thank you.

The board I am working with has a GPS which resets and loses fix for a short interval on card insertion. I don't have an oscilloscope but it made sense that there was probably a spike causing this. The GPS is connected to the 3.3V output of the regulator via inductor and capacitor, much like Chan's suggestion for the card slot. Unfortunately, the card slot is connected directly to 3.3V and the traces are such that inserting anything between the two would be challenging.

Maybe a minor design flaw? Fortunately it isn't a big deal for me. I was mostly just curious about it.

Try putting a 100 UF capacitor across the power rails right next to the SD card slot.
Additionally, you could put a 0.1 ohm resistor in line with the power supply(in series).

+wire wire wire resistor wire wire wire [SD Card + power]
capacitor

-wire wire wire wire wire wire wire wire [SD Card - power]

arduinorgb:
Try putting a 100 UF capacitor across the power rails right next to the SD card slot.

Unfortunately it would be very difficult to insert something right next to the slot. The +3.3V trace runs under the GPS and under the slot. There is only a very short section of trace visible between these two modules and there is little room to maneuver a knife for cutting a trace or an iron for somehow soldering something to that trace.

It would be possible to add a capacitor on the far side of the board, right next to where the 3.3V regulator feeds the GPS. In fact there is a smaller (10uF) capacitor there. I might try that at that some point.

Can you add another capacitor near the GPS to help hold it up? If there's already a large cap (10-100µF) then add a small one instead (0.1µF). The reason for the small one is that it's able to work at very high frequencies that the large cap can't.

As I said, there is a 10uF capacitor between 3.3V and ground near the GPS which would be easy to either replace or add onto. I'm just not sure what the best approach is (other than ignoring it). I don't have an oscilloscope and so only have Chan's observations to go on. Chan's recommendation isn't to add a 0.1uF capacitor. Rather, he suggests using a larger capacitor with a low internal resistance.

If you're curious, this is the schematic:

And this is a top view of the board:

The capacitor (C2) is just above the 3.3V regulator, to the right of the coin battery slot.

(edit: fixed image links)

You need lots more capacitance and it must have low ESR (equivalent series resistance).

Chan added a 47 µF low ESR cap to a 220 µF cap. I think a typical SD card has about 5 µF internal capacitance.

It looks like the Adafruit shield has a 10 µF cap. It probably is ceramic and very low ESR but is way too small.

I have an Adafruit GPS shield and it looks like it would be difficult to fix for hot SD insertion.

Here are two views of the hot insertion glitch. I put the probe on the GPS shield 3.3V.

The first image, GPS 33V 1.png shows the glitch at 500mv/200 µs per division. The glitch is far longer than Chan’s example.

The second image is 500mv/1 µs per division blowup of the above trace. It is a huge glitch in the first µs.

I added the 500mv/1 µs trace from a second card. It must have a larger cap since it pulls the voltage down over a volt for a long time. The ESR of the second card’s cap must be larger since the first spike is not as sharp as the first card.

Both cards cause the fix to be lost for a while.

fat16lib:
I have an Adafruit GPS shield and it looks like it would be difficult to fix for hot SD insertion.

Why couldn't I simply add those capacitors at the point where the 10uF cap currently sits? Or do you mean that you have a different GPS-only shield that would be hard to modify?

Without a way to look at the signal I'm kind of operating in the dark. But I wouldn't shy away from modifying the board on a hunch and then testing it repeatedly. If it's a good hunch.

My GPS shield is like yours.

You need to put the caps near the SD power pin for best results. The connections are under the SD socket.

The initial spike in the above GPS.png file is huge, almost 2 volts, and drops in a few nanoseconds. I am not sure putting more caps at the 10 µF cap will fix the problem.

There is already a ferrite bead and 0.1 µF cap on the GPS power pin so there must have been problems.

Maybe Adafruit can advise you.

I asked on the Adafruit forum and it was suggested that I add a 1000uF capacitor between 5V and ground on the Arduino. It was also suggested that I try using a power source with greater current capability.

The issue is largely academic to me. The GPS recovers fairly quickly in most cases. GPS outages happen in the real world all the time anyway. I'm just curious about it.

As to my original question, the support person at Adafruit estimated that a new SD card might draw as much as 100mA upon hot insertion. Does that sound right?

The Adafruit support person is totally wrong. The cap on 5V won't help.

When you plug the SD card in, there is a surge to charge the internal SD cap. If the internal SD cap has an ESR of 0.1 ohm, the surge could be as high as 30 amps.

I asked pito to look at this topic. He is an excellent engineer and can explain this problem better than I can.

I did simulation of that circuit and it seems it is an issue with voltage regulator. For any reasonable values of capacitor’s RLC and 100mA initial sdcard’s inrush current, the similarities with the transients you measured occur when the 3.3V power source is simulated with large series inductance >=1uH. Even so the transient is less than 1us for 10uH. As we do not have such inductance in series (I hope so) the transient must come from the voltage regulator, which most probably is not able to process such outrush current fast (after the initial overcurrent limitation).
sdcardhotinsert.JPG
sdcardhotinsert1.JPG

…and a more realistic simulation. I’ve used 317 voltage regulator model and nchannel fets with 20mOhm resistance as the hot insert switches (that simulates the insertion of the sdcard, even I doubt it would be so clean insertion in reality as the contacts will bounce for a while).
Also the caps are 20/50mOhm ones (X7R high quality low ESR ceramic multilayers, NOT the tantalum ones).
The 50nH inductances simulate the inductance of the caps and wires.
Simulated sdcard’s power-on current 100mA and 200mA (here I doubt the sdcard will start with 100mA current a few ns after insertion, I guess few milliseconds will be needed to start internal operations which may draw some current). So the majority of current immediately after the insertion comes from the internal capacitor (if any).
It seems the drop is minimal now :). Mind it is a simulation only…

sdcardhotinsert3.JPG

sdcardhotinsert4.JPG

Very impressive work, Pito.

So is the solution to replace the RT9193 regulator with an LM317?

I don't think replacing the regulator will fix the GPS lost fix problem. The SD draws a huge current spike to charge the internal 2 - 5 µF cap in the SD. See my scope pictures above.

These scope pictures were taken at the 3.3 V header on the GPS shield. Unfortunately the power trace goes from the 10 µF cap after the regulator, under the GPS module to the SD then to the 3.3 V header. There are no caps on this long trace.

I suspect the noise induced in the GPS module by the current in this trace will interfere with the GPS module.

The real solution for hot insertion is to limit the current surge. SD specs suggest a circuit to control the hot insertion.

pito, here is the GPS Shield. See the regulator and 10 µF filter cap near the coin cell. The header I connected to the scope is labeled 3V above the proto area.

I’ve seen the datasheet of the RT9139-33 (I’ve never seen this chip before) used on the shield (as I see it on the schematics above). The chip claims 400mA current limit, stable with 1uF in/out X7R mlc capacitors.
The load response when the load is changed from 1mA to 200mA is 60mV output drop for few usecs.
You may check the influence of the capacitor - take a 10uF discharged cap and connect it to 3.3V (output of the regulator) and to GND (properly polarized if not ceramics one). See what the oscope shows…

PS: 200mV drop upon insertion - https://hackaday.io/project/1347-fpga-computereval-board/log/9878-microsd-fatfs-in-dma

Provided a high quality capacitor 4.7uF ESR 50mOhm inside the sdcard, the inrush current is 40A peak (from 3.3V). A parallel combination of a 100uH inductor and 2.2ohm resistor put into sdcard’s Vcc (cut the trace and solder the R and L) may reduce the peaks:

sdcard inrush current.JPG

sdcard filter.JPG

That looks like a possible solution.

Here are two actual SD card results for hot insertion into the GPS shield. The scale is 500 mv per division. The probe is on the 3.3 V header near the proto area (see the above picture of the GPS shield). It is near the Adafruit logo labeled 3V. Not the Arduino 3.3V pin.

Any idea how much noise the GPS module can stand? The ceramic antenna is very near the power trace to the SD. That trace goes under the middle of the GPS module.

This is the only statement in the datasheet for the GPS.

The main DC power supply of the module, the voltage should be kept between from 3.0V to 4.3V.
The Vcc ripple must be controlled under 50mVpp (Typical: 3.3V)

It also suggests the following which suggests low noise is necessary.

  1. Ferrite bead L1 is added for power noise reduction.
  2. C1 and C2 bypass should be put near the module.
  3. Damping resistors R2,R3,R4 could be modified based on system application for EMI.

It may be too much to expect no loss of fix when inserting an SD.