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 - 401 through 410 (of 552 total)
  • Author
    Posts
  • in reply to: Mayfly problem uploading a sketch #12365
    Shannon Hicks
    Moderator

      Are you connecting to the Mayfly directly using the onboard microUSB jack, or a separate FTDI adapter connected to the FTDI jack on the Mayfly? Are any LEDs powered on the Mayfly when you turn it on? I hand-check and program every Mayfly board when it leaves my workshop with a sketch that blinks the red and green LEDs and prints the temperature to the serial port every second at 9600 baud. Assuming the board hasn’t been reprogrammed by whoever sold it do you and that it’s still functional, you should see that kind of response from the board even before you attempt to program it yourself. Since you bought it on Ebay, I have no way of knowing whether the board is functional since the seller must have bought it from us on Amazon and is then reselling it. It’s definitely not an authorized, direct-from-EnviroDIY board.

      in reply to: Programming Mayfly to send alerts… #12364
      Shannon Hicks
      Moderator

        Yes, I’ve done it before where the logger sends alerts directly from the station, but it’s usually easier to implement this using a script on whatever server you’re hosting your data on. Because if you want to change the value of the trigger points, or do some filtering of single spikes that occur during low turbidity (like from trash or fish that get in the way of the sensor during a single reading), or a slope analysis of the 5 most recent records, a very simple script can do that on the server, and then react by sending an alert to whatever destination you choose, which you can also change and update as frequently as you want on the server without having to visit the logger to reprogram it.

        in reply to: GPRSBee #12363
        Shannon Hicks
        Moderator

          There are 3G and 4G modules that work just fine with the Mayfly. Are you meaning you want instructions on how to do it, or you’re just looking for the hardware?

          in reply to: Connecting to the Internet #12258
          Shannon Hicks
          Moderator

            Where did you get that code example? It looks like a combination of some older code I used to use plus some newer stuff, but there are several mismatches and missing things so it won’t work properly as written. To transmit on an Xbee module, you should use Serial1. Serial0 is the port you should use for printing to the serial monitor. Your example above has all the status stuff happening on Serial1, so that should be changed to just Serial and then you can transmit the Xbee string payload on Serial1, since that’s the default configuration of the solder jumpers on the back of the Mayfly.

            Once you have taken whatever sensor measurement you want, you can build a data record string append to the date/time/battery/boardtemp string and then write it to the memory card, and then also use those same variables to build the URL string in a separate function. Then just send that URL string to the Xbee serial port (assuming you’ve turned on the Bee module in advance, I use the pin-sleep configuration so I’m able to toggle the Beee module on and off).

            Also, in your code above, the onboard battery voltage measurement part in the createDataRecord has the ratio as 1.47, which is only correct for Mayfly boards v0.3 and 0.4. For boards v0.5 and above, the ratio is 4.7. Which version of Mayfly do you have?

            in reply to: Connecting to the Internet #12256
            Shannon Hicks
            Moderator

              The code I posted above is for the Arduino/Xbee receiver module. All it does is “visit” a URL that it “hears” on the radio. The Mayfly logger in the field is the unit that actually generates the rest of the URL. I put the beginning of the URL in the receiver code above just for simplicity, but in real life the entire URL is generated on the field loggers because sometimes they visit different PHP scrips or domains. If you have more than one logger sending data, you’re going to want to have different tables for each station. Then you have the parameters to send. So the logger payload that goes into “thisData” in the example would be a string that should look something like this: UnitId=001&Temperature=14.2&Voltage=2.5&Depth=342.5

              And the full URL would be: https://www.somewebsite.com/demo.php?UnitId=001&Temperature=14.2&Voltage=2.5&Depth=342.5

              Your PHP script would then put the 3 parameters into the table name designated by “UnitId”.

              in reply to: Connecting to the Internet #12254
              Shannon Hicks
              Moderator

                There’s a lot of things that could cause your data to now show up in the table, either on the Arduino end or the server/PHP end. Have you tried visiting the URL using your web browser to make sure you’re able to post data to the table using a properly formatted URL? If you can do it with a browser, then you know your PHP code is right and the issue is with your Arduino sketch. But if you can’t add data to the table via your browser, then you’ll need to fix your PHP code on the server.

                in reply to: Connecting to the Internet #12251
                Shannon Hicks
                Moderator

                  As mentioned above, I use lots (100+) of GPRSbee modules, they are available from SODAQ in the Netherlands. They are 2G, so they only work in certain areas, but we find there’s coverage in about 90% of our locations. There are 3G and 4G bee modules available from other companies like Digi, but they cost at least twice as much so we usually just use the GPRSbees.

                  in reply to: HCSR04 & Sw5 #12248
                  Shannon Hicks
                  Moderator

                    As for the switched 5-volt supply on the Mayfly, it’s a boost converter that I put on the Mayfly years ago because we use a lot of sensors that require 5-volt excitation, but then they return a 0-2.5v analog signal, which is safe for the Mayfly to read with either the onboad 10-bit ADC, or the auxiliary 16-bit ADC. The 5v boost isn’t needed for working with the Grove rangefinder I linked above. I have successfully used them with the Mayfly before, and they are fine being powered by the 3.3v supply of the Mayfly, which is preferred since the signal levels between the Mayfly and any peripheral sensor should be the same. If you power an external device with 5v, then you should use additional level-shifting circuitry to protect the Mayfly from potential damage.

                    The VCC pin of the Grove ports on the Mayfly are powered by the SW_3v3 line by default. Swapping the jumper headers next to the jacks will change them to 5v, but only do that if you are prepared to deal with the potential voltage mismatch. To control the SW_5 and SW_3v3 pins of the Mayfly, simply write pin D22 high whenever you want to power anything connected to the Grove terminals.

                    in reply to: HCSR04 & Sw5 #12247
                    Shannon Hicks
                    Moderator

                      Grove connectors, cables, and sensors are actually quite easy to get. Usually when you buy a Grove sensor, it comes with a free 20-cm cable. Or you can get 5-packs of the cables for around $3. https://www.robotshop.com/en/grove-4-pin-buckled-20cm-cable.html

                      You can get 10 Grove connectors for $1: https://www.robotshop.com/en/seeedstudio-grove-4-pin-connector.html

                      Here’s a Grove version of HC-SR04 ultrasonic sensor: https://solarbotics.com/product/29062/
                      Also available here: https://www.epictinker.com/Grove-Ultrasonic-Ranger-p/sen10737p.htm
                      And from Jameco: https://www.jameco.com/z/101020010-Seeed-Studios-Grove-Ultrasonic-Ranger-Distance-Sensor_2237845.html

                      Solarbotics.com and Epictinker.com both have a bunch of Grove sensors and cables.

                      RobotShop has over 100 Grove-related products: https://www.robotshop.com/en/catalogsearch/result/?q=grove&order=relevance&dir=desc

                      Robotmesh has even more: https://www.robotmesh.com/catalogsearch/result/?cat=0&q=grove

                      Mouser sells a variety of Grove/Seeed products: https://www.mouser.com/new/seeedstudio/seeed-studio-grove-sensor/
                      So does Digikey.

                      Shannon Hicks
                      Moderator

                        On most of our Mayfly sensor stations, We use the 3.5W panel from Voltaic, and it’ll charge a brand new battery just a few hours in full sun. When you buy a new Lipo, it should already be at least 50% charged, so you won’t be starting from zero. And you should avoid totally discharge a battery because that will damage it and shorten it’s lifespan or kill it entirely. So there should never be a time where you need to charge a fully-depleted Lipo. If this happens often then you need to change your circuit or increase your battery capacity. Our datalogger stations use sleeping routines, sensor switching, and other smart power management tricks to allow them to run for weeks even without sunlight, so on a normal day they need about a half hour of sun to charge the battery after being in the dark overnight.

                        The charge regulator on the Mayfly circuit board has a maximum output of 500mA, so even if you put a large 6-watt panel on the Mayfly, it’s still not going to charge it any faster since you’re limited by the 500mA charge regulator. But in areas with lots of shade, using a large shaded 6-watt panel can give you the same results as using a smaller panel in full sun.

                        The yellow LED on the Mayfly indicates that the battery is actively being charged. Once the battery is fully charged, that LED goes out and there’s no other indication that the battery is full. The Mayfly can sample the input Lipo battery voltage on analog input A6 so you can print it to the serial monitor or write it to the card or whatever. There’s an example sketch on how to do that here: https://envirodiy.org/mayfly/software/battery-measurement/ If you’re needing to know Lipo battery voltages often and when not connected to a Mayfly, then there are small Lipo voltmeters you can get, just be sure to observe polarity since many of them have reversed pins on the JST-2.0 jacks.

                        And yes, the Mayfly will charge your battery even if the power switch is turned off. You can also charge a Lipo battery by connecting the microUSB cable of the Mayfly to your computer or just use a regular phone charger.

                      Viewing 10 posts - 401 through 410 (of 552 total)