DIY Arduino ProMini Data Logger: 2016 Build Update

Cave Pearl data loggers

Click image for larger view. Note that the colors used for this new ‘jumpers’ build don’t match this older diagram. This build should work with any 3.3v, 8mHz 328P board but the pins are in different places on the Sparkfun pro-mini vs the Rocket Scream Mini Ultra, and you will likely have to adjust your connections to match pin locations on the particular board you are using.

Its been almost a year since the last stand-alone logger tutorial, and I continue to receive questions from people adopting the platform in education settings.  That feedback makes it pretty clear that soldering is the biggest stumbling block for beginners, so I have reconfigured the build to use pre-made DuPont style jumper cables wherever possible.  The basic wiring diagram is unchanged, but I use a different SD card adapter and changed the resistor locations to reduce component prep. and make the overall assembly easier.

Cave Pearl data loggersThis comes at the expense of having more wires to deal with on the limited real-estate of the knock-out cap platform, and re-positioning the modules to make room for the overhang of the DuPont connector housings. The overall result is a little uglier, and not as robust to knocking about as a unit where every connection is soldered in place, but the platform takes about a third less time to build (~2.5h) with a part cost under ten bucks before you add sensors.

PARTS & MATERIALS

Parts photo for the 2016 update build of the Cave Pearl Data logger by Edward Mallon

Parts Total: $8.80
Pro Mini Style clone 3.3v 8mHz $2.00
DS3231 IIC RTC with 4K AT24C32 EEprom (zs-042)
Some ship with CR2032 batteries which will pop if you don’t disable the charging circuit!
$0.80
SPI Mini SD card Module for Arduino AVR
Be sure to buy the ones with four ‘separate’ pull-up resistors.
$0.70
20cm Dupont Ribbon Cable 40pin F-F 2.54mm
You use ~1/2 of a 20cm cable per logger. Get the ones without the housing caps to save time.
$0.70
2xAA Battery Holder & 1xAA Battery holder $0.60/both
CR2032 lithium battery  $0.40
4″ Knock-Out Test Cap $0.40
Deans Ultra-T Style Battery Connector Plug $0.30
2x Nylon M2 12mm standoff, Nut & Screw M2 5mm $0.40
Micro SD card 64mb-1gb 
Smaller cards have lower sleep currents. Test used cards well  before putting them in service.
$2.00
Dupont Crimp PinsHousings
Most parts  cost about a 1-2 cents each, after you buy the crimping tool.
$0.30
Common Cathode Bright RGB LED 5mm 
A brighter bulb lets you use a larger limit resistor for the same light output.
$0.10
Double Sided Tape,  2x 4.7MΩ resistors, 26awg silicone wire, (104) 0.1uF caps, 4″ cable ties, heat shrink tubingheader pins, etc…etc… $0.50
Donation to Arduino.cc
It is now possible to build a decent data logger for less than $9 because of the hard work of many people around the world. If you don’t use a ‘real’ Promini from Sparkfun to build your logger, you should at least consider sending a buck or two back to the mothership to keep the open source hardware movement going…so more cool stuff like this can happen!
$1.00
Comment:  And a few tools you might need to get started:                     (not included in the total above)
CP2102 USB-UART Bridge module
These work with Macs & Windows machines after you install the drivers. Or try the FTDI version.   ***Be sure to set the 3.3v jumpers on the module  before using it!***
$2.20
Yihua 936b soldering station 110v
These have enough power to solder the large battery connectors. Get extra handles & tips.
$23.00
DT-830D Digital Multimeter $3.00
Heaterizer XL-3000 Heat Gun $14.00
SN-01BM Crimping tool $25.00

COMPONENT PREPARATION

CLEANING:  Boards from reputable vendors like Adafruit / Sparkfun are usually clean, but cheap eBay modules are often covered with leftover flux from the manufacturing process and dirty contacts are guaranteed to corrode.  Most of us use 90% isopropyl alcohol to clean this residue, but some prefer Polyclens brush cleaner. A couple of five minute sessions in an ultrasonic bath with Iso90 usually works great, but you can also do it by hand with a cotton swab, etc.   (Never put vibration sensitive components like accelerometers into an ultrasonic bath)

