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

Sara Damiano

Forum Replies Created

Viewing 10 posts - 441 through 450 (of 460 total)
  • Author
    Posts
  • in reply to: Wiring Ultrasonic sensor w/ temp compensator #2353
    Sara Damiano
    Moderator

      I’m sorry for the library download trouble! How are you trying to download them? The easiest way is to get all the libraries for the Arduino IDE is pull them all together from the libraries repo: https://github.com/EnviroDIY/Libraries. If you scroll down, there are instructions for the Arduino IDE and PlatformIO. This will probably pull in some other libraries that you aren’t interested in, but they’re very small files so it shouldn’t be a problem.

      in reply to: Reposting: Library extension "Mod" #2325
      Sara Damiano
      Moderator

        If you don’t want to be limited as to which pin each library can control, you can set the pin change interrupt as “master” and use a different version of software serial that has been stripped of all interrupt register control: https://github.com/EnviroDIY/SoftwareSerial_ExternalInts.

        You could also use AltSoftSerial instead of SoftwareSerial because it doesn’t need interrupts. It can only be used with pin D6 as the receiver and D5 as the transmitter. You cannot use pin D4 if using AltSoftSerial.

        To use AltSoftSerial with a Mayfly or Mbili you must add these lines to the top of your sketch:

        in reply to: Reposting: Library extension "Mod" #2324
        Sara Damiano
        Moderator

          If you’ve downloaded the libraries from https://github.com/EnviroDIY/Libraries, then you should be able to fix it by replacing (in your sketch, not in the library) every instance of “SoftwareSerialMod” with “SoftwareSerial_PCINT12” and “Sodaq_PcInt_Mod” with “Sodaq_PcInt_PCINT0”.

          Essentially, what happened is that these libraries all conflict with each other because each tries to monopolize all of the interrupt control registers within the processor chip. The processor in the Mayfly has 4 grouped interrupt registers (vectors 0-3 or A-D) which control interrupts on 8 pins each. Several years ago, Shannon made modified versions of the Software Serial and PcInt (and SDI12) libraries to force each to only work with a specific interrupt vector (instead of each trying to use all 4). At that point, she added the “mod” to each library name to note that it had been modified. As you noticed, sometime after she wrote the examples, I renamed those libraries from “mod” to “PCINT#” to specify which of the interrupt vectors each library had been modified to control.

          Because the modified versions do only have control of specific interrupt vectors (instead of all of them) you have to be careful which pins you try to use with each library:
          – Sodaq_PcInt_PCINT0 only works on vector A/0, so you can only assign interrupts to pins D24-D31 (aka A0-A7) using that library. If you’re only using this to assign a wake-up interrupt from the clock, which is attached at A7, that’s fine.
          – SoftwareSerial_PCINT12 only works on vector B/1 & C/2, so you can only fake a serial input/output on pins D8-D23. The way the pins on the Mayfly are routed, the only pins exposed in a grove jack for SoftwareSerial_PCINT12 are D10&D11. The Mayfly does have two hardware serial ports (which are always superior to a software serial port imitation) but these are taken up by the communication with the FTDI chip (ie, the communication with the USB) and the communication with the “Bee” socket.
          – SDI12_PCINT3 only works on vector D/3, so you can only use it on pins D0-D7.

          in reply to: Interrupt #2280
          Sara Damiano
          Moderator

            You should also be able to use pin-change interrupts for the tipping bucket, which would allow you to use any pin at all. Using pin change interrupts requires an extra library, though. I’m a fan of GreyGnome’s EnableInterrupt library, which I’ve modified to have all the right pin numbers for the Mayfly: https://github.com/EnviroDIY/EnableInterrupt

            The external interrupts do have priority over pin-change interrupts, but I don’t imagine the bucket would tip so fast that you’d have any problems, especially when your ISR is just a count.

            All pin change interrupt libraries also conflict with the interrupts defined by SoftwareSerial and the SDI-12 library, although there are fairly easy work-arounds for those if you need them.

            in reply to: Wiring Ultrasonic sensor w/ temp compensator #2279
            Sara Damiano
            Moderator

              The red cable from the MaxTemp goes to pin 1 on the MaxSonar. The shield (yellow) and black cables from the MaxTemp both go to pin 7 on the MaxSonar. Pin 7 on the MaxSonar is also connected to ground (black) from the grove, so you’ll be shoving three wires into the MaxSonar screw terminal at Pin 7. Pin 6 on the MaxSonar goes to Vcc (red on the grove). Pin 5 on the MaxSonar goes to D2/white on the grove, if you want to use pin 5 on the Mayfly to receive data.

              In your data sketch, you then need to set up an instance of SoftwareSerial with the Rx set as pin 5. Then you want to use the parseInt() function to capture the data from the MaxSonar. (But throw away the first 6 lines from the MaxSonar after power-up, because it sends out a header before sending out data.) There’s an example sketch here: https://github.com/EnviroDIY/EnviroDIY_Mayfly_Logger/blob/master/examples/mayfly_sonar/mayfly_sonar.ino

              You can also use the ModularSensors library (https://github.com/EnviroDIY/ModularSensors) with the MaxSonar, if you’d prefer.

              in reply to: Problem downloading Mayfly libraries #2234
              Sara Damiano
              Moderator

                I tried to re-word the instructions on GitHub a little and get the link to the zip right so maybe it’s a little less confusing.

                in reply to: Problem downloading Mayfly libraries #2233
                Sara Damiano
                Moderator

                  I’m sorry for the hassle. You also cannot use the Arduino IDE’s library manager to directly import the libraries; using “add zip library…” won’t work. You have to follow the longer instructions for manual installation because there are multiple libraries in the same zip. That is, you have to extract (unzip) the libraries.zip file into another folder on you computer and then copy all of the sub-folders into “..\<you>\DOCUMENTS\Arduino\libraries” or where ever your sketchbook libraries are stored on your computer.

                  in reply to: Recording data from pressure sensors on an SD card #2190
                  Sara Damiano
                  Moderator

                    If you would like your sensors added to the ModularSensors library, please create an issue for them there!

                    in reply to: inconsistent Results #2178
                    Sara Damiano
                    Moderator

                      Please, like Shannon suggested, copy in your actual code using the “Add Code Snippet” button and actually attach your raw data, not a picture of it. Also, like Shannon said, please plot your EA and temperature to see how they look. And, again, like Shannon said, explain:

                      How were you testing the sensor? Was is installed outside or in a controlled environment? What kind of results were you expecting and what makes you think something is inconsistent?

                      in reply to: Setting the real time clock #2171
                      Sara Damiano
                      Moderator

                        I got and accepted your pull request. The fix is in the library now.

                      Viewing 10 posts - 441 through 450 (of 460 total)