Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

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

This topic contains 5 replies, has 2 voices, and was last updated by  Sara Damiano 2 weeks, 2 days ago.

  • Author
    Posts
  • #12273

    Dave
    Participant

    Hi everyone,

    We have made some good strides getting a Mayfly logger network started here in New Hampshire thanks to all the information here on Enviro-DIYs forums. We can now collect measurements from multiple SDI-12 devices, store to an SD card, connected to a battery and RTC for sleep when not collecting.

    We’ve been thinking about adding a Campbell Scientific CS-215 (link) using a power relay and an external battery to provide it with 12V. There seems to be an issue connecting the Mayfly to the CS-215 though. We are able to provide it with an address using the address_change.ino script in the Envirodiy/SDI-12 examples. However, when we attempt to scan for addresses, the sensor is not found.

    The interesting thing is that when we use a Campbell Scientific Logger to communicate with the sensor, everything seems fine. That is leading us to think that there is an issue with the delay or timing in the script for the arduino-based logger. I’ve seen some others with this kind of issue (example) but have not been able to find a solution.

    I wonder if anyone here may have a thought about what could be the issue?

    Dave

  • #12275

    Sara Damiano
    Participant

    Hm. I’ve done some pretty extensive rewriting of the sdi-12 library in the last month or so. Do you know which version of the library you are using? Can you try updating to the most recent version (1.3.1) if you’re not already using it? Can you post the full serial output your getting from both the address change example (b) and the data logging example (d).

  • #12287

    Dave
    Participant

    Hi Sara,

    Thank you for getting back to me. I’ll check the version of the library we have and will capture the serial output. We won’t be having a lab meeting until Tuesday so I will send it right after that. I noticed that there were updates last month so perhaps that will sort things out. In the meantime, thank you for helping!

    Dave

    • #12288

      Dave
      Participant

      Hi Sara,

      We spent several hours today trying to work with the CS-215. We did update and use the most recent library (1.3.1) but were still having issues with the two examples. For the address change example, all of the addresses were vacant, even though we had defined the sensor having an address previously using a CR1000 (Campbell) logger. The simple logger did not result in anything going to the serial – it said no sensors found and to check the physical connection.

      One interesting twist – for a while we were adjusting the delays in the address change script with the original (1.0.1) library. Every time the code ran, the sensor appeared at an address and we were able to change the address. However, when the script continued and rescanned all the addresses, the sensor was identified in a different address than what we told it to be at. This makes me think that there is some particular mismatch between the timing and delays that the sensor requires when passing data back/forth using the SDI-12 protocol, and what is in the library that works with other sensors that are not 12 volts.

      The only thing we can think of is that somewhere in the CS code for how a CS logger interacts with a CS-215 that gets the delays exactly right because Campbell knows the timing needed by that particular sensor. I’m not sure if it is possible to access that script and/or look in the manual to see if it is an issue with the specific sensor, but that is my guess. You may know where to look since you were involved in working with that library?

      Here is the manual

      Thanks for any advice or guidance you could provide,

      Dave

  • #12289

    Sara Damiano
    Participant

    Hm. I doubt the mid-character times are the problem, but it is possible that the break or marking times are causing problems. You can try tweaking them a bit on the very top of the SDI12.cpp file.

    Instead of timing, it’s possible there’s a voltage problem. Do you have the sdi-12 data pin going directly to the Mayfly? Then the power and ground to another battery? The sdi-12 specification actually requires that the voltage of the “spacing” be over 3.5V. The Mayfly is only powered at 3.3V, so it’s not actually ever getting the voltage high enough to meet sdi-12 specs. The decagon and zebra tech sensors I’ve worked with have seemed to be fine with that but the Campbell might not be. Can you try putting a level shifter on the data pin to boost the voltage? I think a standard Uno runs at 5V so you could also try the basic communication on an Uno if you have one handy to see if it works.

  • #12290

    Sara Damiano
    Participant

    I’m sorry, I just looked back at your link from the first page and they mentioned they were using a Mega, which should be 5V. I don’t know. I don’t have any other guesses. Do you have an oscilloscope you can put on the line to watch the communication between the sensor and CR1000? If so, can you share the results of sending a single command to the sensor via the CR1000 and the same command between the Mayfly and sensor?

You must be logged in to reply to this topic.