Preparing the Main Board:

Solder the side rows of straight riser pins into place on the pro-mini style board.  This is easier if you use a small breadboard to hold the pins in place, however you should not use that breadboard for anything else afterward because the transferred heat will ruin the contacts.  Be sure to add the two A4 & A5 riser pins after the side rails are on, as they are needed for the I2C interface (and the A6 & A7 risers if your project needs them) One of my pet peeves with  Pro Mini style boards is that those inner pin can not be held in place with the breadboard trick as they at out of alignment.  If you hunt around and you can find clones with A4-A7 broken out to the edges of the board to make the soldering the pin headers a bit easier for beginners.       Click on any images to see larger versions.

solderriserpins washfluxfromboard1 Riser Pins on promini arduino. Not the angle for the UART serial.
Cave Pearl data loggers

On the adapter in this picture, the USB to TTL connection pins are in the reverse order of the promini board. This is a fairly common issue with cheap eBay modules and simply requires that you twist the cable between the Arduino and the serial adapter.

It is good to have the six serial UART I/O pins bent slightly away from the other risers to make more room for connecting the UART board. Once the pins are in place clean the flux residue from the board with some 90% isopropyl alcohol and a cotton swab.

Take a few moments and connect the board to your computer via the UART adapter to test it out by uploading the Blink sketch. You need to install drivers to get the serial communications adapter working with your operating system, and this part of the process can be challenging for people who have never done that before. There are well written guides at Sparkfun & Adafruit if you are using boards with the FT232RL chip from FTDI. If you are using the CP2102 from Silicon Labs, or the $1 PL2303 then you need to sort out driver installation on your own, but a quick google search should bring up lots of guides posted around the web. Once you have the drivers installed, the Arduino IDE should display a new com port when the adapter is plugged in to the usb port of your computer. At that point you can upload sketches to your Arduino through the serial adapter after selecting Board: Arduino Pro or Pro Mini   and  ATmega328(3.3v, 8mhz)   in addition to the new com port provided by the drivers. If you are ordering parts from eBay, then buy at least two of everything – it’s not uncommon to see a 10% failure rate on budget parts…that’s why they are so cheap.

Once you are sure the board is working ok,  remove the power LED limit resistor and the resistor for the LED on pin 13. Simply hold the tip of the iron on one side of the small resistor and apply a gentle sideways pressure. When enough heat has conducted through the resistor, the solder will melt and you should be able to simply ‘flick’ the resistor off the board. Disabling these LEDs conserves battery power. (Note: these limit resistors tend to move around from one board to the next, so you might have to hunting for them.)

pwrledpromini
pwrledpromini2 pwrledpromini3

Tape on bottom of pinned pro mini

Add two layers of double sided tape to the underside of the Arduino so that it can be affixed to the platform. Due to the riser pins extending from the bottom of the pro-mini, two layers are needed: The first layer should fit “between the pins” and the second layer should extend past the pins to the outer edges of the board.

The RTC Module:

I don’t recommend using LIR2032 rechargeable batteries with this module as the charging circuit wastes a great deal of power, and a CR2032 will backup the RTC for many years.  Remove the charging circuit resistor and power LED limit resistor from the circuit board indicated with the red squares in the first picture below.  Next add four 90-degree header pins to the I2C cascade port on the RTC board. These four pins will become the connection point for any I2C sensors you want to add to the data logger:

rtc1 Cave Pearl data loggers rtc3
Cave Pearl data loggers Note the battery connector leg on the top surface is trimmed a bit Cave Pearl data loggers

Since the RTC board already has 4.7k pullups on the SDA (data) and SCL (clock) lines, you will not need to add them to your I2C sensors. This board also has a 4.7k pullup on the SQW alarm line.  The GND and VCC pins (3.3v) on that cascade port can also be tapped to power other sensors you connect to the data logger.

