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

    The code I posted above has been running for years on several different loggers, so it is correct. Have you verified that you correctly wired the signal, power, and ground lines of the sensors to your Arduino board. If you’re using a Mayfly and one of the Grove ports, you’ll need to turn on the switched external power for the grove port (D22), or you can just connect them to your board’s Vcc pin. Keep in mind that with the Decagon sensors, the red wire is the data wire and white is the positive power wire. Once you’ve assured the sensor is connected properly you need to make sure you successfully programmed each of your 6 sensors with a unique SDI12 addresss using the “Address Change” example included with the SDI12 library. Do them one at a time and verify that you’re getting output from each one (one at a time) on the serial monitor. Once you’ve done all that, then you can put all 6 sensors on the board and run the sketch I posted above. If you want to use less than 6 sensors, just change the ‘6’ in line 31 to whatever the max number of sensors are. You can even put ‘1’ if you want to run the sketch with just 1 sensor.

    If that still doesn’t work, maybe you could post some photos if your setup and the wiring so we can see if everything is connected properly.