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

Board Basics

Home Forums Mayfly Data Logger Board Basics

Viewing 6 reply threads
  • Author
    Posts
    • #14931
      matt
      Participant

        I am learning to use this board and so far found the basic documentation not basic enough. For one example, the 20 analog pins and 20 digital pins have labels but not any information explaining what they mean or how to read or write to each one in the code. Since the goal is to get more people using these and contribute to watershed data, even a couple of pages of descriptions of what you can do with this board and how to go about it could be really helpful and accelerate the learning curve. I spent a while looking for how to increase the voltage to 5v. For my eyes I couldn’t find that anywhere although the board schematic may have that info. It’s only by stumbling on code on github that I find answers to the most basic questions.

      • #14932
        Matt Barney
        Participant

          I can recommend the Mayfly Hardware page, along with the Features and Jumper Settings links found there.

          As far as reading and writing to the various pins in code, I’d suggest the Mayfly Software page, and particularly the LearnEnviroDIY link there, which is a series of detailed tutorials to get you started.

          Good luck,

          Matt

        • #14933
          matt
          Participant

            I have looked through those sources and while I may have missed something in the LearnEnviroDIY link. Nothing answers my above question in a language I could understand.

          • #14934
            fisherba
            Participant

              Hi Matt,

              Glad to see you are getting started with Ardino-framework monitoring. The LearnEnviroDIY link walks you through tutorials starting with the most basic ones offered by Adafruit and other sources online. Then it targets what users will need for monitoring, where the crux is often learning how to manage libraries and how to use the Modular Sensors code wrapper for coding many operations that are cooperative and efficient for monitoring. The tutorial is designed to walk you through from 0 to 100, and depending on your prior experience with coding, code editors, and managing Arduino libraries, some users may not need to do the tutorial in sequence.

              Your question about 3.3 vs 5 v power is highlighted on the first image in the first lesson of the LearnEnviroDIY tutorial. We did not detail the “how to increase voltage” because it’s a hardware toggle and it depends on the sensor. The sensors we use in the tutorial are all 3.3v, and users will consult the Modular Sensors wiki to determine their sensor/wiring needs for testing/deploying sensors. In short, there are several physical toggles on the Mayfly to switch the power assigned to each port. If you have a Mayfly in your hand you can see the labels on each of these toggles. Where to connect your sensor depends on communication protocol for the sensor, and LearnEnviroDIY touches on this in a few places, starting at Episode 6. We discuss OneWire and I2C in the tutorial Episode 6.

              If you want to know more about the sensors already available in Modular Sensors and their wire/pin associations, check out he wiki: https://envirodiy.github.io/ModularSensors/index.html#mainpage_supported_sensors

              The details of the hardware of the Mayfly are outlined here: https://www.envirodiy.org/mayfly/hardware/features/. Learning what the pin labels mean, if I understand the question, is something that people pick up when they do the Adafruit and other tutorials, though I haven’t had a student ask yet. In general D1, D2, etc are digital pins. Tx is transmit. Rx is receive. A is analog. GND is ground. 3V3 is 3.3 volts. Sw is switched power (I think).

              If these resources are not “in a language you understand” I recommend staring at the beginning of the EnviroDIY tutorial, and especially thoroughly consume the resources that we link from Adafruit, because we intentionally did not attempt to re-create the tutorial content that they have.

              Similar to doing your own home repairs, doing DIY monitoring isn’t a quick and easy thing. I personally spent several months getting up to speed before I recognized the need to create the tutorial, in hopes of helping others who are non-codes learn the ways of DIY monitoring.

              Beth

              • #14937
                matt
                Participant

                  Beth, in your third to last paragraph of your first post you started to touch on what I’m trying to understand. For example I am using pins D7, D11, D21, and I can refer to them in the code as 7, 11, 21 in basic sketches. But what does scl, sda, on the digital side, or AA1, AA3, etc on the analog side mean and how do I refer to those pins in the code. It sounds like you are saying you will learn what those are as they are used in some tutorials that you find online. There is without a doubt a wealth of information online that continues to broaden my understanding of the subject but that is a tedious way to get answers to specific problems or questions. I was hoping to find more board specific information, like info about working with the 5v booster needed for the HC-SR04 sensor. It seems like you learn about the board through learning about programing vs a more explicit diagram.

              • #14935
                fisherba
                Participant

                  P.S. I took a random pin label and google searched it. My search was “A1 arduino” and it turned up plain language content in the Arduino Foundations class that would lead you to know that this is an analog input pin. That class could be another good starting point, but we picked the Adafruit tutorials because they more quickly lead us through the principles that users needed to be prepared to use PlatformIO or VSCode to manage Modular Sensors code wrappers.

                  I am aware that many people think that PlatformIO is too much for beginners. I fully understand how not simple these IDEs are if you are not a coder. I avoided using PlatformIO for at least a year after starting my monitoring work. I invite anyone who believes that PlatformIO is “too much” to go read “The lib_deps talk” in Episode 5. The nutshell version is that we are working with actively changing software with this monitoring work, both in Modular Sensors and with many of the Arduino-framework sensors. If you are managing libraries manually, then you’ve got a lot of manual upkeep in your future if you stick with the Arduino IDE. You will need to download all of the code libraries (like software drivers) manually and keep them in a very specifically located and perfectly named directory. Keeping track of updates to libraries will be a manual task.

                  In contrast, keeping track of libraries using PlatformIO (or VSCode) allows the user to make a list of the libraries that are being used in an “initialization” (ini) file. This central place allows you to keep track of your libraries and their versions in a simple list in the ini file (most of the time you want to stay up to date, sometimes you will need to point to specific, older version).

                  What’s super awesome about “lib_deps” in PlatformIO is that the amazing developer of Modular Sensors has the libraries collected for you, which requires one line of code in the ini file and no manual downloading effort on your part. For each round of revisions she lets you know what other content you need in your ini file and includes an ini file with each example sketch.

                  If it doesn’t make sense to use the functionality of PlatformIO for the scope of your work, then that’s fine. But when you start spending more time managing libraries than testing sensors, it’s time to learn the joys of running it all from a simple ini file!

                  Beth

                • #14938
                  fisherba
                  Participant

                    Hi Matt,

                    SDA is a data line. SCL is a clock line. Both are for the Wire library, which is an I2C protocol. These things you could find with a google search of “SCL arduino”. None of these labels are specific to the Mayfly, but they are Arduino basics.

                    AA is auxiliary analog, found that in the Mayfly Data Logger Features (I’ve personally never had to know what’s different about AA than the other analog ports, because I haven’t used an analog sensor in several years of data logging):

                    EnviroDIY Monitoring Station Manual

                    The thing is, there’s a huge knowledge base for all of this stuff online and I’m just doing my best to direct you to it. It’s finals week at my institution, and most of the people on these forums are volunteering their time, so it’s also tedious to answer questions that you’ve spent weeks building into a curriculum.

                    Beth

                  • #14939
                    fisherba
                    Participant

                      This might also be a good resource.

                      https://github.com/EnviroDIY/EnviroDIY_Mayfly_Logger

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