The SD Card Adapter:

This SD card module comes with small surface mount pullup resistors on the MOSI, MISO & SCK (clock) lines (which have already been removed from the dashed red line area in the diagram).  The Arduino SDfat library uses SPI mode 0 communication, which sets the SCK line low when the logger is sleeping. This would cause a constant drain (~0.33mA) through the 10K SCK pullup on the module if we did not remove it.  I prefer to pull MOSI & MISO high using the internal pullups on the ProMini’s 328P processor, so those physical resistors on the breakout board can also be removed. But be careful to leave the top-most resistor of the four in place to pull up the DAT1 & DAT2 lines. This keeps those unused pins on the μSD card from floating when the cards are accessed in SPI mode.

sd1 Only remove the bottom three pullup resistors. keep the top one sd3

Then add a layer of double sided tape to the bottom of the SD card module and trim it to size.

Dupont Connectors:

trimdupontcableThe RTC & SD card modules will be connected to the Arduino by custom jumpers that you assemble from a 20cm, 40pin F-F Dupont style ribbon cable and 0.1″ (2.54mm) crimp connector housings. Test your cable for end-to-end continuity, then cut the cable into three sections.  Then peel off individual 10cm wires and insert them into the black crimp connector ends to create the cables shown. The longer 20cm wires will be used  later when we assemble the LED indicator cable, and for other sensor attachments.

Cave Pearl data loggers

 


For the I2C connections:
White:       SDA (data) (to A5)
Yellow:     SCL (clock) (to A4)
Blue:          SQW alarm signal.
RED:          3.3v regulated
BLACK:    Ground

For the SPI cables:
Grey:          Cable select (to D10)
Orange:     MOSI   (to D11)
Purple:      MISO   (to D12)
Brown:      SClocK (to D13)
RED:           3.3v regulated
BLACK:     Ground

I’ve left one of the RTC connector housing slots empty for future use with the 32K clock signal but you can change that to a 5-pin housing if you wish.  Single 0.1″ (2.54mm) crimp connector housings are shown on the ends of the red, black and blue wires ,but I find that putting heat shrink over single-wire DuPonts help them hold onto the pins better.

ASSEMBLING THE LOGGER PLATFORM

Attach Battery Holders & solder in series

On a 4” PVC knockout cap, arrange your battery holders as close to the edge as possible to maximize room for other parts on the platform, without letting the holders hang off the edge. Mount the battery holders in place with double sided tape.

Join the red wire from the bottom of the single battery holder to the black wire from the double battery holder, so that the three AA batteries are connected in series. Fold the soldered joint and the long RED wire into the gap between the battery holders. Use some heat-shrink to bind them so they stay together inside the gap. Mark and drill 1/8” pair of holes so that you can tie down the wires from the battery pack neatly. Secure the wires to the cap with a zip tie through the holes.

Cave Pearl data loggers Cave Pearl data loggers Cave Pearl data loggers

Risers & Tie Downs

Place the RTC board alongside the batteries with one corner near, but not extending over,  the edge of the cap. You want the back edge (with the four-wire cascade port) as close to the single battery holder and the outer edge of the platform as possible. The larger 6-pin connector side of the RTC module will be at a slight angle inwards to make room for the connector housing that will go on those pins. Mark two places for the nylon standoffs and drill 2mm holes through the knockout cap. Thread the nylon standoffs through the holes and attach them to the platform with the plastic nut on the underside of the cap.

Then add two pairs of ¼ inch holes in the platform to be used later to tie-down the connector cables:

Cave Pearl data loggers Cave Pearl data loggers Cave Pearl data loggers

Battery Pack Connector

Join the two pieces of the Deans battery connector, and add solder to the end tabs of the female side of the square battery connector. For big connectors like this I turn the iron up to ~700°F (370°C). Be sure to heat the part long enough for the solder to “flow” like a liquid, and for the flux to burn off, but not so long that the nylon starts melting. Then trim the battery wires so that they extend to a mid-point over the battery holders on the platform. Strip about 5mm of insulation from the wires and tin the ends. Build up some extra insulation thickness to protect the wires from bending stress by adding two or more layers of heat shrink to the wires just before the tinned ends. Thread two larger pieces of heat shrink over the wires and then solder the wires to the connector and seal the heat shrink over the exposed metal:

