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

Can't read/store values from Yosemitech using WingShield

Home Forums Mayfly Data Logger Can't read/store values from Yosemitech using WingShield

This topic contains 3 replies, has 3 voices, and was last updated by  Shannon Hicks 2 weeks, 6 days ago.

  • Author
  • #13149


    Hello and greetings from New Zealand,

    My work group is developing some mayfly loggers and we have run into a problem using Modbus with a Yosemitech Y4000 sensor, measuring pH, conductivity, temperature, turbidity, and dissolved oxygen. We are attempting to communicate to this device using the WingShield and Modbus (as described on the EnviroDIY github) on the Mayfly. We have were able to successfully read data off of this unit for a while, but then, seemingly with no changes made to the code, we started getting a reading of -9999.00 for all of the sensors.

    With additional fiddling, the problem got worse, and now it seems that when the mayfly tries to read and log the sample, the program just restarts from the beginning.

    We are able to connect and read values off of the sensors using the GetValues.ino script in the YosemitechModbus library. However when we try to run a logging script based on the ModularSensors library, everything falls apart. I think it has to be a library issue, where my code just isn’t playing nice with one of the libraries in the EnviroDIY universe. I am using platformio with the libraries included in the ‘libraries’ enviroDIY repository.

    I will test it again soon and collect additional debugging info, but I thought I would just post about it now in case anyone has been having similar issues lately. Attached is a screen shot of what happens when the logger tries to save the data, and here is a recent iteration of the code I am trying to use:

  • #13151

    @rachel.murray, that’s great to hear that you were able to get the YosemiTech Y4000 sonde working with our Modbus Mayfly Wing Shield and associated documentation. I developed all of that for a team at Winona State University in Minnesota, but I hadn’t been aware of anyone else trying to integrate the Y4000 with our EnviroDIY stack. So that’s satisfying to hear that you got it working, for a while.

    BTW, are you working with my friend Troy Baisden?

    I will say that the Y4000 sonde is the one sensor from YosemiTech that has given me headaches to get working and also to keep working. Unfortunately I haven’t kept up with documenting everything.

    The first challenge with the Y4000 is that it needs a stable and consistent 12V of power with the capacity for high amperage draw during startup and when the brush is spinning. I was able to barely get it to work on the Mayfly with the Modbus Wing + two 680 uF capacitors, but only when no other sensors were attached. The system was browning out when I attached other sensors, and I’m guessing that if the radio were drawing power while the Y4000 is on that would also brown out the system.

    The solution was to wire up an independent 2 Amp 12V power supply that is switched on & off by the Mayfly. While the power for the Y4000 system comes from this separate power supply, the Modbus communication still passes through the Wing Shield. None of this is publicly documented yet, but here are my notes:

    Redo Y4000 line, with built-in power regulation and switching

    Overview of connections
    – Battery to Pololu Power Switch HP to control by Mayfly
    Pololu 12V Voltage Regulator to Sonde

    Pololu Big Pushbutton Power Switch with Reverse Voltage Protection, HP,
    Battery Side:
    – Vin to battery +, This powers the system
    – GND to Battery
    Sonde side (via regulator)
    – Vout to 12V regulator Vin
    – GND to 12V regulator GND
    Mayfly Control side
    – CTRL to Mayfly switched power (Setting D10)
    – GND to system/Mayfly ground

    Pololu 12V Step-Up/Step-Down Voltage Regulator S18V20F12
    Battery Side (via switch)
    – Vin to switch Vout
    – GND to switch GND
    Sonde side
    – Vout to Sonde red
    – GND to Sonde black

  • #13158


    Thanks for the reply,

    Yes, I am working with Troy :). We have had some success with the decagon CTD, including using a wifibee and portable wifi hotspot to log data to monitormywatershed.org. It would be nice to have turbidity measurements as well, which is one reason we are interested in the Y4000 device.

    In our y4000-mayfly setup, I have tried removing the wifibee modem, along with the associated code. I have also tried running with and without other sensors. We are currently testing using an external 12V power supply to power the y4000 (left on constantly for testing purposes). Regardless of the setup, the result is the same – the mayfly can’t seem to communicate with the sensor.

    The mayfly reboots right after attempting to activate the brush. This makes a brownout seem like a likely problem, however connecting to an external 12V supply doesn’t seem to help. I’m wondering if there might be some sort of problem with the serial connection using Altsoftserial.

    I’m going to try a few more tests and report back – are there any particularly useful debugging flags that could shed some light on the problem?

    Thanks for your help,


  • #13163

    Shannon Hicks

    It’s hard to tell exactly what’s going on with your wires from the photo, but you should make sure your separate power supplies are sharing a common ground. If you’ve got 12v going to the sensor and 5v going to the board, you need to have the ground of both of those supplies (or batteries) connected to the same ground as the Mayfly.

You must be logged in to reply to this topic.