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

PAR issue with Mayfly

Home Forums Mayfly Data Logger PAR issue with Mayfly

Viewing 6 reply threads
  • Author
    Posts
    • #17381
      Dan
      Participant

        Hello,

        I am working with a team measuring a host of variables off of mostly SDI12 sensors using both the newest and older Mayflys. We have run into an issue measuring PAR on our Mayfly logger stations. We are using analog Apogee SQ 100 sensors. We get data from the sensors/code, but the output values are about 10x too low. The relevant code is below and the full program is attached. The sensors are 3 wire with the two data wires going to A0 and A1 and the shield wire going to ground.  All the other SDI 12 sensors are working fine.

        We are at a loss for why our PAR output is always too low. Any thoughts or suggestions would be greatly appreciated.

        Thanks

        Dan

        int16_t adc0 = ads.readADC_Differential_0_1(); // finds differential between analogue pins 0 and 1 and returns number of bits
        float voltage = adc0 * 0.1875; // computes mV by multipling bits by constant for ADS1115 @ +/- 6.144V gain
        float PPFD = voltage * 5.0; // SQ-110 has calibrated output of 5.0 µmol m^(-2)*s^(-1) per mV

      • #17383
        Shannon Hicks
        Moderator

          I looked at your sketch, it’s based on some really old examples we published many years ago at the beginning of the Mayfly project, but it should still work if you’ve got all the original old libraries.  Many of them have been replaced or updated since then, and major changes were made to the Mayfly board design in recent years, making some of your code slightly incompatible with the Mayfly 1.0 and 1.1 boards.

          But as for the differential ADS1115 analog readings for a self-powered sensor like the SQ-110, your code looks correct.  Have you tried removing the sensor and connecting something with a known voltage (below 3.3v) to see what readings you get?  For example, with the sensor removed from the logger, connect a standard AA battery to the two aux analog pins of the Mayfly so that the Mayfly will read the battery voltage (around 1.6v for a new AA battery).  Your code line 554 would then measure about 8526 bits.  Line 555 would convert that to voltage (in millivolts), which would be 1598.63 mV.  Then line 556 would convert that to quantum flux units by multiplying it by 5, resulting in approximately 7993.  (this is a number way higher than you’d see in the real world because the unamplified quantum sensor has a max output of 800 mV, but simulating an analog sensor by using a single battery is an easy way to test wiring or code to make sure everything is correct before using a real sensor.)

          You could also try connecting a standard voltmeter (like a handheld digital multimeter) to your sensor wires (when not connected to a Mayfly or anything else) on a sunny day and see if it reads close to full scale (500-800 mv).

        • #17388
          Dan
          Participant

            Shannon

            I’ll give your suggestions a shot and see if we learn anything.

            Thanks for the quick reply.

             

            • #17393
              Dan
              Participant

                Shannon,

                As you suggested, I tested a duplicate of our set up in the lab and used a power supply source set at 1.5V in the aa0 and aa1 ports used to measure PAR on the mayfly. I get 93 mV and 470 umol for PAR. Clearly wrong. It appears the bits are recorded wrong or they are converted to mV incorrectly.  Any thoughts on a next step to troubleshoot this?

                Dan

                 

                 

            • #17394
              Shannon Hicks
              Moderator

                Which hardware version of the Mayfly board are you using this sketch on?

              • #17399
                Dan
                Participant

                  Current board that I am working on in the lab is a 0.5b. But we have run into the same issue with logging/calculating PAR using version 1.0 as well. We are running a mix of 0.5 and 1.0 in the field due to many of the older 0.5’s USB ports failing.

                  Dan

                • #17401
                  Shannon Hicks
                  Moderator

                    Sorry I didn’t catch this earlier when I looked at your code.  But in line 39, you included the wrong library.  All of the various Mayfly board versions we’ve ever built have the ADS1115 chip on them, so you need to specify the ADS1115 library and no the ADS1015 library (because the 1015 is the lower-resolution version of the chip).  So line 39 if your code should say:  #include <Adafruit_ADS1115.h>

                  • #17405
                    Dan
                    Participant

                      I updated the ADC library and changed the ADC definition on line 77 to the 1115 and that did the trick. 1.5V.   I am assuming that any past data taken in the field with the wrong ADC definition cannot be back calculated. But moving forward we have a working PAR sensor.

                      Thank you so much for taking the time to help solve this. Much appreciated.

                  Viewing 6 reply threads
                  • You must be logged in to reply to this topic.