Cave Pearl data loggers Cave Pearl data loggers batterycon3

Note: the top of the ‘T’ shape on this connector is the positive (red wire) side. Set your iron back down to ~600°F(315°C) after you get the solder on the big connector tabs. As a general rule: the smaller the component – the less time it can withstand heat. It’s not unusual to see maximum tolerances of 5 sec @ 288C for tiny SMD’s.

Attach modules to the platform

Module mounting for promini data logger by the cave pearl project

With a typical sleep current around 0.25mA you should see around 8-9 months of operation before three AA cells in series reach the regulators 3.5v minimum input cutoff.

Remove the tape backing from the pro-mini and the SD card adapter and affix them to the platform. As you can see the space is pretty tight. The SD card adapter needs to be close to the battery holder, because the SDcard will extend another 5mm from the holder itself, and this must not extend past the edge of the disk.

Then attach the RTC board to the nylon risers. Check to make sure there is good clearance between the RTC pins and the Arduino pins.

Connect the RTC

After the modules are placed on the board begin the interconnections by affixing the I2C cables to the RTC.  Then add the white & yellow two wire connector to risers on A4 (white) and A5 (yellow) of the promini board. Gather the white wires and pull them into the gap between the RTC module and the battery holders. Trim the wires as a group, so that their length just reaches the single battery holder. Then strip, twist & solder the ends of the wires together, and cover the join with heat-shrink.

Cave Pearl data loggers trimjumpers2 Cave Pearl data loggers

Repeat the process with the yellow wires, and thread the joined wire sets through a cable tie that is routed from the bottom of the platform. Do not tighten the cable tie loop too much, as the black and red power lines will go through that later. To finish the RTC connection, plug a single blue wire to pin D2 on the Arduino [int(0)],  and connect it to the blue RTC alarm line as you did for the other lines. Wrap the soldered join with heat shrink and thread it under the cable tie with the I2C bus wires.

Connect the SD card

SPI lines connected on dupont jumper build for Data Logger

Now we will join the SPI lines which connect the SD card adapter to four pins on the Arduino.   Connect the 4-wire SPI cable to pins D10-D13 of the Arduino so that the grey wire is connected to D10 and the brown wire is on pin D13.  Attach the 6-wire SPI cable to the SD card adapter so that the black ground wire is closest to the pro-mini board.

Take each matching color pair of wires and fold them over beside the SD adapter board. Strip, twist & solder the ends together and add heat shrink to the join. Then bind them to the platform with a cable tie.

Join the Power Rails

The final step for the platform interconnect cable is to join the “power rails”. Connect a single red jumper to the VCC pin on the Arduino, and add a single black jumper wire to the GND pin behind the yellow wire on A5. Then gather ALL the black wires together and trim them to length along the same channel used for the RTC wires. Add at least one additional back jumper wire with a pre-crimped end to the bundle, as this extra ground connection will be needed for the LED indicator later. Strip, twist & solder the black wires together.

Repeat the procedure for the red (+3.3v) power wires, and again add at least one extra wire with a pre-crimped end to the bundle. After soldering the ends of these bundles together, cinch them out of the way with the cable tie between the RTC and the battery holders:

Joining the Positive Power rail Extra Power Taps on jumper Interconnects finished on cave pearl datalogger, ready for the main power connection

Extra power and ground connections are quite useful in data logging applications, so I reccomend adding two additional wires to the red & black power rail bundles if you will be connecting many sensors. Tuck theses loose ends under the RTC module to keep them out of the way. (alternatively you can add “sidecar” risers to give you more GND and Vcc attachment points on the main board – see the addendum at the bottom of the post) 

Battery Connection with Voltage Divider

