Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

DFRobot SEN0244 on Grove Analog AUX

Home Forums Mayfly Data Logger DFRobot SEN0244 on Grove Analog AUX

Viewing 2 reply threads
  • Author
    Posts
    • #14630
      James_NZ
      Participant

      Hi everyone,

      I have been given a pretty elaborate Mayfly station from the University, and I’m trying to attach a couple of sensors that aren’t in the modular sensors library.  One of those sensors is a simple DFRobot TDS SEN0244 https://www.dfrobot.com/product-1662.html.  This comes with some code, that I have tested using an Arduino UNO, and the analog pins on the Mayfly.  However, the way the technician set up the wiring is so that the grove pin is shared with another sensor, and slots into the second AUX Analog connection marked with ‘AA2’ ‘AA3’ ‘V’ ‘Gnd’.

      Can someone tell me if  you can share these connections, i.e. have AA2 coming from one sensor, and AA3 coming from another sensor, and share the VCC and Gnd?  I understand that our technician wanted to be as efficient as possible with the wiring, but It has never occurred to me to share one of these connectors.

      Assuming that is okay, I have the SEN0244 connected to pin AA3.  However, I can’t seem to read the analog value via analogRead(A3).  I have used these grove connectors before when reading LDRs, and they worked fine, but it seems I am doing something wrong this time.  I have also tried using the Adafruit_ADS1015.h library to get raw voltages, but that isn’t working either.  Could someone please have a quick look over my code to see if there is something obvious I am missing?

      Thank you very much for your help.

      Regards,

      James

       

    • #14632
      Shannon Hicks
      Participant

      Because the ADS1115 is a separate chip, you don’t have to declare the ADS1115 input pin numbers as A0, A1, etc. You just call them 0, 1, 2, or 3.

      In your code, you can remove line 8 since you’re declaring an INT that you aren’t actually using anywhere. Or you could keep the line and just change ‘A3’ to ‘3’

      Then in line 26, you can either change ‘A3’ to ‘TDSpin’ or simply ‘3’.

      Assigning the pin number to the INT in line 8 is probably the best practice, and then use “TDSpin” everywhere else so that you can quickly change the number in line 8 to accommodate a sensor input on a different pin.

      It’s fine if you have two different sensor inputs on adjacent Analog Aux pins on the Mayfly Grove port. Just make sure that both sensors are also each directly connected to the ground and Vcc pins.

    • #14651
      James_NZ
      Participant

      Thank you @shicks.

      That set me on the right track.  I think I can figure the rest out from here.

      Just to make sure my understanding is correct, the ADS1115 is included in the Mayfly because it provides more voltage resolution than on standard analog pins, i.e. it allows for finer divisions than 0-1023 bits?

      Thanks for your help.

      James

       

      • #14652
        Shannon Hicks
        Participant

        That’s correct, the main reason the ADS1115 is on the Mayfly is to give you much better resolution on analog measurements (16-bits versus the ATmega1284’s 10-bit ADC). It can also handle a much faster sampling rate and can take differential measurements. The standard ATmega analog inputs are still available for you to use, they’re just only accessible through the 2×10 header socket. The ADS1115 pins are available in two places: the 2×10 header socket and the 2 Grove sockets. Since they’re electrically the same pins, you can’t use more than one of those locations at a time. In your case, the Grove sockets are most convenient, but for anyone using a protoshield or building their own interface board for the Mayfly, then using the headers is more convenient.

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