Data logging shield
Here's a handy Arduino shield: we've had a lot of people looking for a dedicated and well-designed data logging shield. We worked hard to engineer an inexpensive but well-rounded design. Not only is it easy to assemble and customize, it also comes with great documentation and libraries.
You can get going within an hour - saving data to files on any FAT16 or FAT32 formatted SD card, to be read by any plotting, spreadsheet or analysis program. We even have a tutorial on how to use two free software programs to plot your data. The included Real Time Clock timestamps all your data with the current time, so that you know precisely what happened when!
Step 1: Overview
This page will run through the schematic, explaining whats going on and why picked the parts we did!
Here's the 'big picture' schematic for reference:
There is a small power supply on the board for generating 3.3V @ 250mA. We don't use the 'built in' 3.3v regulator on the Arduino because its only guaranteed up to 50mA and some SD card need a lot of power when writing. This supply is nice and steady, we can use it as an analog reference too! We have two sets of bypass caps to try and keep both 5V and 3.3V supply nice and clean - the 100uF ones are for the low frequency noise and 0.1 for higher frequencyReal Time Clock:
The real time clock is the DS1307 from Maxim, which has a battery backup (CR1220) and communicates with the Arduino via i2c (the SCL and SDA lines). i2c requires pullup resistors on the clock and data lines, which you see as R1 and R2. 2.2K are good values, but if you're in a bind, 1.0K to 10K will probably work fine.
The RTC requires a single 12.5pF load crystal at 32.768 KHz, Q1 - this is how it keeps time
There are also two LEDs for general purpose blinkin' - we like to use them to tell when the SD card is being written to.
SD card interface:
The SD card holder is connected to the Arduino through a buffer IC3. The buffer is a level shifter, converting the 5V signals into 3.3V ones which are safe to use. (For some cards its OK to use 5V signals but you risk the card being permanently damaged!) There is a pull up on the CS line so that if you program the Arduino with a ISP programmer while theres a card in, you wont scramble it.
There are two 'unused' lines from the SD card - Card Detect is shorted to ground when a card is inserted. Write Protect is shorted to ground when a card with the safety switch flipped is inserted.Arduino interface!
Finally we have the arduino interface. The Datalogger shield uses 6 pins. Analog 4 and 5 are the i2c hardware pins. The SD card uses Digital pins 13, 12, 11, and 10. The first three are pretty much required. If you really need pin 10, you can edit the library header file and change it from pin 10 to any other pin. BUT you must have pin 10 as an output, if its an input, the SD interface wont work (its a really annoying thing about AVRs - not sure why this is). A standard 6 pin ISP header is available in case you want to program the Arduino with code using a stand-alone programmer
There is also a RESET button, handy when you want to start the Arduino over!
Step 2: Tools and Preparation
This kit is pretty simple, but you should follow these steps fully so that you'll have no problems!Learn to solder
Learn how to solder with tons of tutorials!
Don't forget to learn how to use your multimeter too!Tools
There are a few tools that are required for assembly. None of these tools are included. If you don't have them, now would be a good time to borrow or purchase them. They are very very handy whenever assembling/fixing/modifying electronic devices! I provide links to buy them, but of course, you should get them wherever is most convenient/inexpensive. Many of these parts are available in a place like Radio Shack or other (higher quality) DIY electronics stores.
I recommend a "basic" electronics tool set for this kit, which I describe here.
Soldering iron. One with temperature control and a stand is best. A conical or small 'screwdriver' tip is good, almost all irons come with one of these.
A low quality (ahem, $10 model from Radioshack) iron may cause more problems than its worth!
Do not use a "ColdHeat" soldering iron, they are not suitable for delicate electronics work and can damage the kit (see here)
Check out my recommended basic soldering iron and where to buy.
Solder. Rosin core, 60/40. Good solder is a good thing. Bad solder leads to bridging and cold solder joints which can be tough to find. Don't buy a tiny amount, you'll run out when you least expect it. A half pound spool is a minimum.
Check out my recommended basic solder and where to buy.
Multimeter/Oscilloscope A meter is helpful to check voltages and continuity.
Check out my recommended basic multimeter and where to buy.
Flush/diagonal cutters. Essential for cutting leads close to the PCB.
Check out my recommended basic diagonal cutters and where to buy.
Desoldering tool. If you are prone to incorrectly soldering parts.
Check out my recommended basic desoldering tool and where to buy.
'Handy Hands' with Magnifying Glass. Not absolutely necessary but will make things go much much faster.
Check out my recommended basic 3rd hand tool and where to buy.Good light. More important than you think.
Step 3: Check the Parts List
Bill of Materials
Image Name Description Part information Qty
3.3V linear voltage regulator, 250mA currentMCP1700-3302E/TO 1
Level shifter for SD card
If you don't have this part, you've probably got a v1.0 kit. See the parts list below74AHC125 1
3mm Green LEDGeneric 1
1/4W 5% 10K resistor
Brown, Black, Orange, GoldGeneric 1
1/4W 5% 1.0K resistor
Brown, Black, Red, GoldGeneric 2
1/4W 5% 2.2K resistor
Red, Red, Red, GoldGeneric 2
0.1uF ceramic capacitor (104)
Looks deceptively like the 0.01uF ceramic capacitor!Generic 2
PCB Circuit board Adafruit Industries 1
Step 4: Solder the kit!
Solder together the kit
Prepare to assemble the kit by checking the parts list and verifying you have everything!
Next, heat up your soldering iron and clear off your desk.
Place the circuit board in a vise so that you can easily work on it
Place the resistor in the location marked R5. Resistors do not have polarity which means you can put it in 'either way' and it will work just fine. Bend the wire legs out so that the resistor sits flat against the PCB.
This resistor is necessary to keep the SD card deactivated when not in use - this prevents accidental writes to the card that could scamble it!
The next two resistors are 1.0K - their color strips are Brown Black Red Gold.
Bend and place them in the slots labeled R3 and R4
These resistors set the brightness of the two indicator red/green LEDs
Once you are feeling comfortable with the resistors, lets do the SD card holder. The holder is surface mount (there are no wires that go through the board) but the spacing is very generous, so it wont be difficult.
The holder has two bumps that 'snap' into place on the PCB. Make sure that the bumps are engaged and the holder is sitting flat.
The first step to soldering the holder is to 'tack' it in place. On the sides are 4 large tabs. Heat both the pad and tab together for 3 seconds and solder the tab down. Repeat for all 4 tabs. When you're done you shouldn't be able to move the holder.
We will now solder in the two 2.2K resistors (Red Red Red Gold) into the two slots labeled R1 and R2
These two resistors are used by the RTC chip data lines.
Solder the resistors using your now-expert resistor soldering skills
Next we will install the two yellow ceramic capacitors C1 and C3. Ceramic capacitors are not polar so they can be inserted either way and will work fine.
Bend out the leads like the resistors to keep them flat against the PCB
Next are the electrolytic capacitors C1 and C4.
Electrolytic capacitors are polarized and must be placed correctly. The longer lead of the capacitor is the positive (+) lead. Make sure this lead is placed in the hole marked with a +.
Look carefully before soldering to make sure you got this part right!
Next we will solder in the 3.3v regulator. The regulator is in a TO-92 package, with a semi-cylindrical plastic part and three legs.
Insert it into the location marked IC1. Because of the way the pads are layed out, the regulator wont sit flat against the PCB. Thats OK, it should stick up a little bit. Make sure the flat side of the package matches the outline on the silkscreen
Solder and clip the three leads
Next we will place and solder the 8 pin socket.
The socket is for protecting the clock chip and making it easy to insert and remove. Unfortunately, RTCs often shouldnt be removed which means that placing this part is not always preferrable. If the loggershield is going to be used in a place where the chip may get knocked out, you may want to skip the socket and just solder the chip in
The socket has a little notch in one end. That notch should match the one in the picture silkscreened onto the circuit board. This will help you place the chipin properly later. In this photo its on the LEFT
You may need to solder one pin of the socket while holding it it in with a finger (or tape) as the legs aren't long enough to be bent while in place.
Now you can place IC2 the DS1307 RTC chip into the socket by gently bending the pins in so that they line up with the socket and the dot and notch in the chip are on the same side as the socket notch. The RTC is what keeps time when the power is out, its a very very very low power microcontroller and crystal that will keep time for years on a tiny coin cell. This way you can mod your clock with ease and not have to reset it after power loss.
The next chip IC3 is the CD4050 which is the 3.3V buffer chip that converts the 5V signals from the Arduino to the 3.3V SD-card
IC's must be placed a certain way, or they dont work. Make sure you get this right because if the part is in wrong its a real pain to fix!
On one end of the chip is a round notch. In this photo its on the right. Make sure this notch matches the silkscreen underneath where there a similar round notch. In thie photo its on the LEFT
Solder in all the pins of the chip
First, melt a tiny bit of solder onto the center tab of the battery holder BAT. This will make good contact with the battery.
Now place the 12mm coin battery holder BAT and the 6mm button RESET. The button is a symmetric part so it can go in two ways. Line up the metal legs with the holes in the circuit board and snap it in. The button should sit flat against the circuit board.
Tack solder one side of the battery holder so it doesnt fall out when you flip over.
Next, break the 36-pin header strip into smaller sections so that the shield can be placed on the Arduino. You can use pliers or diagonal cutters.
You will be able to perfectly snap the long strip into 2 8-pin strips, and 2 6-pin strips.
Put the shield on top of the Arduino, so that the male header aligns with the solder holes.
Solder every pin of the male header. Keep the shield on the Arduino to make the job easy.
Once you're done, you can remove the shield from the Arduino.
Step 5: Use it!
Get 'er loggin'
Once you have your shield soldered up you can use the RTC and SD card for logging time-stamped data.
Step 6: Download files
For detailed information on installing libraries, make sure to read our tutorialPCB files
These files are Creative Commons Attribution, Share-Alike - enjoy!