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 - 511 through 520 (of 562 total)
  • Author
    Posts
  • in reply to: Arduino datalogger #1834
    Shannon Hicks
    Moderator

      Here’s some sample code for running 6 Decagon 5TM probes with a standard Uno board. It could be modified by changing the pin number for the LED, in the example below I used the default pin 13 for the onboard LED. Mayfly users would want to select either 8 or 9. I usually prefer to do long-time recording with a separate real-time-clock module like what’s on the Mayfly, but in this example I just polled the rolling “millis” counter to get the time since the board was started. I set the example interval to 60 seconds, but you could adjust that if you wanted.

      Remember that first you have to connect each 5TM sensor to the Arduino board one at a time and configure each one with a unique channel number. To work with the code below, you should number them sequentially from 1 to 6. Use the “address change” example that’s included with the SDI12 library, making sure to hook the sensor data pin to the correct pin that’s stated in the example, or change the example to match your wiring. In my example code below, I put the sensor data pin on D7.

      I think this code should work, it compiles properly, I just don’t have 6 sensors handy to test it completely. It’s based on some thoroughly-tested Mayfly code, but I just removed all of the code regarding the Mayfly’s RTC, memory card, and sleeping functions.

      in reply to: Arduino datalogger #1832
      Shannon Hicks
      Moderator

        You’re going to need to connect the sensors one at a time to the Arduino board in order to program the address. Then you’ll need to hook them all together to the same bus. For example, all 6 of the sensor power wires need to go to the Vcc power bus, all 6 of the sensor ground wires need to go to the board GROUND, and all 6 of the sensor data lines need to go to a data pin (I like to use D7 for my SDI-12 data lines because it’s rarely used by other things like accessory shields).

        So your challenge is going to be getting 3 sets of 6 wires all connected to just 3 pins on the Arduino board. This can be accomplished in a variety of ways, depending on how comfortable you are with soldering or stripping wires or making a custom board with some screw terminals. Or you might be able to do it with a breadboard if you don’t mind cramming the sensor wires into the holes (it’s generally bad practice to cram medium-gage bare wires into a solderless breadboard because it permanently widens the contacts making it unreliable for later use with smaller components).

        Do you have a breadboard, or some spare screw terminals, or a screw-terminal breakout shield for the Duemilanove? Or maybe you just want to use a wire nut to join each of the 6 wires together along with one wire to connect to Arduino board? It’s usually not recommended to join that many wires with one wire nut, but it might be possible if you do it just right. Is this just for a temporary test/experiment, or are you thinking of a long term setup?

        Once we figure out the wiring, I can post the sample code for cycling through 6 channels. How often do you want to take a sample, and is it just being displayed on the computer using the Arduino IDE’s serial monitor? If you used a Mayfly the data could also be time-stamped and stored on the memory card.

        in reply to: Arduino datalogger #1830
        Shannon Hicks
        Moderator

          I’ve connected 15 of the Decagon 5TM sensors to one Mayfly board before, so it’s no problem to connect 6 to a Duemilanove. You’ll need to figure out how to get them all wired to the board, and that depends on what type of termination is on the ends of the sensors. Do your 5TM probes have the 3.5mm stereo headphone-type jack on the ends, or are they bare wires?

          in reply to: Arduino datalogger #1825
          Shannon Hicks
          Moderator

            Did you use the “Address Change” example included with the SDI12 library to give each sensor a unique address? Decagon 5TM sensors are always set to default address “0” when you first use them, so you’ll need to select new ones. I’d suggest something sequential like 1, 2, 3, etc so that it’s easy to cycle through them in the sampling code. How many sensors are you connecting at once? And are you using these with a Mayfly board or some other sort of hardware arrangement?

            in reply to: Water level monitor with a Mayfly. #1824
            Shannon Hicks
            Moderator

              ArnoudC, the second half of the Ultrasonic sensor example now has sample code for recording the data to a memory card and also puts the logger to sleep between readings.

              in reply to: Low power project #1822
              Shannon Hicks
              Moderator

                For anyone interested in putting their Mayfly to sleep between sensor readings, I recently posted this Sleeping Mayfly Logger example sketch:

                Sleeping Mayfly logger example

                in reply to: Arduino datalogger #1820
                Shannon Hicks
                Moderator

                  Different types of SDI12 sensors have different commands for taking measurements and retrieving data from the sensor, so the Arduino code has to be modified for whatever specific sensor you’re using. Plus if you’re using multiple sensors, they each have to be pre-programmed with a unique address, which you then call separately in the Arduino code.

                  What type of sensors are you using? And did you modify any the example code provided with the SDI12 library?

                  in reply to: Modbus/12V to cellular #1813
                  Shannon Hicks
                  Moderator

                    Neil, these were all good observations about the 5v boost circuitry on the Mayfly. The NCP1402 has been obsoleted by the manufacturer, so I’m looking for alternative ways to generate 5v and possibly other voltages onboard the Mayfly.

                    in reply to: Battery Power Options #1812
                    Shannon Hicks
                    Moderator

                      Yes, you could attach a 4.5v alkaline battery pack to the LIPO battery connection, but since you never know who might come along later and plug a solar panel into the SOLAR jack, it’s good practice to only connect LIPO batteries to that jack. That’s why I designed a separate 2-pin header (unpopulated) on the Mayfly that’s labeled “Ext 5V” so you can solder a little 2-pin header (preferably polarized) on there and connect an external battery pack that way. I like this particular connector/header combo: http://www.allelectronics.com/item/con-242/2-pin-connector-w/header-.10/1.html

                      in reply to: Purchasing Accessory Boards #1777
                      Shannon Hicks
                      Moderator

                        ChanCafun: that’s awesome, it looks really good. I assume you didn’t have any trouble figuring out the layout and spacing of the two 2×10 headers. I put them on a standard 0.1″ grid so it would be easy for people to produce their own accessory boards.

                        What SDI-12 sensors are you using? I don’t recognize those 6-pin connectors, but they look like they might be useful for times when the 4-pin Grove socket isn’t big enough.

                      Viewing 10 posts - 511 through 520 (of 562 total)