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: Campbell Scientific CS-215 SDI-12 communication issues w/ Mayfly

Home Forums Mayfly Data Logger Campbell Scientific CS-215 SDI-12 communication issues w/ Mayfly Reply To: Campbell Scientific CS-215 SDI-12 communication issues w/ Mayfly

#14103
Nikeaulas
Participant

    Hi,

    As it seems the Enviro lib still have the same problem with the CS215, I think I actually found a fix, so i wanted to share it with you guys.

    I’ve updated the Arduino thread linked in the first post. But I’ll put the same explanation here:

    The Enviro lib does not fully respect the SDI-12 protocol. There is one important timing aspect which is completely missing from the lib. In the spec we can find the following statement:

    “A sensor must wake up from a low-power standby mode and be capable of detecting a start bit from a valid command within 100 milliseconds after detecting a break”

    In the Enviro library a SDI-12 command is directly sent after a wake up frame which is consisted of a 12ms spacing + 8.3ms marking (see sendCommand functions). I believe in most cases cases, sensors are implemented in such a way that they actually do wake up “just” after the detection of 12ms spacing (or not sleeping at all). The 8.3ms marking being more than enough time for them to wake up. The CS212 doesn’t seem to belong in that category. It takes A LOT of time for it to wake up (at least 60ms to consistently answer from what i have found out).

    Adding (in my case) a 100ms delay, between a wake up frame and a SDI-12 command , as per requested in the spec, fixed the problem, for me.

    Hope this can be helpful. If it is, I guess someone should update the lib =)

     

    Have a good day, stay safe.