Go Down

Topic: ultra-cheap microSD slot thing idea! will it work? (Read 2462 times) previous topic - next topic

thatdude624

so, I looked around on the internet for an SD-card slot thing, and I noticed they were all quite expensive( imagining how my cell phone was made this cheap) and I thought that there must be an easier(cheaper) way to do this!

first, I thought alligator clips leading to the resistors into the arduino, but for my purposes, the card needed to be removed and put into my laptop far analysis/adding files, and I whud forget witch alligator clip went were, and they might come loose.
next, i thought soldering, but quickly noticed how horrible that idea is. it makes the connections permanent, can damage the card, and make it unusable for other uses without a lot of effort to get it back to normal.

and then, I got it. kind of combining both ideas, I remembered that there are microSD cards too. thought about how I can possibly wire that. remembers that we have like 10 microSD to SD converters, and thought, "what if I solder one of those converters to the circuit! easy to remove the card, cheap, and genius!"

why did I post this? 2 reasons. 1: so you guys can use the idea if you did not already discover it (I might be like the 100th to post it, then sorry) and 2: I need your help for the following:
will soldering a micro-SD converter damage it? I do not think so, as all it probably contains is some wires, possibly an SMD resistor or 2.
what is the pin-out of SD cards? also, SD sockets might short pins to tell the card it is plugged in or something.
how do you wire this to the mega? I know about this, http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206874649 , but I heard you have to wire SD cards differently for the mega.
lastly, is this idea sane or unique? I have a feeling it is not...

sorry for spelling, and noobness, I realise some of these questions are obvious to some and simple-looking.
thanks in advance, and for reading!

PaulS

Quote
so, I looked around on the internet for an SD-card slot thing, and I noticed they were all quite expensive

I guess it depends on your definition of "quite expensive". Personally, my time is worth more than this:
http://www.sparkfun.com/products/544

thatdude624

I saw that. another thing is I need to order from local stores witch make things quite expensive, since in SA there is no competition on robot parts and the sort.

also, I like DIY because you can then answer "I built it myself" to "where did you get that?".
lastly, I feel I need some more soldering practice for my long-long term goal: create a functioning mini-computer from scratch,using ATmegas,soldering and a custom PCB, and make it run L-OS, on OS I am working on. currently I made a proof of consept of the prototype (yes, a prototype of a prototype) and need to get all sorts of stuff to make the final prototype, while wasting as little as possible. currently it needs an SD-card and the mega, as I am running out of space on my poor UNO and need somewhere to put user programs, pictures and stuff.

cyclegadget


I will try to give you a few pieces of the puzzle.

People have said you can solder to the SD converter pins. If I would try it I would use small wire and try to be as quick as possible with the soldering process.

Here is a link to the SD pin-out, I found in a google search. http://pinouts.ru/Memory/sdcard_pinout.shtml

You will need to level-shift all but the MISO pin from 5 volt down to 3. Look at the schematic from this shield to see what I mean. http://www.sparkfun.com/products/9802
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

fat16lib

Soldering to a microSD converter can make connections unreliable.  Also using resistor voltage dividers can result in undetected errors. 

You should use a slow SPI clock since SPI signals are marginal with voltage dividers at high speed, 8 MHz on the Arduino.  The Arduino does not support CRC so most data errors will not be detected with marginal signals.

One of the best microSD breakout boards is made by Adafruit.  It has solid state level shifters. http://www.adafruit.com/products/254

thatdude624

OK, so my idea will not work.

I cannot get that adafruit thing because they only sell the sparkfun SD card sheild here, but there have been complaints of it not working with the mega. Can someone confirm this or tell me what to modify (software is prefered) to make it work?
Stupid expensive parts, why cant  SD card slots be as common and inexpensive as battery holders...

CrossRoads

The sparkfun breakout board does not the level converter chip that the adafruit shield has. You can wire your own chip & resistors in between the sparkfun breakout board and your arduino to get the same reliable results.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

thatdude624


The sparkfun breakout board does not the level converter chip that the adafruit shield has. You can wire your own chip & resistors in between the sparkfun breakout board and your arduino to get the same reliable results.

Sorry, I do not fully understand that.
Well, i kind of need to know what chip and what resistors i need and where for it to work. I do not realy care about fancy error prevention, ( unless it does not work 20% of the time r more) i just want it to work. Both boards look like the same IC on them. Also, I  cannot do SMD soldering.

CrossRoads

Sorry, did not realize the sparkfun board was more than just a breakout board, that it had a buffer chip too.