Note:  The battery connection wires see a lot of handling compared to the other connections on the logger platform.  Since I have crimping pliers to add my own DuPont ends, this is one place on the build where I prefer to use softer silicone wire  that is more flexible than the PVC coated wires. However if you don’t have the pliers, you could just keep using the pre-crimped DuPont wires on the power connector provided you protect them from bending at the connection points with heat shrink.

With the main interconnect wires completed the last part of the logger platform build is the Arduino side power connector. Put the male battery connector in a vise with a spare female side connected to prevent the nylon from sagging due to heat, then add solder to the terminal flaps of the male battery connector. You might need to turn your iron up to 700°F to tin the connections the large connector, but turn it back down to 600°F (315°C) before attaching the voltage divider resistors, or you will cook those smaller components.

Build a voltage divider from two 4.7MΩ resistors, bridging across the low side resistor with a 0.1µF (104) ceramic capacitor. Add a black wire to the capacitor side of the divider, a pink wire to the center, and a red wire to the opposite side. Then solder this divider across the pins on the male battery connector, being sure to connect the black wire side to the ground pin, and the red wire side to the (+) pin.  Blow on the solder to cool it down as soon as the join to the connector pins is complete: there is more than enough residual heat stored in the metal of the connector to scorch the little capacitor, which then usually becomes short.

divider3 divider2 divider4

This voltage divider will cut the battery voltage in half, allowing us to read the status of the 3xAA battery pack on any analog input pin (via the pink wire in the photos above) even though the main battery voltage is above the Arduino’s 3.3v Aref.  The 4.7Meg resistors are large enough to limit losses on the bridge (to about 0.6uA), and because they exceed the input impedance limit of the ADC, the capacitor is needed to provide electrons to fill the ADC’s sample and hold capacitor when a reading is needed. The battery voltage calculation for this combination is:   float batteryVoltage = float((analogRead(A0)/ 511.5)*3.3);  The default MIC5205 regulator found on most promini style boards has ~150-230mv dropout during SD card writes, so when your AA battery pack gets down 3.55 volts, it’s time to shut down the logger.

Add heat shrink to protect the connections, and then plug the connector into it’s mate on the logger platform. Trim the black wire to length for the ground pin beside D2 (with the blue RTC alarm wire) , and then add a female crimp connector to that wire. Do the same for the pink voltage divider wire which gets attached to A0, and the red wire which gets attached to the RAW pin behind the serial/UART terminal.

Cave Pearl data loggers divider6 Battery connector on main logger platform.

Indicator LED

Since we removed the pin 13 LED from the pro-mini, we will now construct an external indicator. Peel away 2ocm Red, Green, Blue and Black ribbon cable wires and solder them into place on a common cathode RGB LED, matching the wire colors to the correct pin. Then add stiff heat shrink around the connection points to protect them from flexing. Place the ends of the Red, Green and Blue wires into a 3-connector housing.  The R-G-B connector attaches to digital pins 4-5-6 on the Arduino.

Cut the black wire near its mid-point, and insert a 20K resistor to limit the current through the LED. I often replace the bottom half of the wire with a softer flexible length of wire with a MALE crimp connector at its end. The male ground pin connects to one of the ‘extra’ lines we added to the ground power rail bundle.

LEDwires
ledwires2 ledwires3

The MAIN LOGGER PLATFORM is complete

Cave Pearl data loggersTypical pro-mini loggers built with this design sleep at 0.25mA, before extra sensors are added. At that current draw, the logger should deliver approximately six months of operation on three brand new AA batteries with a 15min duty cycle; depending on sensor load.

Now you can run testing utilities to verify that everything is working. But before you jump into that it’s worth keeping in mind that the entire construction can easily be disassembled for debugging if you suspect a bad connection somewhere, and it is even possible to pop the modules off with a small screwdriver and replace them:

In the build pictured here I added an I2C 32K EEprom to the platform. But since I2C devices all get connected in parallel, the assembly procedure is basically the same – you are just adding one more wire to the bundles connecting the RTC. If your connectors don’t feel like they are securely in place on the pins – then replace that wire.

In the build pictured above, I’ve added an AT24c256 I2C 32K EEprom to the basic platform. But since I2C devices all get connected in parallel, the assembly procedure is basically the same – you are just adding one more wire to the bundles connecting the RTC.

Test continuity on suspect wires with a DVM.  If you carefully lift the little tabs holding the crimps inside the black housings, individual wires can be extracted from the connectors and replaced.  If your crimps don’t feel like they are securely in place when they slide over the riser pins – then you should replace that connector.

SENSORS & HOUSING

platform partsYou can build a robust, inexpensive waterproof housing for your logger from a couple of 4″ plumbing end-caps. I use Loctite E30-CL to pot sensors on the exterior of the housing and you can see a complete walk through of the process in the  Sensors & Housing post from last year. Note that I did not use the 4-pin Deans connectors you see there on this newer build because they are fairly expensive, and a few people have been having a hard time getting their hands on them. If you shell out for crimping pliers, you can make as many custom connectors as you need for pennies each.  Dupont’s are not as robust, but I’ve had loggers running for years with them, so they are not a bad place to start. If the male pins don’t mate tightly, put a thin layer of solder on them to make them a bit thicker. Quality varies quite a bit, and Pololu sells good crimp pins.

TESTING THE LOGGER

1. Test the LED
Connect your indicator LED, to pins 4(R) – 5(B) – 6(G), and the ground line to one of your spare GND connections. Open Blink with the LED connected to the Arduino. Change the LED to Pin 4. Verify and upload. The red LED should start flashing. Repeat with pins 5 and 6 to test green & blue respectively. Note that with the common ground connection, you can not light up two colors of the LED at the same time.

Make polarized (non reversable) connectors by mixing Male & Female connectors

You can make non reversible sensor connectors by mixing male & female pins in the same housing. But never use male pins on wires that provide power, or they could short out if they come into contact with a conductive surface.

2. Test the I2C bus
Use an I2C scanner  to determine if your devices are responding on the I2C bus. With the scanner running, specify P to return to output only the addresses that have devices, and specify S to run a Single Scan. The 4k AT24C32 eeprom on the RTC board is at address 0x57 and the DS3231 will show up at address 0x68. The 32K eeprom should show up at 0x50 and other sensors will show up at different addresses. Note that the 4K AT24C32 is only rated for 100khz operation, but the DS3231 is rated for 400khz bus speeds.

3. Test the RTC
Use the settime & gettime scripts to set and check the time on the RTC. Generally, I set my windows computer to UTC before uploading setTime so that the logger is operating on UTC. This is not possible on a Macintosh, so you will have to check if London time is currently in sync with GMT/UTC, or find some other city that is. Alternatively you could avoid the problem by using the new serial setting script from Mr Alvin’s gitHub.

4. Test μSD Card communication
Insert the microSD in the adapter and test it with the CARDinfo utility at the Arduino  playground.  Remember to change the CSelect variable to 10 to get the CARDino to operate properly, as that is the pin we connected to the μSD card Cable Select line.

text

The pro-mini’s MIC5205 regulator usually delivers sleep currents in the 0.25mA range (Promini~0.07mA, SDcard~0.09mA, RTC~0.09mA) That should give you at least eight months of operation on 3xAA’s, and with minor modifications you can pull that down into the 0.15mA range to run more than a year.  (Or you could reach the one year mark by powering the logger with 4xAA cells in series. If you do this you will have to change the resistor ratio on the main battery voltage divider to keep it’s output below the 3.3v aref voltage on the analog input pins) Write the build date & your initial sleep current on the bottom of the logger platform – it’s a handy piece of diagnostic information to have later.

5. Test the EEprom(s)
A utility to test I2C eeproms was posted by bHogan at the Arduino playground forum, but that version is now quite old and does not compile in the current IDE without editing. I’ve posted an updated version on gitHub. Setting #define EEPROM_ADDR 0x57 will test the 4k eeprom on the RTC board, and if you install the extra 32k eeprom that shows up on the bus at 0x50. The serial window will return  A through T & 33 through 48 if the eeprom being tested is working OK.

6. Check Sleep Current
#include the LowPower.h library from RocketScream at the beginning of a blank sketch and the put the following line at the beginning of the main loop:

 

LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_ON);

Then enable some internal pull-up resistors in to the setup section of your code:
(be sure to do this before you call sd.begin)

// Always pullup CS:
pinMode(chipSelect, OUTPUT); digitalWrite(chipSelect, HIGH); //pullup the CS pin to tell the SD card go to sleep
//and you may need to pullup MOSI/MISO lines:
//pinMode(MOSIpin, OUTPUT); digitalWrite(MOSIpin, HIGH); 
//pinMode(MISOpin, INPUT); digitalWrite(MISOpin, HIGH);   

Upload that sketch and your logger will be put to sleep as soon as the program runs.  Note: the CS line should have a pullup when using the standard SD libraries, and the MOSI/MISO lines may also need to be enabled to lower the sleep current with some SD cards. But SPI is a complex protocol, and you might have to turn off these pull-ups if you have other SPI sensors attached.

7. Build your datalogger code
A good place to start would be Tom Igoe’s analog pin reading example at Arduino.cc  ( be sure  const int chipSelect = 10; for the build described in this tutorial) and there is a nifty little function  for automatically creating log file names over on Adafruit’s site.  For something a little more advanced, I have prepared a basic data logger script that puts the data logger to sleep and wakes it up again based on timed alarms from the real time clock. These are all just starting points for you to add to as you learn more about programming an Arduino.

The first major thing to tackle to achieve a decent operating lifespan is buffering your sensor data to an array, or to the 4k EEprom on the RTC board. Examples of the code I use for this eeprom buffering is embedded the I2C eeprom tester example I’ve placed on gitHub. You don’t want to wake up the card more than once per day, since that operation draws up to 100mA, for 200-400ms, which is more than any other power use on the logger.  Older Sandisk cards (<1Gb) tend to have lower sleep currents around 70µA, but it’s not unusual to see new large capacity cards drawing ~200µA or more.

To fully optimize your code it is helpful monitor current during “logging events”, but this usually requires an oscilloscope.  In this post, I have outlined a method to use an UNO with the serial monitor built into the IDE to capture and display these brief events.

Addendum 2016-11-25

Depending on the board you are using, you sometimes run out of critical pins for attachment points.  In this tutorial I described adding extra ground & power wire to the main bundles beside the RTC, but another approach is to add extra header pins that extend from the side of the board:

Sidecar Risers 1 Cave Pearl data loggers Pinned board with sidecar headers

In the photo above I added to ground, Vcc, and a tap on D6 to make PWM output available for that specific unit even though D6 was also being used for the LED indicator. An sacrificial breadboard holds everything in alignment while soldering, and a resistor leg lets you bridge to the new headers. This lets you add as many ‘sidecar’ risers as you need, although it gets a bit tricky to join more than three pins at the same time.  If you intend to re-purpose your logger platform with other sensors later, you can never have too many Ground & Vcc connections.  (…though after seeing these triple-riser promini boards from eBay, I think I might retract that statement…)

This entry was posted in DIY Arduino Datalogger. Bookmark the permalink.

