(Last update: July 2019)
It’s only been a couple of weeks since the release of the 2019 EDU logger build, and we’re already getting feedback saying all the extra soldering that we added to that tutorial creates a resource bottleneck which could prevent some instructors from using it:
“Our classroom has just two soldering stations, and the only reason there are two is I donated my old one from home. So we simply don’t have the equipment to build the logger you described. And even if we did, some of my students have physical / visual challenges that prevent them from working with a soldering iron safely…”
Or goal with the new design was to give students their first opportunity to practice skills that are useful when doing field research. However helping people do science on a budget is also important – so that feedback sent us back to the drawing board. After a little head scratching we came up with a version that combines the Dupont jumpers we used in 2016, with this more flexible flat-box layout. In the following video, I assemble one of these ‘minimum builds’ in approximately one hour. To put that in perspective, the fully soldered version takes 2 – 2.5 hours for someone with experience.
Note: After you’ve seen the video to get a sense of where you are headed, it’s usually much better to work from the photos (below) when assembling your logger. Youtube videos make it look easier than it actually is actually is when you are just starting out. So the first one you build could take many hours as you figure out what you are doing, the second will take half as long, and the third one you make usually takes less than two hours.
This variation of the the basic 3-component logger is optimized for quick assembly so the soldering has been reduced to just pin headers and bridging the I2C bus. An instructor could easily do that ahead of time with about 15 minutes of prep per unit, leaving the solder-less steps for their students. After the header pins are in place, the multi-wire connections to the logger core are made by twisting stripped wire ends together and clamping that bundle under the screw terminals.
This time reduction involves a few trade-offs, and the bringing the I2C bus to pins A2&A3 leaves only two analog ports readily accessible ( although A6 & A7 are still available if you solder some jumpers). Removing the regulator & battery voltage divider adds ~30% more operating lifespan, but it also forces you to deal with a changing rail voltage as the Lithium AA batteries wear down. The daily variation is usually quite small, but for quantitative comparisons on monthly scales you will need to correct for the change in rail voltage over time if your sensor circuits are not ratio-metric. (Note: Even commercial loggers suffer from battery related effects on the sensor readings, so you might as well learn to address this issue right from the beginning -> batteries are always affected by temperature) Another proviso is that you have to change a few components compared to the soldered build: (note: full parts list at the end of this page)
Pro Mini Prep:
Technically speaking, bridging the I2C bus over to A2/3 subjects those wires to the pin capacitance and input leakage of those analog pins (regardless of whether that channel is selected as input for the ADC p257). But in practice the pull-up resistors on the bus can handle that at the 100 kHz default.
Screw-Terminal Component Stack:
I always try to make my Dupont connectors so that the metal & plastic retainer clips are accessible (in this case facing upwards) after the logger is assembled. That way you can diagnose bad wire connection with the sharp tip of a meter probe, and if necessary, pull out & replace a single bad wire in the Dupont connector without taking everything apart.
Optional: After removing the SMD resistors, you can clip the Vcc leg on the RTC chip to force the clock to run from the backup coin-cell battery. This reduces sleep current by about 40%, usually bringing a “no-reg & noRTCvcc” build well below 0.1mA between sensor readings. But the risk is that if you bump the RTC backup battery loose it resets the clock time to Jan 1st, 2000. A CR2032 can power the RTC about four years but you have to set bit 6 of the DS3231_CONTROL_REG to 1 to enable alarms when running from the coin-cell. This modification also disables the 32.768 kHz output. Check our RTC page for more information on this clock module.
Your Logger is ready!
Now you can test your new logger to confirm all the connections are working:
1. Test the LED – Edit the default blink sketch, setting the digital pin connected to the ground line of the LED to “OUTPUT” and “LOW” in setup. Since we removed the ‘default” indicator led on the Pro Mini board, you will need to change that in the code to one of the pins connected to the color channels on your led module.
2. Scan the I2C bus – with the scanner from the Arduino playgound. The eeprom on the RTC module is at address 0x56 or 57 and the DS3231 should show up at address 0x68.
If you don’t see those two devices listed in the serial monitor when you run the scan, there is something wrong with your RTC module or the way it’s connected: It’s very common for a beginner to get at least one set of wire connections switched around during the build. With the screw terminal shield this takes only a few moments to fix.
3. Set the RTC time, and check that the time was set – There are dozens of good Arduino libraries you could use to control the DS3231, and there is a script over at TronixLabs.com that lets you set the clock without a library. [ in 24-hour time, & year with two digits eg: setDS3231time(30,42,21,4,26,11,14); ] The trick with Tronix’s “manual” method is to change the parameters in setDS3231time(second, minute, hour, dayOfWeek, dayOfMonth, month, year); to about 2-3 minutes in the future, and then wait to upload that code until about 10-15 seconds before your computers clock reaches that time (to compensate for the compilers processing delay). Open the serial window immediately after the upload finishes, and when you see the time being displayed, check that it’s not too far off, then upload the examples>blink sketch to remove the clock setting program from memory – otherwise it will reset the RTC to to that OLD hard coded time whenever the Arduino re-starts -> and the Arduino restarts EVERY TIME you open the serial window. An alternative method would be to use the SetTime / Gettime scripts from our Github, but you need to download & install a library before you can use them.
4. Check the SD card is working with Cardinfo – Changing chipSelect = 4; in that code to chipSelect = 10; Note that this logger requires the SD card to be formatted as fat16, so most 4GB or larger High Density cards will not work. Most loggers only generate 5 Kb of CSV format data per year when they are running.
5. Optional – If you are running your logger from batteries with no regulator: Calibrate your internal voltage reference with CalVref from OpenEnergyMonitor. This logger uses an advanced code trick to read the positive rail voltage by comparing it to the internal 1.1v reference inside the processor. That internal ref. can vary by ±10% from one chip to another, and CalVref gives you a constant which will make the rail/battery voltage calculation more accurate. Load the program into your Arduino, and – while the logger is running from USB power – measure the voltage between GND & Vcc terminals with a good quality voltmeter. Then type that number into the serial monitor window and write down the reference voltage & reference constant output on the serial monitor window. Write these build specific #’s inside your logger with a black sharpie, because you will need to add that info to the core data logger code later on.
6. Find a script to run your on logger. For test runs on a USB tether, the simplest bare-bones code ever written is probably Tom Igoe’s 1-pager at the Arduino playground. It’s not really deploy-able because it never sleeps the logger, but it is still useful for teaching exercises and testing your sensors after you set chipSelect = 10;. In 2016 we posted an extended version of Tom’s code for UNO based loggers that included sleeping the logger with RTC wakeup alarms. Our latest logging “Starter Script” has grown in complexity to ~750 lines, but it should still be understandable once you have a few basic Arduino programming concepts under your belt.
In the previous tutorial we attach external sensors with a cable gland passing through the housing and epoxying them into a pvc cup. But for an indoor classroom project you could simply drill small a hole through the lid and stick the sensor/module on top of the housing with double-sided tape. That pass-through hole can be sealed reasonably well with plumbers epoxy putty from the hardware store and this putty adheres quite well to both metal & plastic surfaces. Remember that breadboard connections are very easy to bump loose, so once you have your prototype circuit tested working, its usually best to re-connect the sensors directly to the screw terminals before deploying your logger in the outside world where it could get bumped around. But in a pinch you can secure breadboard pins with a little drop of hot glue to keep them from wiggling around.
Using the logger for experiments:
Many types of sensors can be added to this logger and the RTC has a built-in temperature register which automatically gets saved with the starter script. The transparent enclosure makes it easy to do light-based experiments. Grounding the indicator LED through a digital pin allows it to be used as both a status light, and as a frequency selective light sensor. The human eye is maximally sensitive to green light so readings made with that LED channel approximate a persons impression of overall light levels. Photosynthesis depends on blue and red light, so measurements using those two color channels can be combined for readings that compare well to the photosynthetically active radiation measurements made with “professional grade” sensors. In fact Forest Mimms (the man who discovered the light sensing capability of LEDs in the first place) has shown the readings from red LED’s alone can be used as a reasonable proxy for total PAR (a measurement of all light frequencies from 400-700 nm with a quantum sensor that runs about $400 each) . Photoperiod measurements have important implications for plant productivity, as do photo-biologist measurements transmittance through the plant canopy. Chlorophyll fluorescence is another potential application, and the response of plants to UV is fascinating.
The code for using LEDS sensors is from the Arduino playground. This polarity reversal technique does not require the op-amps that people typically use to amplify the light sensing response but it does rely on the very tiny parasitic capacitance inside the LED. (~50-300pF) This means that the technique works better when the LED is connected directly to the logger input pins rather that through the protoboard (because breadboards add stray capacitance) . We have integrated this into the starter script which you can download from GITHUB. I’ve tweaked the playground script with port commands so the loop execution takes about 100 clock cycles instead of the default of about 400 clock cycles. The faster version was used to generate this light exposure graph with a typical 5mm RGB LED, with a 4k7Ω limiter on the common ground which was connected to pin D3:
Characterizing light absorption and re-emission is also a primary technique in climate science . For example, measuring light intensity just after sunset with LEDs inside a heat-shrink tube pointed straight up can provide a measure of suspended particles in the stratosphere. An “ultra bright” LED has more than enough sensitivity to make these collumnated readings, in fact on bright sunny days you usually have to place the LED/sensor beneath a fair thickness of white diffusing material (sometimes refereed to as ‘Opal acrylic’) to prevent it from being completely saturated. Older LEDs that emit less light can sometimes be easier to work with because they are less sensitive, so the readings do not go to zero in high-light situations. Other sensor experiments are possible with LED’s in the IR spectrum which can be used to detect total atmospheric water vapor.
One thing to watch out for is that full sun exposure can cook your entire logger: reaching temps above 80°C can cause the batteries to pop or fry the SD card. If you have to leave the logger in full sun, consider adding a bit of reflective film or a layer of aluminum foil around the outside to protect the electronics. Though if you have a light sensor you’ll need to leave a little window somewhere for it to take a reading.
You might also find it handy to add a few holes as tie-down points,
and it’s always a good idea to add a couple of desiccant packs inside the box to prevent condensation. If you use a desiccant with color indicator beads, you can check whether they are still good simply by looking through the transparent housing.
If you clipped the RTC leg, your logger should pull less than 0.1mA while sleeping. Back of the envelope for Lithium AA’s is about 7 million milliamp-seconds of power, with your logger burning about 8600 mAs/day at 0.1mA. So clipping the regulator and adding the RTC mod should get you out to about a year before you fall off the “upper plateau” of lithium’s burn-down curve, and out to two years if your sensors don’t use much juice (…and you have a well behaved SD card). With the RTC power leg still attached you’ll see sleep currents in the 0.16mA range, so at least 6 months of operation before you come close to low voltage shutdown. I’m being conservative here because it all depends on your sensors and other additions to the base configuration. While the LED sensor idea is fun to work with, it’s a very slow method that keeps the logger running for many seconds per reading when light levels are low ->so reading all three color channels will probably cut your operating life in half again. Figuring out how to only take those light readings during the day is a good coding exercise for students that also saves quite a bit of power.
|Bill of Materials:||$20.50|
|Plano 3440-10 Waterproof Stowaway Box
Sometimes cheaper at Amazon as an “add-on” item. $4.96 at Walmart and there are a selection of larger size boxes in the series. 6″ Husky storage bins are an alternate option.
|Pro Mini Style clone 3.3v 8mHz
Get the ones with A6 & A7 broken out at the back edge of the board.
|‘Pre-assembled’ Nano V1.O Screw Terminal Expansion Board
by Deek Robot, Keyes, & Gravitech (CHECK: some of them have the GND terminals interconnected) You will also need to have a few small flat head screw drivers to tighten those terminals down. Since this shield is was originally designed for an Arduino Nano many of the labels on ST board will not agree with the pins on the ‘analog side’ of the ProMini.
|DS3231 IIC RTC with 4K AT24C32 EEprom (zs-042)
Some ship with CR2032 batteries already installed. These will pop if you don’t disable the charging circuit!
|CR2032 lithium battery||$0.40|
|SPI Mini SD card Module for Arduino AVR
Buy the ones with four ‘separate’ pull-up resistors so that you can remove three of them.
|Sandisk or Nokia Micro SD card 256mb-512mb
Test used cards from eBay before putting them in service. Older Nokia 256 & 512mb cards have lower write currents in the 50-75mA range. This is less than half the current draw on most cards 1gb or larger.
|Small White 170 Tie-Points Prototype Breadboard
These mini breadboards for inside the logger are also available in other colors.
|Dupont 2.54mm F2F 40wire ribbon cable Without Housing
Cheaper if you get the ones with the black plastic shrouds on the ends, but removing those shrouds by hand is slow work. Each $2.70 cable will let you make 2 loggers, and you”l need a couple of 6-pin connector shrouds.
|3×1.5V AA Battery Batteries Holder w Wire Leads
If you are using alkaline batteries, changing to a 4xAA battery holder doubles the run time.
If you are running an unregulated system on 2 lithium batteries, then you can use a 2x AA battery holder.
|5050 LED module (with built-in limit resistors)
(Alternatively, you can also use cheaper 5mm diffused LEDs with a 4K7 limit resistor on the GND line that you add yourself)
|3.3V 5V FT232 Module
*Be sure to set the UART module to 3.3v before using it!* and you will also need a USB 2.0 A Male to Mini B cable.
|3M Dside Mounting Tape, 22awg silicone wire, header pins, etc…||$1.00|
|Comment: You might need some extra tools to get started: (not included in the total above)|
|2in1 862D+ Soldering Iron & Hot Air station Combination
a combination unit which you can sometimes find as low as $40 on eBay.
Or you can get the Yihua 936 soldering iron alone for about $25. While the Yihua is a so-so iron, replacement handles and soldering tips cost very little, and that’s very important in a classroom situation where you can count on replacing 1-2 tips per student, per course, because they let them run hot & dry till they oxidize and won’t hold solder any more. Smaller hand-held heat guns are also available for ~$15, but they have no temperature control so you need to be a bit more careful with them.
|SYB-46 270 breadboards (used ONLY for soldering pins on Pro-Mini )
Soldering the header pins on the pro-mini is MUCH easier if you use a scrap breadboard to hold everything in place while you work. I use white plastic breadboards that they only have one power rail on the side since they do not look like my regular breadboards & I write ‘for soldering only’ on them with a black sharpie.
|SN-01BM Crimp Plier Tool 2.0mm 2.54mm 28-20 AWG Crimper Dupont JST
I use my crimping pliers almost as often as my soldering iron – usually to add male pins to components with lead wires too thin for safe connection on a breadboard. But making good crimp ends takes some practice. Jumper wires that you make yourself are always better quality than the premade ones.
|Micro SD TF Flash Memory Card Reader
Get several, as these things are lost easily. My preferred model at the moment is the SanDisk MobileMate SD+ SDDR-103 or 104 which can usually be found on the ‘bay for ~$6.
|Donation to Arduino.cc
If you don’t use a ‘real’ Pro Mini from Sparkfun to build your logger, you should at least consider sending a buck or two back to the mother-ship to keep the open source hardware movement going…so more cool stuff like this can happen!
.. and the required lithium AA batteries are also somewhat expensive, so a realistic estimate is about $25 for each logger before you add sensors.