Its not so much about fancy error protection, but about working at all.  With high speed uSD cards, using resistor dividers does not provide reliable operation.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

thatdude624

OK, so board is decided.
also, I found this:
Quote
Using this with the MEGA 2560, without changing the pinout. Using SDFATLib20101010 Line 42 of Sd2Card.h Change to: #define MEGASOFTSPI 1 Line 74 of Sd2Card.h Change to: uint8t const SDCHIPSELECTPIN = 8;

This will enable software SPI and be somewhat slower, but still plenty fast for most applications.

I have no idea on how to do that, though. also, I prefer arduino's SD lib, looking at ease-of-use and the demo programs. but I guess I can use that too.
can someone explain how to modify this data>

PaulS

Quote
can someone explain how to modify this data

What more do you need to be told? You know what files need to be changed, what line in the file needs to be changed, and what the line needs to be changed to.

If you are interested in a software solution to a hardware problem, it implies that hardware is your weak point, but that software isn't.

This post implies that hardware and software are your weak sides.

johnwasser

An alternative to the Micro-SD adapter is to find a dead device with an SD slot and salvage the socket off the board.  Heat the back of the board with a torch or flame until the solder melts and then tap the board against a brick or tile to jar the socket loose.  You can then solder wires to the socket's pins.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

fat16lib

You can enable MEGA_SOFT_SPI for the Arduino SD library.  The Arduino SD library is just a wrapper for an old version of SdFat.  It has a number of bugs that have been fixed in newer versions of SdFat but they don't seem to bother most people.

Edit the file Arduino/libraries/SD/utility/Sd2Card.h and change line 42 to this:
Code: [Select]
#define MEGA_SOFT_SPI 1

You don't need to edit the chip select pin.  Just set the chip select in the begin call like this:
Code: [Select]
  SD.begin(CS_PIN);

thatdude624

Quote from: fat16lib
You can enable MEGA_SOFT_SPI for the Arduino SD library.  The Arduino SD library is just a wrapper for an old version of SdFat.  It has a number of bugs that have been fixed in newer versions of SdFat but they don't seem to bother most people.

Edit the file Arduino/libraries/SD/utility/Sd2Card.h and change line 42 to this:
Code:
#define MEGA_SOFT_SPI 1

You don't need to edit the chip select pin.  Just set the chip select in the begin call like this:
Code:
  SD.begin(CS_PIN);

thanks! just what I needed!

@johnwasser ,but all the devices that have SD cards still work! if only I knew this half a year ago. yet again, you can never keep all that junk. :)
@PaulS , i wrote that incorrectly. I meant what to change in the arduino library, I do not know why I said it the wrong way. I am very good in software and computers in general, just not soldering and electronics, but eager to learn. in fact, I recently built a functional 10 Bit computer in a computer game, complete with GOTO,GPU,RAM,ALU, it has it all, and is capable of games. and the only logic gate was NOT and OR.
(sorry, I just get mad when people insult me of something I am good at, has something to do with my TERRIBLE social skills)

theNetImp

I actually saw the same diagram and had a similar thought.  I have a lot of micro SD cards adapters that are standard SD card.  I used the resistors, but used different Arduino pins based on one of the SD example sketches.  I used the 1.8K/3.3K series resistors to do the breakdown to 3.3V digital high as in the example diagram in the original post.

SDP 9 - Not used
SDP 1 - ArdPin 4  (use the 1.8K/3.3K resistor chain to lower the digital high from 5V to 3.3V)
SDP 2 - ArdPin 11  (use the 1.8K/3.3K resistor chain to lower the digital high from 5V to 3.3V)
SDP 3 - GND
SDP 4 - +3.3VDC
SDP 5 - ArdPin 13 (use the 1.8K/3.3K resistor chain to lower the digital high from 5V to 3.3V)
SDP 6 - GND
SDP 7 - ArdPin 12
SDP 8 - Not Used

As for soldering it wasn't terribly hard.  I took the SD packaged microsd card adapter and put a small dab of solder on each of the pins  Then I took some old lead cut offs (I save them for things like this), and quickly reheated the solder with the lead on top afterwards I just clipped the leads to the same length.



While I don't use pin 8 I did give it a lead in case I ever wanted to use it.  The first pin with no lead is pin 9

This was a great learning experience as far as how easy it is to connect an SD card to an arduino.  It took all of an hour which it would have taken me even if I had spent $10 on the sparkfun version.  If you haven't tried it give it a try.

Also the sketch I used to test it was the "Examples => SD => Files".  The pins I use above are the ones used in this sketch and in the other example SD sketches.


Go Up