10 Responses to DIY Arduino ProMini Data Logger: 2016 Build Update

  1. Unless I am missing something, it seems that you could make a PCB for this. I use OshPark, where I get three copies of a design for $5 sq in. This would be an irregular shape, so the price would be based on the smallest rectangle that the PCB would fit inside. You could minimize the PCB size (maybe 2 x 1.8″, or $18 for 3) if you mounted the battery holders above the completed PCB, maybe with standoffs or with a 3D printed fixture.

    • edmallon says:

      Yes, that would be a good approach if time&efficiency was what I was after. But this “jumpers & modules” approach is aimed at classroom settings where the experience of building the thing is as important as the end product. Keep in mind that most of our students have never even held a soldering iron before. Also the jumpers approach gives you flexibility to integrate other components like I2C sensors into the build with little effort (see the photo with the added EEprom further down the page – that could just as easily be a temp or humidity sensor). I wanted a plan that you could make with any 3.3v “mini-style” board, since part availability changes over time and pin arrangements vary considerably. And finally there are other modifications to integrate to this build, which I will post here if I get the time. Basically, the goal was to create something cheap & flexible, rather than completely optimized.

      • Excellent approach for the classroom. I was under the impression that you spent most of your time slogging through the jungles of Belize or Guatemala tossing data loggers into tide pools! I follow you because I do a lot of domestic data logging, for green building efficiency, etc.

  2. Pingback: DIY Arduino ProMini Data Logger - Electronics-Lab

  3. Art Croucher says:

    I think there is room for both approaches in the user community. The breadboard version is more flexible and provides education opportunities, but some of us are more interested in having reliable and compact designs so we can move ahead and collect our data. I’m not sure there’s enough of a market to make it worth Ed’s time to do the PCBs, but I’d buy them from him in a heartbeat.

    • edmallon says:

      Given the number of “promini” shield projects already out there (eg: Pawelsky@OSHpark) I’m surprised someone hasn’t already done it, or taken the stuff I’ve released and produced logger kits with the screw headers idea. And it continues to be a mystery why the folks at Adafruit & Sparkfun are not putting better power optimisation into the design of their off the shelf loggers like the Feather 32u4 Adalogger or in ‘snap-together’ solutions Tinyduino & MicroDuino. If I could get those down below 0.15mA sleep currents (w sensors, sd, etc. attached) and provide the voltage regulation that my sensors require, then I’d be buying them instead of building.

      But the other issue is that I’m not through the dev stage yet and there are several major features I want to add to every data logger I build. So I’m not going to do a big run of boards at the half way point. When you see my next post, you will see what I mean.

  4. Art Croucher says:

    That was my guess. You keep doing the R&D, and maybe an engineer will come along to commoditize what you’ve learned.

    • edmallon says:

      That does seem to be the emerging pattern as the open source hardware movement matures. Which kind of says something about what’s happened to corporate R&D since the glory days of Bell labs & Xerox Parc. But I’m sure the stuff I’ve cobbled together would be a trivial exercise for anyone with an engineering background, so I’m not too worried about it. And one of my goals is to get loggers into the hands of people who probably wouldn’t qualify as “profitable” markets anyway. I’ve been to many places where folks have no decent research kit, and they are not likely to get it any time soon unless they make it themselves. But their need for data about their environment is, if anything, even more pressing. Groups like PublicLab & Hackteria keep me optimistic that the makers movement will help address the situation.

  5. CIGHER says:

    If you take hourly measurements for temperatures, humidity and pressure there is enough energy? Whats the lifetime for battery?

    • edmallon says:

      Datalogger lifespan depends on sleep current more than any other factor, by a very large margin. A typical pro mini build, without eeprom buffering, or pin-powering the RTC, usually comes in around 0.25mA sleep current. That gets you out to between 6-8 months on 3xAA’s, and a bit longer with Lithium AA’s. This can be affected quite a bit by using older low current SD cards, but I find that the number of readings per hour is less of a factor than you would think; especially if you have good sensors that automatically go to sleep between readings. I outline power optimization strategies in Part 4 of the build series, but if you are just starting out you can simply add another bank of 3xAA batteries in parallel with the first bank, and that should get you out to 1 year of operation. The extra bank can be put on the underside of the platform. Be sure to isolate the two banks from each other with a couple of 1N5817 Shottky diodes.

      Another option with Prominis is to use more than 3XAA batteries, since their regulator can take up to a maximum of 12v input. I did not go that route simply because I ran out of space on the platform surface 🙂 6xAA in series you would make it up to about 10.8v (with typical over-voltage of 1.8v per cell at the start). But you need to be careful to check the regulator specifications on the specific Arduino board you are using. Many Arduino clone regulators can not take more than 6-7 volts input, which is why I usually add parallel banks, rather than more batteries in series.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s