Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water.
New to EnviroDIY? Start here

Reply To: Arduino datalogger

Home Forums Other Data Loggers Arduino datalogger Reply To: Arduino datalogger

Shannon Hicks

    Here’s some sample code for running 6 Decagon 5TM probes with a standard Uno board. It could be modified by changing the pin number for the LED, in the example below I used the default pin 13 for the onboard LED. Mayfly users would want to select either 8 or 9. I usually prefer to do long-time recording with a separate real-time-clock module like what’s on the Mayfly, but in this example I just polled the rolling “millis” counter to get the time since the board was started. I set the example interval to 60 seconds, but you could adjust that if you wanted.

    Remember that first you have to connect each 5TM sensor to the Arduino board one at a time and configure each one with a unique channel number. To work with the code below, you should number them sequentially from 1 to 6. Use the “address change” example that’s included with the SDI12 library, making sure to hook the sensor data pin to the correct pin that’s stated in the example, or change the example to match your wiring. In my example code below, I put the sensor data pin on D7.

    I think this code should work, it compiles properly, I just don’t have 6 sensors handy to test it completely. It’s based on some thoroughly-tested Mayfly code, but I just removed all of the code regarding the Mayfly’s RTC, memory card, and sleeping functions.