SD Card LC
SD Card LC
Looks like we've spent $14+ already, almost the cost of a ready-made SD
card shield. But, hopefully you can find or scavenge at least a couple
of the above components in your junk box, from a previous project,
or from a broken gadget or two. If you're halfway serious about DIY
Arduino projects, then you already have a couple of protoshield boards
and header sets stockpiled.
Each pin in the top row connects across to the corresponding pin
in the bottom row, so you can use either pin in any given two-pin column.
The best solution is something called a level shifter. Essentially, this means
putting 5v on the input of a non-inverting buffer and getting 3.3v from the output.
Shifting the voltage level, get it?
But just how is this magic accomplished?
One way is to use a CMOS hex buffer IC,
here a 4050, and power it (pin 1, Vdd) at 3.3v.
Put 5v on the input of one of the gates,
and you get 3.3v on the output of that particular
buffer. For example, with 3.3 v on pin 1 (Vdd) and
pin 8 connected to ground, a 5v logic level on
input pin 14 (gate 6) results in 3.3v on output pin 15.
Install the reset switch, LED(s), resistor(s), and male and female headers in
the appropriate places on the protoshield board. This is probably
not the first shield you've built, so I won't go into too much detail.
Install the male headers, but this time use an Arduino board to align them.
Position the set of two 8-pin female headers (1 standard and 1 stackable)
atop the pins on the LC Studios board. This will set the alignment and
spacing. (See next-to-last photo.) Note that the we are using the
stackable header because it provides a longer pin surface to attach
wires to on the solder side of the board. It's also convenient to be able
to bend the long pins and attach them directly to the ground and +5v busses,
as necessary. Whether you place the stackable header in front or in back
doesn't matter -- whatever works better for you.
We'll connect and solder the pins according to the hookup diagrams
in the next step.
CS [15]
[14] D4
MOSI [12]
[11] D11
SCK [10]
[9] D13
MISO D12
Carefully examine the wiring and our soldering for shorts and solder
bridges. Particularlly check for a short between the +5v and ground busses.
Using the ohms function of a multimeter is helpful.
We're ready for the "smoke test." Plug the completed board into an
Arduino, apply power . . . and pray.
Pictured is the completed shield, with LC Studios board, plugged into our
very own Hackduino (https://www.instructables.com/id/Haywired-Hackduino/).
No smoke? Didn't burn anything out? Great! Switch off the power, then
insert an SD card -- the "obsolete" 1 or 2 GB variety. The newer high-density
4 GB and up varieties may not work.
Success!
Step 10: Notes
The MISO pin on the LC board is an output and goes directly to the
Arduino, so no level shifting is necessary.
Almost all the examples that come with the Arduino SD library work
with our DIY shield. Only the "SD Card read/write" example fails,
possibly due to timing considerations because of point-to-point
wiring.