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

Shannon Hicks

Forum Replies Created

Viewing 10 posts - 261 through 270 (of 552 total)
  • Author
    Posts
  • in reply to: Meter Hydros 21 address #15359
    Shannon Hicks
    Moderator

      Meter Group sensors that use SDI12 protocol (like the Hydros 21) come from the factory with a default SDI12 address of ‘0’.  Their sensors are programmed to output a serial data string containing the current measurement upon powerup if the address is set to ‘0’.  Meter Group’s dataloggers all talk to their sensors like this.  You can see it in action if you use a sketch using SoftwareSerial to monitor the sensor data pin and capture the serial data string immediately after you apply power to the sensor.  That would work fine if you were only using one sensor on the bus, and only wanted one reading.  Since we typically take 6 to 10 readings and average them, plus we usually have several other SDI12 sensors all connected to the same data wire, then having individual addressed for each sensor is imperative.  If you connect 2 or more Meter Group sensors to the same data pin and they’re both set to channel ‘0’, they’ll both attempt to send the serial string at the same time, and you won’t be able to capture it properly with the Mayfly logger.

      In order for the Meter Group sensors to properly respond to SDI12 commands, they need to be programmed to any other channel EXCEPT ‘0’.

      Most other sensors don’t have this specification, and we sometimes leave them as ‘0’ if we’re just testing it.  But for deployments, we’ve been using our own “in-house” channel allocations, just to keep things simple.  For example, our turbidity sensors are usually channel ‘2’ or ‘3’, oxygen sensors are ‘5’, etc.  That makes it a little easier to keep track of when juggling the sketches for hundreds of stations, each with different combinations of sensors.

      in reply to: 504 Response Code #15336
      Shannon Hicks
      Moderator

        I saw this happen with someone recently who was having the same issue with data not showing up online and getting the 504 response code.  Turns out it was a missing UUID in the list of sensor variables in the Arduino sketch.  When there’s a mismatch between the string you send Monitor My Watershed and what it’s expecting, you get the 504 response.  I can’t see the original string that was posted before Sara edited to remove the UUIDs, but it appears that there’s a UUID missing from the string right before the last parameter (which I’m guessing is cell signal percent?)

        So make sure there are the same number of parameters in the sketch as what the website is expecting, and that the sketch code in the two sections that deal with the UUIDs and parameters are matched up properly.

        in reply to: Bizarre eTape Sensor Behaviour #15279
        Shannon Hicks
        Moderator

          No, there is not a built-in voltage divider on the Mayfly to protect either the 1284p’s 10-bit ADC or the auxiliary 16-bit ADS1115 ADC input.  The jumpers on the Mayfly that let you select the Switched 3.3 or Switched 5v only change the voltage that’s supplied to the Grove jack’s VCC pin.   There’s nothing to protect the Mayfly’s ADC inputs from overvoltage because there’s an infinite number of input voltages someone could attach to the Mayfly, so it’s up to the users to make sure they reduce their signal to keep it under 3.3v.  (A little history:  the Mayfly board was originally designed to work with a turbidity sensor that needed 5v excitation but produced a 0-2.5v output, so overvoltage was never a concern until the board started being used by a wider audience, and later once we started using other analog-output sensors with outputs like 0-5v.)

          From the link you provided, it doesn’t appear that there’s any sort of voltage divider included in that interface device.  It specifically says it’s a 0-5 volt module, so there doesn’t appear to be any way to force it to adjust its output voltage range.  It also says it needs 6-30v excitation, so I’m curious what you’re using to power it.  I’m guessing there are other resistance-to-voltage modules out there that would operate just fine on 3.3v excitation and have a 0-2.5v or 0-3.3v output, or even better – a digital output like I2C or SPI.  You can also have your Mayfly do the resistance to voltage measurement with just a little bit of hardware and some code.

          But if you want to continue using the 0-5v module, you’ll need to lower it to a safer range in order for the Mayfly to read it properly. When I have a sensor with a 0-5v output, I put two perfectly matched 100k resistors (check the resistance with a precision ohm-meter of about a dozen 10% precision resistors and you’ll find a couple that are the same) in series between the sensor output and ground, and then read the voltage in the middle of the two resistors and you’ll get exactly half.  So for a sensor with a 0-5v output, you’ll now get a range of 0-2.5v.  If you really wanted to maximize your resolution, you could use a 2/3 resistor divider to give it a range of 0-3.3v, but with the ADS1115, we’re already getting resolution finer than a fraction of a millivolt, so it’s doubtful you’d see much improvement between using a 1/2 divider when compared to a 2/3 divider.

          As for your code, I have a few suggestions.  Line 52 should be removed.  The Pin 2 you mentioned in that pinMode statement is actually the 1284p processor’s pin 2, which is the secondary UART RX pin, so if you were using something like a Bee module, that could cause problems.  In line 38, you declared the variable eTapePin was defined as 2, and because that’s the channel number of the aux ADS1115, there’s no reason to set the pinMode for it.  You only have to use the variable name when making the readADC statement like you did in line 64. And filling an array in order to find the median uses more memory and takes lots of complicated code when compared to a simple averaging loop, especially if you later want to increase the number of readings.

          Here’s a sketch I used recently for taking 100 readings (10ms apart) from the ADS1115 aux analog pin and then averaging them and displaying the result to the serial monitor.  If the signal you’re measuring is 3.3v or less, no change is necessary.  If you’re measuring a voltage like 5v, use a 50/50 voltage divider to cut the voltage in half and then use line 76 to calculate the average voltage instead of line 74.

           

          in reply to: Bizarre eTape Sensor Behaviour #15276
          Shannon Hicks
          Moderator

            You didn’t state what board you’re using, but if it’s an EnviroDIY Mayfly board or any other board with a processor operating voltage of 3.3v, then you’re not going to be able to read a 5v signal.  It’ll max out reading around 3.3v, and you’ll likely damage the ADC input if you run it for very long or exceed the absolute maximum voltage of the ADC input pin.  The easiest thing would be to use a voltage divider to cut your 0-5v signal into either half or 2/3, then just multiple the result by the ratio and you’ll get the full voltage.  On a related topic, are you taking multiple readings and then doing an average, either with the onboard ADS or a Mayrly’s ADS1115 ?  Because if you take lots of analog readings and declare the sum of the bits as an “int”, then strange things will happen when the sum is greater than 32,767 (it drops to negative -32768 and then continues until it approaches 0) so converting a really large number of bits into volts will generate a graph similar to what you posted.

            in reply to: MayFly Kit/Bee Adapter availability #15266
            Shannon Hicks
            Moderator

              The forum is very active, there have been 7 post in just the past 24 hours alone.  Do you mean this particular thread?  Almost all of our items have been in stock on either Amazon or our new EnviroDIY Shop page for several months now, but we recently sold out of LTEbee adapters on both sites because of a huge rush of large orders a few weeks ago.  We’re working to restock them but I don’t have an estimate on availability yet.

              in reply to: Testing power consumption #15261
              Shannon Hicks
              Moderator

                If the “Switched 3v3” or “Switched 5v” is turned off, then nothing connected to those pins will be drawing power.  But if your Mayfly board is not actually going into deep sleep, then it’s sitting in idle mode instead of actually sleeping, and that’s why it’s drawing 6ma.  Wasn’t there some recent threads about how the I2C device was keeping the board from sleeping properly?

                What’s the reason for having a separate ADC board?  Are you just worried about reading a voltage greater than 3.3v with your Mayfly onboard ADC?  Because if that’s the only reason, then it would be easier to just put a resistor divider on the sensor output and connect the center of it to your Mayfly ‘sADS1115.  If you pick 2 perfectly matched resistors (like 10k) then you simply double the ADS reading to give you the actual sensor voltage.

                in reply to: Testing power consumption #15248
                Shannon Hicks
                Moderator

                  It sounds like your Mayfly is not actually going to sleep.  An idle Mayfly will use around 6.5mA, and a sleeping Mayfly will use between 0.25mA and 0.5mA, depending on whether you’ve got a microSD card in the slot and the type of card.  Here’s the power consumption results from Mayfly current tests:

                  Mayfly current when board is powered and idle: 6.5 mA
                  Mayfly current when MCU put to sleep and no microSD card in socket: 0.27 mA (or 270 uA)
                  Mayfly current when asleep with microSD card in the socket: 0.43 mA (or 430 uA)

                  in reply to: Mayfly low battery voltage readings #15231
                  Shannon Hicks
                  Moderator

                    Sounds like it might possibly be this issue:  https://www.envirodiy.org/topic/innacurate-lipo-battery-voltage-data/

                    I’ve only seen it happen on a few boards since that post a couple years ago.  The only fix it to replace the bad MOSFET transistor.

                    in reply to: PlatformIO error with MS 0.28.01 #15229
                    Shannon Hicks
                    Moderator

                      It shows you’ve got “Arduino Uno” selected as your board type. If you’re using a Mayfly, you need to change that in the “Tools–> Board” menu. Once you’ve done that, also make sure you’ve selected the right COM port.  All of this is assuming you’ve already added the Mayfly board to the IDE as a supported board, using the instructions here:  https://www.envirodiy.org/mayfly/software/

                      in reply to: Connecting Bare Wire Sensor to Jack Adapter #15212
                      Shannon Hicks
                      Moderator

                        Thanks for the info Brian.  I heard they were switching cable outer jacket colors soon, and a few of our workshop attendees last month received Hydros 21 sensors with black cable instead of the usual red, so I’m assuming the inner wire color changed too.  Their soil moisture sensors also changed inner wire colors a few years ago, and the manual shows both options.  It’s always good practice to double-check with a manufacturer if it’s unclear what wires to connect to a datalogger because some sensors can be damaged by connecting them to the wrong pins.  The Meter Group sensor seem to be pretty hearty and I haven’t accidentally broken one by connecting it wrong, but I’ve used other sensors that were immediately bricked by hooking it up wrong.

                      Viewing 10 posts - 261 through 270 (of 552 total)