Pages: [1]   Go Down
Author Topic: SD card module with 5V signals  (Read 2959 times)
0 Members and 1 Guest are viewing this topic.
Germany
Online Online
Faraday Member
**
Karma: 49
Posts: 2756
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are several similar modules available like this one
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=140717254516&fromMakeTrack=true&ssPageName=VIP:watchlink:top:en

They all consist of the SD card slot itself, a 5V -> 3.3V regulator+caps, and a couple of pullup resistors.

e.g. the MOSI signal from Arduino to SD is wired like this

       3.3V --- 10k ---+--- SD pin 2 (DI)
                       |
5Vsig -------- MOSI ---+


However, when testing with static voltages and without card, I see 5V at pin 2, which is out of specs, IMO.
I guess, a reverse biased diode is required between 5Vsig and the MOSI input pin.
Or at least helpful, to keep the SD pin between 3.3V (HIGH) and 0.6V (LOW)

Am I too timid ?
Logged

Chile
Offline Offline
Sr. Member
****
Karma: 0
Posts: 260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You might try using a 74HC245 as a buffer, as detailes here:
http://arduino.cc/forum/index.php/topic,31712.0.html
Text is in Spanish, but you'll find a circuit schematic.
Logged

0
Offline Offline
Shannon Member
****
Karma: 162
Posts: 10523
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That buffer circuit is wrong, its connecting 5V Arduino outputs to the 74HC245's inputs, shortcircuiting the outputs of the Arduino through the 74HC245's input protection diodes to 3.3V - this could damage the 74HC245, the Arduino, or raise the 3.3V rail to well above 3.3V - none of these are desirable.   Basically the voltage mismatch has been moved from the SDcard to the '245
Logged

[ I won't respond to messages, use the forum please ]

Germany
Online Online
Faraday Member
**
Karma: 49
Posts: 2756
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My concern is not the "how to ? " but "is it required ?"

Those modules often claim to work with an Arduino, and are equipped with a voltage converter to be fed by 5V and provide 3.3V for the SD card. So I assume they are meant for 5V signals, too.

I just see that a 5V signal ( MOSI or CLK ) shows up with 5V at the SD card pin, and I read this is beyond the specs ( 3.6V max.)

So my questions
 - Anyone using such a module, and how ?
 - Does this observed voltage drop to 3.3V with an actual card inserted ?
 - Doesn't it hurt, if at least Vdd is 3.3 V
 - Would you strongly recommend that diode, which effectively just makes a LOW signal pull down the SD pin input.


Additionally, I noticed that the CS signal is not connected to a 3.3V pullup resistor at all, on my module.
Is there a voltage divider ( either 2 resistors or a diode+pullup resistor or another voltage divider IC ) required/ recommended, if I need to use the CS pin, as there are other SPI devices on the same MISO/MOSI/CLK pins.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 516
Posts: 31579
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The point is that there is a lot of crap designes out there, so I would not take design lessons from what you see.
While they might work for a time stressing electronic components above the rated values is going to shorten there life. It is very unlikely that these designes have been tested properly.

So yes if you want a good design do it right, if not buy crap from eBay.
Logged

Germany
Online Online
Faraday Member
**
Karma: 49
Posts: 2756
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
if you want a good design do it right, if not buy crap from eBay

I noticed that others use a 74AHC125N level shifter for all 3 input signals, and they even add an additional pullup resistor for the CS line to keep the SD card definitely inactive during bootloading via SPI.

Now that I got this module from ebay already, I'll definitely add the diodes and pullup before testing.
And consider using a level shifter IC, in the long run.

Thanks for your feedback.
Logged

0
Offline Offline
Shannon Member
****
Karma: 162
Posts: 10523
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The 74AHC family accept input voltages above Vcc, so that design with 74HC245 simply needs a 74AHC245 to make it work..
Logged

[ I won't respond to messages, use the forum please ]

SF Bay area
Offline Offline
Sr. Member
****
Karma: 2
Posts: 266
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Michael,

your initial post is correct. you just need to add a diode and you will not see the 5v on pin 2. The lower the forward voltage of the diode, the better. I use this method to level shift RX TX from 5v to 3.3v and it works fine as well.  This is an acceptable way to level shift. For instance, Digi, which makes the XBEE modules, mentions this as one way to level shift.  The other option is to disable the internal pullup resistor of the atmega output pins going into the SD card. I have not tried this with SPI, but it works fine with TWI, for which both SDA and SCL are bidirectional.

I have this exact SD card and adding a diode is all I did with input signal pins (no need to do anything to output pins) and it works perfectly fine. Just make sure you are not getting higher than 3.3.v on the input pins. What you will be stressing with the higher voltage is not the SD card module but the SD card itself.

Logged

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 24
Posts: 1766
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's some INFO on the ArduinoInfo WIKI- http://arduinoinfo.info
http://arduino-info.wikispaces.com/SD-Cards
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Germany
Online Online
Faraday Member
**
Karma: 49
Posts: 2756
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What you will be stressing with the higher voltage is not the SD card module but the SD card itself.
Understood. Besides the 5->3.3V regulator there's not too much on the module to stress. I heard about people solder some wires directly to a microSD Adapter and use this as an interface to microSD cards. 

Quote
The lower the forward voltage of the diode, the better.

There's not too much current flowing via a 10k pullup resistor and 3V, so any small signal diode ( 1N4148, about 0.6V Vf ) seems ok. Small Schottky diodes are certainly better.


Thanks Terry, for the link to a broad variety of SDFat libraries. Good to know. Thanks
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 516
Posts: 31579
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
This is an acceptable way to level shift.
No it is NOT.
It is a crap way to level shift!
Logged

SF Bay area
Offline Offline
Sr. Member
****
Karma: 2
Posts: 266
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I heard about people solder some wires directly to a microSD Adapter and use this as an interface to microSD cards. 
Ah! I should have thought of that. I have a few of those adapters laying around, I'll try to wire them up. The SD card contacts are essentially the SPI pins. The genius is in the simplicity of the solution and thinking outside the box.  smiley-wink

Thanks Terry, for the link to a broad variety of SDFat libraries. Good to know. Thanks
listen to Terry.
Logged

Chile
Offline Offline
Sr. Member
****
Karma: 0
Posts: 260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That buffer circuit is wrong, its connecting 5V Arduino outputs to the 74HC245's inputs, shortcircuiting the outputs of the Arduino through the 74HC245's input protection diodes to 3.3V - this could damage the 74HC245, the Arduino, or raise the 3.3V rail to well above 3.3V - none of these are desirable.   Basically the voltage mismatch has been moved from the SDcard to the '245

Thanks MarkT. You just saved my toys   smiley-mr-green , I was about to test this solution .
Logged

Pages: [1]   Go Up
Jump to: