Category Archives: DIY Build a Pro Mini Logger

… from a few inexpensive components …

For an in-depth description of the Cave Pearl loggers and their performance
see: http://www.mdpi.com/1424-8220/18/2/530

Arduino Pro Mini Data Logger : Part 1: Component Preparation (2015)

This logger is a combination of inexpensive pre-made modules from the open-source Arduino ecosystem, and can usually be assembled by beginners in 1-2 hours.

Note: In 2020, we updated the design to reduce the overall build time. We’ve also added support to the code for using the indicator LED as a light sensor, so you can start monitoring the environment with the logger right away.

https://thecavepearlproject.org/2020/10/22/pro-mini-classroom-datalogger-2020-update/

If this is your first attempt at making  a datalogger, then that new arrangement might be an easier place to to start than the tutorial set from 2015 shown below. The core components & their inter-connections are essentially the same.

 

 


The connection diagram for the Cave Pearl loggers follows this general pattern:

Note: This diagram uses the pin-outs of a Rocket Scream Ultra 8Mhz board with μSD adapter pin numbering convention per this document.  I like the Ultras as they use a more efficient MCP1700 voltage regulator, but the whole point of the design is that you can build one of these loggers with any 3.3v ‘mini’ style board you can get your hands on simply by matching the connections to the pin labels [ Figure from:  Cave Pearl Data Logger: A Flexible Arduino-Based Logging Platform for Long-Term Monitoring in Harsh Environments Sensors 2018, 18(2), 530; doi:10.3390/s18020530 ]

This tutorial will show step by step construction of that basic plan using the more common Sparkfun pro-mini style Arduino board, which has different pin locations than the Rocket Ultra but the connections are all the same. We will be assembling the logger on a plumbing test cap platform to facilitate placement in a 4″ housing made from plumbing parts:

Basic 3 component data logger with promini style boards

Note: A list of build parts & suppliers can be found HERE, and I will try to embed direct links into these instructions later.

Also Note: I posted a bare bones logger script for the UNO based logger tutorial on the project’s Github, and that is probably about the most minimal thing you can run on these loggers and it should be easy for folks to modify. To see a more developed code, with support for multiple different sensors,  you can dig into the other code builds for the project.

And Also Note: In 2016 I posted an alternate build of this logger that uses Dupont style jumpers. It’s cheaper, takes about 1/3 less time to build, and is much easier for beginners to assemble. However the connections are not as robust as a soldered build, so if you are willing to pay the “iron price” the one shown here is better suited to rough & tumble of real world deployments.

After assembling more than fifty of these loggers, it now takes me about 4 hours (not counting epoxy cure time) to go from raw parts to a completely functioning logger. However, experience teaching other people how to make them has shown that if you can get your first one together in about 8 hours, you are doing great. Especially if you have never soldered before!  The unit in the photo above was built with eBay parts for about $13, and the PVC housing in this tutorial will set you back another $8-10 (and not counting UART adapters, sensor breakout boards, or the tools you need like soldering irons or epoxy applicator guns).  There are plenty of simple loggers out there in the $30$60 price range for things like temperature, pressure, etc., so the only reasons to build your own are 1) because you are doing something that is not already available on the market at a reasonable price  (An example would be having your logger change it’s sampling frequency in response to interesting events: a feature like that is rare even at the high end of the market, though it is easy to do when you have access to the code) or 2) for the fun of doing it!  And don’t underestimate that second one: few things are as addictive as getting beautiful time series data from equipment you built with your own hands.

My wire color conventions are:
Red=positive power (both raw & regulated), Black=Ground, White=I2C Data, Yellow=I2C Clock, I usually use blue or green for interrupt signals, and other colors for the SD card SPI lines. I try to keep indicator LED leads the same color as the light they are controlling. I usually cut a bunch of 12cm wire segments and tin them all with a solder pot before starting a build. Adafruit has the best multi-strand 26awg silicone wire, but you can get by just fine with the 7-strand pvc stuff if the budget is tight.

Before starting:
Clean flux residue from breakout boards with 90% isopropyl alcohol. Ultrasonic cleaning  in alcohol for 2x five minute sessions (outside & away from sources of ignition!) works well but you can also do it by hand with a Q-tips, etc. Brand name boards from reputable vendors like Adafruit or Sparkfun are usually very clean, but cheap knock-offs from eBay will be covered with goop that is guaranteed to corrode inside your loggers over time. Do not use ultrasonic cleaning on parts that are sensitive to vibration,  like accelerometers,  or you could damage them.


Component Preparation:
Each of the 3 main components is prepared with riser pins & jumper wires before the whole logger assembly takes place.

1)   The Arduino ProMini style board

PinLayout11. Remove the limit resistor for the power LED to disable it. Usually you can’t see these indicator lights because they are inside your data logger housings, so disabling the them will conserve battery power.
I usually also remove the limit resistor on the pin 13 indicator LED, although on your first build you should leave it there for testing purposes.  My concern is that current drawn by the LED  (because limit resistors vary from one board to the next) might interfere with SPI communications to the SD card.

Riser Pins2. Solder the pin headers into place. Use two extra long pins for GND & RAW, and bend them 90 degrees under the Arduino board so that they protrude from the side of the board. Cave Pearl data loggersThese under board connections will connect with the battery pack, leaving the vertical risers from the GND & RAW pins available for the connection of a resistor voltage divider to monitor the battery. I usually bend on the serial I/O pins slightly away from the other risers, just to make a little more room for connecting the UART boards.

Cave Pearl data loggers3. At this stage it makes sense to bend and add solder to several riser pins. Bend digital pins 10-13 away from the main board for later connection to the SD card wires. Bend pin A0,  RAW & GND pins in toward the processor so that the battery voltage divider can be located above the board.

 

4. Then add solder all of the following riser pins to make connecting the jumper wires easier later on:

  • A0 & vRAW & GND   on one side of the board
  • Vcc (3.3v), the other GND pin on the far side (you can never have to many ground connections!)
  • D 10-13 where you will be joining the spi SD card jumper wires later
  • D 2-9 (you may not use all of them, but it is much easier to tin those pins at this stage than doing after the logger is assembled)
  • Sometimes I also tin the rest of the vertical pins in case I need to connect something to them later. This also depends on whether I plan on adding analog sensors to the logger.

Cave Pearl data loggers5.  A4 & A5 are needed for the I2C bus, but on pro-mini style boards these are somewhat inconveniently located wrt the voltage divider we use to monitor the main battery status.  Soldering a white jumper wire directly to the board at A4, and a yellow jumper wire to A5 allows us to breakout these connections. I usually strip, twist & pre-tin the wire ends before putting then through the board for these connections. Otherwise a stray bit of wire might not make it through the hole, and cause bridging problems.

6. Prepare two 4.7 Meg ohm resistors and 0.1 μF capacitor (code 104) as shown to form the battery monitoring voltage divider.  The idea is to have this divider fit neatly within the board footprint as you connect to the appropriate the riser pins. Solder the end with all three together at A0.

Cave Pearl data loggersCave Pearl data loggers

Be sure to use an ohm meter to find resistors with values as close to each other as possible before you solder them together. It’s easy to end up with two opposing % errors that throw off your battery reading even if they are from the same batch.

Cave Pearl data loggers

It is very important that there is an air gap between the RAW & GND leads of the voltage divider (on the right hand side), so that they DO NOT MAKE CONTACT with each other. This would short out your power supply! It might be a good idea to put some heat shrink in there too.

7. First solder the middle of the divider securely to pin A0. With that A0 connection in place, bend an ‘L’ into the lone resistor leg so that it lines up with the  vRAW pin you bent and tinned earlier (ie: the one closest to the serial i/o pins). Try to get this connection fairly close to the Arduino board to make some room for the ground connection which will go above it.  Then do the same procedure for the combined cap/resistor pin, soldering that onto the ground line riser pin. After the solder joints are in place, trim away the excess wire leads, being careful not to accidentally cut the riser pins.

Note: see this Jeelabs Post  for more information on this method to track battery voltage

8. With the board level soldering finished, give the pin solder connections a thorough cleaning with 90% isopropyl alcohol to get rid of any flux residue. After drying, waterproof the Arduino board with a coating of silicone conformal coating (or nail polish) being careful not to get any on the risers or the reset button. Let the coating dry in a well ventilated area before proceeding to the next step.  This coating is optional, but a good idea for electronics you are going to deploy in the field.

 At this point you will be soldering some 3-4 inch jumper wires to the pre-tinned riser pins. 26AWG silicone jacket wire from Adafruit is my current favorite, but any thin multi-strand wire will do.  I use thicker 20 or 22 gauge wire for the two battery power lines to make them more robust for the handling they see when the loggers are in use. Putting heat shrink over pin-jumper connections protects from accidental bridging when you place the logger platform into the housing. I advise that you use transparent tubing, as this makes it easier to spot a failed solder joint.  Clear milspec 1/16”/1.5mm polyolefin heat shrink tubing is an excellent option, as it becomes very stiff when it cools, providing protection from flexing and holding a ‘bend’ in your wires that can help with cable routing.

Cave Pearl data loggers9. On the side with the voltage divider add a red jumper to the VCC pin. This is the 3.3v regulated power line that will provide power to all of your devices & sensors. Then add thicker battery connector wires to the two bent pins extending from below the board. Cut all your jumpers to about 4 inches, and TIN THE STRIPPED WIRE ENDS BEFORE YOU TRY TO SOLDER THEM to the riser pins. Having both sides of the connection already covered with solder before you bring them together makes it much easier to get a good connection. A cheap solder pot can be picked up from eBay for ~$15, which makes the stripping&tinning process much faster. Use a good quality no-clean flux.

DigitalPinJumpers2 On the opposite side of the board:

GND:   Solder TWO black wires for the RTC & LED.
Pin 2:  Interrupt wire for RTC alarm line (Blue)
Pin 3:  Optional interrupt wire for certain sensors (Green)
Pin 4:  Red power line for the RGB LED
Pin 5:  Green power line for LED
Pin 6:  Blue power line for LED

BoardTape110. After applying heat shrink tubing to the joints (optional), apply double sided tape to the bottom of the Arduino, in two layers. Cut the first layer so that it fits in between the stumps of the riser pins on the bottom of the board. Peel back the plastic backing on that first layer and apply a second layer of double sided tape that extends to the outer edges of the promini board.

 

BoardTape2The Arduino is now ready for the logger assembly stage.

Note: This would be a good time to test whether the Arduino is working. Connect the pro-mini to a PC via a 3.3volt UART adapter and make sure that the ProMini board is selected in the IDE (Tools > Board > Pro or ProMini). You may have to specify the com port that your computer has given to the UART adapter (Tools > Port) and/or you may have to download a driver to support your serial communications board.

11. Run the Blink program (File > Examples > Basics > Blink) on Pin 13. Make sure to verify the program before uploading it. Assuming you did not remove the P13 limit resistor earlier, you’ll see the pin13 LED on the Arduino blink with one second intervals if everything is communicating properly and your Arduino is working.


2)  The micro SD card adapter

Four SPI signal wires will connect the SD card adapter to the Arduino board on digital pins 10-13. For these cut 2-3” lengths of four different colored wire. In this guide we used Orange, White, Green, and Gray wire. In addition, you will need red & black power wires, but these will not be routed to the Arduino. Instead they will tap the 3.3v regulated power and GND lines on the RTC adapter.

1. Flip the adapter board over and apply a thin coating of solder over each of the nine connector pads. Do not linger too long with the soldering iron making these connections, as heat conducted through the board may be enough to reflow the small contact springs soldered to other side of the adapter board. Usually if this occurs you hear a ‘snap’ sound while soldering. If this happens you may have to start over with a new board, as the adapter will not be able to make electrical contact with the inserted microSD card. I have found that the boards from Adafruit are reasonably resistant to this problem

SDAdapter12. Then add a 30 – 50K pullup resistor to the two pads at the end of the board. These connections are not used when the Arduino is accessing the card in SPI mode, but if you leave them floating some SD cards draw excessive amounts of power in sleep mode. Solder one end of the resistor to connection 1, bending it 90 degrees and laying the lead wire across the board to the other pad.  Be careful to route the resistor lead so that it does not come in contact with any other connection vias on your adapter board.  Fold the resistor along the cut edge and solder the remaining end to connection in the middle of the board (which is the 3.3v power line) I often put shrink wrap over the exposed resistor lead. I am probably breaking some rule tying the unused DAT1 & DAT2 lines together like this, but it has been working ok over several years of operation at this point. Use two pullup resistors for this if you prefer.

Cave Pearl data loggers3. The ground line needs to be connected to the SD adapter board in two places. Cut another 1” of black wire. Strip, twist and solder the black wires together on one end and solder that joined connection to pad. With the two-wire end in place, cut the short jumper to length for the second pad, then strip and tin the wire end before bringing down to the other ground line pad. Note: Many of these uSD adapter boards already have the two ground pads connected with an internal jumper. In fact the one in this photo did, but I simply forgot to check for that with a meter before starting this tutorial.

4. Add a red jumper wire to the pad in the center of the adapter with the pull-up resistor, being careful that you don’t unseat the pull-up resistor lead in the process. Then solder the remaining jumper leads in place.  For this guide I have used:

  • Cave Pearl data loggersOrange at pad2 will be the spi MISO line and will connect to D12
  • White at pad5 will be the spi SCLock line and will connect to D13
  • Green at pad2 will be the spi MOSI line and will connect to D11
  • Grey at pad1 will be the spi CSelect line and will connect to D10
  • Black at pad6 with extra tail to pad 3, this will connect to the RTC GND pin
  • Red at pad5 (with pullup resistor), this will connect to the RTC VCC pin

Cave Pearl data loggers5. After the wires are soldered into place, clean away any flux residue with 90% isopropyl and let it dry. Be careful when applying silicone conformal coating to the soldered connections, as it may run to the other side of the board and coat the sprung SD connection springs, and prevent electrical connection. Make sure to dry it with the holder side up to prevent any liquid from getting inside the card holder. After the coating is dry, apply double sided tape to the SD card adapter.

Addendum:

pullups added to the SD card holder

Here is an example of the SD adapter modified with 30K pullups resistors on  CS, MOSI & MISO. I used 1/8 watt metal films because their small size makes it easier to squeeze them in

Reliable sources recommend pullups on the SPI lines, though I have been running my loggers for a long time without them.  I have noticed that some SD cards take a really long time to go to sleep unless CS, MOSI & MISO are pulled up, and some just refuse to sleep at all without the pullups. These weak pullup resistors are not described in this tutorial, but I suggest that you add them to your builds to sort out this problem with some cards.

If you already have loggers built without them, there is a workaround using the 328’s internal pull-up resistors that I current have in testing.  Despite the fact that only CS requires it, I found that all three lines (w MISO set to INPUT not output!) had to be pulled up before misbehaving cards went to sleep properly. So add these lines to the beginning of your setup before you run sd.begin

// pulling up the SPI lines at the start of Setup
pinMode(chipSelect, OUTPUT); digitalWrite(chipSelect, HIGH); //pullup the CS pin
pinMode(MOSIpin, OUTPUT); digitalWrite(MOSIpin, HIGH);//pullup the MOSI pin
pinMode(MISOpin, INPUT); digitalWrite(MISOpin, HIGH); //pullup the MISO pin
delay(1);

I found that enabling these three internal 20K pullup resistors raises sleep current by between 1-5 μA, so it should not hurt your power budget, and could potentially save far more power by helping your SD cards go to sleep much faster.  It’s worth noting that there is some debate about the necessity of this approach. Because SPI is a complex  protocol, there are situations where adding physical pull-ups could actually interfere with other SPI sensors on your data logger, and in that case the internal pullups provide a more flexible option.  That is one reason why I tend to stick to I2C & analog sensors on my builds, so the SPI lines are dedicated to the SD card.


3) DS3231 RTC Breakout board

These cheap DS3231 boards usually arrive with quite a bit of flux residue that you may need to clean off of the board.  There might also be a plastic tab on one end that can be removed.

RTCresistors2remove1. This board has a lithium battery charging circuit that can be disabled by removing as small surface mount resistor (201) on the right side of the board. The LED power indicator can be disabled by removing the (102) limiting resistor on the left side of the board.

Cave Pearl data loggers2. The I2C lines that we will attach to one side of this breakout board are provided on cascade connectors on the other side of the board with 4.7k pullup resistors already installed on the SDA and SCL lines.  To that cascade connector solder 4” lengths of Black, Red, White, and Yellow wire on the GND, VCC, SDA, SCL respectively, so that they emerge the battery side of the board. Leave a few mm of wire protruding from the solder joins, as these provide convenient attachment points for an I2C EEprom if you wish to add that later.

I2C connectors3. To the end of these four jumper wires add the four pin red WSD1242 Micro 4R Plug.  Note the pattern used with the black GND wire on the dimpled side of the connector. (pattern: Y-W-R-Bl) Place the connector in a vise with the other side of the connector in place to prevent the pins from shifting when the thermoset plastic gets hot. Pre solder each pin, then cut, strip and tin each wire end BEFORE you try to join the wires to the pins. Thread the heat shrink tubing over the wires before you solder to the pins.  BEFORE joining the wires to the connector in the pattern shown check that the female side of the connector is being soldered to the wires from the RTC.

As a general rule I always solder connectors in such a way that the side that is providing power is female. That way even when the connector is ‘live’ there are no exposed pins that could short out if the connector accidentally comes in contact with a metal surface.

Also note that there is nothing special about the Deans micro plugs I am using here, they are simply my current favorite after testing many others on the market. They stay secure with a good deal of knocking about, but at ~$1.50 per pair they are also pretty expensive,  so feel free to substitute different connectors for your build. Dupont crimp connectors are much cheaper, and I used those successfully for quite a while before switching over to the Deans.

RTC34. Cover the IC side of the breakout board with a thin layer of conformal coating and insert a fresh CR2032 3V coin cell battery.

 

 

 

At this point the three core components of the logger are ready for the assembly stage. In Part 2 of the build instructions, we will cover connecting these parts together on a flat platform with the battery holders. And in Part 3 we look at assembling a waterproof housing. Part 4 covers techniques for optimizing your loggers power consumption, but some of them are more advanced so its probably a good idea to build a couple of the basic loggers before tackling the material in that last post.

The DIY Arduino datalogger with low power shut down capability (2014)

Addendum 2017-02-20:

This original $10 DIY Arduino logger page was posted in 2014, and there have been several significant updates to the way I assemble the basic three component design since the early version described in the post below.  If you are building your first data logger you might want to start with the new one-hour build:  1-hour Pro Mini Classroom Datalogger  Most importantly, as the build achieved lower and lower sleep currents, I stopped using the Pololu power switch described below, as it ended up using more power than the sleeping loggers themselves.

Also note: The Pololu power switch described in this post has been superseded by the vastly superior Adafruit TPL5110 Low Power Timer.  Cfastie has been putting this board through it’s paces over at PublicLab.org.


Original post from  2014-10-07:

Here is the latest version of my basic DIY datalogger, which adds a new component to the design:

A3 component DIY data logger

Note: There is a set of detailed build instructions for a pro-mini based data logger from this plan at:  Part 1 Part 2 Part 3 

NoteAdapter pin numbering follows this document: 1 = Chip Select, 2=Data in = MOSI, 3 = GND, 4 = VDD (supply voltage, not > 3.3v!), 5 =SCLK , 6 =GND , 7 =Data out =MISO
Several sources recommend pullups on CS, MOSI, MISO and SCK, though the loggers will usually work ok without them. But testing has shown that some SD cards take a very long time to go to sleep unless CS, MOSI & MISO are also pulled up

The addition of the power switch solves the last nagging problem I had with the original 3-component design: unpredictable system behavior when the power supply goes low. I knew from my bench tests that some boards (like the Rocket Ultra pictured here) gracefully go into a kind of holding state till they completely brown out, while others go into a kind of power cycling loop, alternating off & on, when the battery voltage gets too low for the regulators. Now, you can just read the divider and drive the control pin high to shut down the entire system. Of course, everything is a trade-off, and this soft switch almost doubles the sleep current, from ~0.35 mA (with a good SD card!) to ~0.6 mA.  Assuming 2000 usable mAh per AA, this brings my “back of the envelope” estimate down to 4-6 months on three cells (my design goal is of 1 year of operation). But given all the uncertainties I have dealt with regarding μSDcard power drains, battery leaks, and the rough and tumble of real world deployments, I think I will pay that price to protect my data. It’s not always that easy to get back into those caves on schedule. On future builds, I will try to find a simple latching relay circuit to get back the capacity I’m losing with the Pololu switch.

The SD card debacle forced me to make my first breadboard version of these loggers to measure power consumption at the component level . All my previous builds were soldered, and now that I know how fast bread-boarding is (~45 min , mostly for soldering the header pins) I realize that was a mistake.

The SD card debacle forced me to make my first breadboard version of these loggers to measure power consumption at the component level . All my previous builds were soldered, and now that I know how fast bread-boarding is (~45 min , mostly for soldering the header pins) I realize that was a mistake.

And I also finally got around to posting the drip logger script for this platform on the project’s Github. Even though the drip sensors only use an ADXL345 (for now), I left in all the other sensor support developed for the flow monitors, as the system is meant to be easily adapted to other applications. I also have two different versions of sleep code buried in there, one with the Rocket Scream low power library, which shuts off the BOD, and the other which just uses a variable WDT timer to wake from sleeps while the fuses are left on. I still have not decided if I am comfortable with BOD fuse shutdown in a data logger application. With a 10k limiter keeping the led current low, I sometimes leave the indicator pips on during sleeps without impacting the power budget too much. If you change the limiter to make the led brighter, make sure you shorten the time that the led is left on.

From the beginning I have focused on creating a fully functional data acquisition system from a small number of preexisting modules. Only interchangeable, non-proprietary components and formats are being used (AA batteries, csv files, SD cards, etc.) because I want my logger to have the flexibility of replacing any individual component with half a dozen other parts that are readily available.  To give some sense of this, I have compiled a “budget” and a “preferred” parts list:

Budget Parts:

Component Comment Cost

CloneBoard
*Clones work, but the “real” Sparkfun ProMini boards give me trouble with the SD cards. I suspect that a 22uF  decoupling cap between the SD card’s Vcc<->Gnd  lines might help the MIC5205 cover the current peaks.

3.3v ProMini clone*: And occasionally you catch them for <$2.50 on eBay. Make sure Vreg is 150mA or more, and watch for Vcc> 3.3v.  Usually 0.05-0.2 mA > sleep currents than Rocket Ultra boards, pin layouts can be irritating, remove power leds & inspect solder joints very carefully. It’s worth noting that you can  bypass the onboard regulator, and use an external MCP1700 vreg. $4.00 (+guilt)
RTC board RTC modules: wash them as they are often covered with blobs of leftover flux, remove charging circuit & pwr led resistors. Check my RTC page for further info on these modules. $1.50
 flipupAdapter Micro SD card adapter: try to get the ones that have Molex connectors, you need to leave room for the flap in your design, or you could try the self-spring type but these don’t seem to hold up to the soldering heat as well. If you hear a “snap” during soldering,  start over – you killed one of the spring contacts. $1.00
 cheepbatholder 3 x AA Battery Holders:  and don’t forget the connectors! I usually go for the deans style knock-offs,  but expect to throw more than a few of them out due to bad alignment. You need a good soldering iron to use them. $1.50
 3_colorled 3 color LED module:  The old round-style Keyes modules are the brightest I have found so far with a 10k limiter. You could buy raw common cathode leds for less, but I find the little breakout boards make it easier to mount them with JB plastiweld putty $1.00
 plasticbox There are so many different pre-built waterproof boxes out there to choose from I’ve lost count. If you build your own from PVC, you can make them far more rugged. $3.00
The first time I deliberately purchased something with DRM. The Muve Music cards are the only ones I have found that are usually authentic when I get them on eBay. My longest logger runs to date (5 months) have generated less than 50Mb of CSV data. So 1 gig is plenty. Test your SD cards extensively before any deployment to make sure they go to sleep properly! $2.00
 cp202 You will need at least one serial adapter, and I usually bring several for fieldwork. CP202’s are cheap but don’t work as well for me as FTDI’s. Be sure to get 3.3v and note that Windows drivers will brick fake FTDI’s $2.50
Adafruit sells 26awg silicone wire in 2m lengths. Perfect for starting a new project without breaking the bank. Deans micro plugs are the best connectors I have found and they are available from 2 to 6 pins. Resistors, wires, heat shrink, etc. The cheapest stuff I have found so far is at Electrodragon, but you get what you pay for wrt quality & 3 week  delivery times. $1.00

Preferred Parts:

When the budget isn’t too tight, I splash out for better components. After you build a few, and go through the effort to install them, you will start to realize that your time is worth more. Certainly your data is. But I would still make your first few builds with cheaper stuff, at least till you feel confident putting them together. Cable routing inside a housing is important, and it usually takes me a few tries before I get the physical build sorted out.

Component Comment Cost
miniultra The Rocket Scream Mini Ultra wins over other mini format boards with lower sleep current & 100 mA more juice at the high end. I also like the layout, which has an extra ground pin available for the voltage divider. 1284P’s like the Moteino MEGA (+built in RF!) are looking interesting, but I have not had a chance to play with them yet. $14.00
chronodot The Chronodot is still my gold standard as a trustworthy RTC. But using it takes more space, and requires a separate EEprom. Of course that allows you to go up to a 256k  AT24C256  possibly eliminating  the SD card. Or try a little FRAM for faster writes. And for only $33 more you could go all the way to a FE-5680A atomic clock but good luck fitting that into your housing 🙂 $17.00
 adafruitmicrosd I trust Adafruit’s quality control.  This board lets me tuck the SD under the RTC in tight builds if I use 15mm M2 standoffs.  $2.50
 BatteryHolders Battery holders:  Heavy duty aluminum holders from Keystone Electronics are my 1st choice. 3xAA 147’s are good, but singles give you more layout options. Don’t forget isolation diodes if you have multiple banks. $4.00
 Pololu I’m putting the Pololu Pushbutton Power switch in the “preferred” list because it’s not required and it adds 0.3 mA to the sleep current – that’s more than the logger itself! $6.00
 platform parts
The rubber flexes quite a bit under water and I have only tested these caps to about 5 m depth.
Waterproof Housing: 4″ PVC sewer drain cap, 4′ knockout cap to mount logger components inside & a Fernco Qwick Cap. I mount the LEDs & sensors in short lengths of 3/4 pipe which are solvent welded to the exterior, then filled with Loctite E30CL $6.00
 JY-MCU I like these tiny JY-MCU ‘s when I have a design that is really tight on space. But getting a particular 5050 is not easy on eBay due to unreliable vendors. $1.50
 wire1 My current favorite wire is Adafruit’s 26awg with Turnigy silicone & Cal Test Electronics Test Lead Wire also being good. Stiff PVC insulation gets irritating when you are trying to route wires into small housings. $2.00
 GroveHub Most of my builds go under water, so the sensors get potted into place on the housing. An interconnect system like the I2C hub from Groove Studios makes the “sensor caps” interchangeable. $3.00
 Sparkfunftdi These Sparkfuns are still my favorite serial adapters, they always seem to work, and the new pin connectors work are more robust. $15.00

Well, there it is: the simplest fully capable datalogger I could come up with. You have from 3 to 5 analog lines free depending on your board (1024 levels on the ADC), and two digital lines left for your 1-Wire sensors (and you still have a free interrupt line on pin 3, and the analog pins can be used identically to the digital pins, using the aliases A0, A1, etc) . I2C is already pulled-up (4.7k) & broken out for you on the RTC cascade port. SPI is still available if you watch your timing with the SD communication. (Both get SCK, MISO, and MOSI in parallel, But each device needs its own Chip Select line, as you can only communicate with one device at a time : SoftwareSPI is also an option but it looses the speed advantage). If you need better resolution on your ADC, you can add an ADS1015 to add four more 12 bit channels. If you need more output lines, you can look into adding a shift register, and there are plenty of transistor/relay breakouts if you want to control high power loads or LEDs.

Once you have a unit up and running, don’t forget to give the boards (but not the μSD adapter) a good dash of silicone conformal coating before they go into the field. And it never hurts to throw a desiccant pack or two in there while you are at it.

——————————————————————————————–

Addendum 2014-10-09:

I tested two breadboard builds (configured as drip sensors) to get a sense of the current draw of the individual components. Without the power switch, the ProMini clone logger drew a sleep current of 0.26 mA sleeping in powerdown mode using RocketScreams Low Power Library with ADC & BOD off.

ProMini clone +
Adxl345 accelerometer (50 hz, power save mode) :  
                          0.058 mA
Sandisk 256mb uSD card :                                                                         0.061 mA
DS3231 & AT24c32 eeprom combo  (with 4.7k pullups) :                   0.089 mA*

* I also tested an AT24c256 separately with a chronodot RTC, 10k pullups, and that eeprom draws about 0.03 mA when not being accessed. As you might imagine, I will be examining the RTC very carefully, as 0.089 mA is much higher than I would have expected for something that is supposed to run off of a coin cell. (The datasheet actually specifies a standby supply current of 0.11 mA at 3.3v)

Double lenth header pins make it easier to breadboard the SD card.

Double length header pins make it easier to breadboard the SD card.  DO NOT TAKE TOO LONG to solder jumpers onto any of these adapter boards. If the springs mounted inside re-flow from excess heat, the connections are toast.

Subtracting those figures from 0.26 mA indicates that the ProMini clone with its MIC5205 regulator uses about 0.052 mA when the unit is sleeping. I am guessing that most of that is due to losses on the regulator, since it is still providing power to the above components. 

Then I changed over to a RocketScream Ultra board, and the whole logger drew 0.22 mA with the same SD card, indicating that “sleeping” logger overhead with their MCP1700 regulator is around 0.012 mA. Significantly better than the 5205 based system, and you have another 100 mA of current capacity at the top end.

I then tested that Rocket ultra unit with the Pololu power switch in the circuit, and sleep current went up to 0.53 mA , indicating that the switch is adding 0.32 mA to the sleep current for this design (after I removed it’s power on LED). Just to be sure about this I measured the current on the other side of the Pololu switch, and the logger unit was still drawing 0.22 mA, so it was not noise, or some other weird side effect keeping the SD card from sleeping properly.

Addendum 2014-11-28

A month long test of one of these units binning at 15 minute intervals, with the Pololu installed (0.56mA sleep current) lowered the 3xAA power supply voltage by 181 mV.  Being conservative, this means we will only get about 4 months of run time with the no-name alkaline batteries I used. That’s a pretty dramatic reduction of run time for that one extra component so I probably will not be using the Pololu switch for my longer term deployments. Field test results so far indicate that a unit sleeping at 0.30 mA will deliver between 6-9 months of operation on a 3xAA battery pack.

Addendum 2015-01-20

Soldering Pullups and Jumpers on SD card adapterJust thought I would post a quick shot of how I jumper the pullup on that SD card adapter with the legs of the resistor itself. Super thin 30 AWG wire makes jumpering the ground line much easier as well. Once all the jumpers are on, I clean off leftover flux with 90% isopropl alcohol, and then coat the contacts with silicone conformal coating, being careful not to let it run to the other side of the board where it would block the connections. Then I adhere the boards to the platform with double sided tape, which has been working surprisingly well on ABS knockout caps.

 

Two resistors on ledsIt is also worth mentioning that the Green channel on the multi color common cathode LED’s is so much brighter than the red & blue colors (4000mcd vs 8-900 mcd), that you can actually use two limiting resistors – one 10K on the common ground line, and an extra 20K on the green line.  In fact, if you can live with a really faint indicator led, you can take the limiters to 20/40K or more if your LED is bright enough.  You don’t want to waste too much power on indicator LEDs when no one is around to see them, and this brings the green channel down to 110uA, while leaving the red & blue channels bright enough to see.  Luke Miller has an elegant method using a magnetic reed switch interrupt to enable & disable his status LED’s to save power, but I often need all the interrupt lines for my sensors.  I could probably work around this with a pin-change driven interrupt, but have not had a chance to dig into that yet.

Addendum 2015-02-12 

I just wanted to add a link here to my new pvc housing design. While not quite as simple as the rubber quick cap housing pictured in the table above, I am certain that this Formufit table-cap based design is the simplest diy housing you could build that will go to significant depth under water.

Addendum 2015-04-14

On my logger I use a voltage divider to monitor the main battery. This bleeds a few μA, but given the overall sleep current that’s a small price to pay for the simplicity of using two resistors & a cap to do the job.  However I just stumbled across a very good way to monitor the battery voltage with virtually no loss over at the LowPowerLab blog. About half way down the discussion user JC suggests ” a resistor divider network, with the high side gated by a FET. Turn the FET on when you want to read the battery voltage, off the rest of the time. The leakage is somewhere down in the femtoamps.”  Another elegant solution for me to look into if I ever get this project to the stage where I am actually implementing elegant solutions.

Addendum 2015-06-28

It will be a while before I sort out all the details of the V3 logger platform, but for a preview of what might be coming,  you can see a couple of builds currently on the test bench here. Also, after many successful field deployments without the power switch where the batteries died but the SD card data was still intact, I have dropped the Pololu power switch from the design. I just could not afford to loose all that power.

Addendum 2015-10-24 

I have produced a set of detailed build instructions for a pro-mini based version of this data logger which can be found at:  

  • Part 1 (component preparation)
  • Part 2 (logger platform assembly)
  • Part 3 (housing assembly)

I still prefer to use the rocket ultra as it’s voltage regulator is more efficient, but it is still possible to build a decent logger with the minis that should sleep below 0.25mA.

Addendum 2016-01-25:

Reliable sources recommend pullups on the SPI lines, though I have been running my loggers for a long time without them.  I have noticed that some SD cards take a really long time to go to sleep unless CS, MOSI & MISO are pulled up, and some just refuse to sleep at all without the pullups. These weak pullup resistors are not described in this tutorial. If you already have loggers built without them, there is a workaround using the 328’s internal pull-up resistors that I current have in testing.  Despite the fact that only CS requires it, I found that all three lines had to be pulled up before misbehaving cards went to sleep properly. So add these lines to the beginning of your setup before you run sd.begin

// pulling up the SPI lines
pinMode(chipSelect, OUTPUT); digitalWrite(chipSelect, HIGH); //pullup the CS pin
pinMode(MOSIpin, OUTPUT); digitalWrite(MOSIpin, HIGH);//pullup the MOSI pin
pinMode(MISOpin, INPUT); digitalWrite(MISOpin, HIGH); //pullup the MISO pin
delay(1);

  It’s worth noting that there is some debate about the utility of this approach. Because SPI is a complex protocol, adding internal or external pullups could actually prevent you from being able to use other SPI sensors with your data logger. That is one reason why I tend to stick to I2C & analog sensors on my builds, so the SPI lines are dedicated to the SD card only.