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

Arduino datalogger only gives data for last connected sensor

Home Forums Other Data Loggers Arduino datalogger only gives data for last connected sensor

Viewing 2 reply threads
  • Author
    Posts
    • #15667
      Erika
      Participant

        Hello,

        I am trying to set up a datalogger for continuous measurements of twelve 5TM moisture sensors. Eventually I want to read this data into LabView to sync with data from some other sensors. For right now I’m just having trouble getting the sensors to read properly.

        I’m currently testing four sensors using the sample code k_concurrent_logger. I’m using a Mega2560 clone with the sensors on an external power source. The code works fine to find all of the sensors’ addresses, but when it takes measurements it will only report the last connected sensor. Any one of the sensors will connect and read individually, it’s just when I connect more than one that it only reports the last one. For example, the serial monitor reads:

        Timeout value:
        -9999
        Scanning all addresses, please wait…
        Protocol Version, Sensor Address, Sensor Vendor, Sensor Model, Sensor Version, Sensor ID
        A, 1.30, DECAGON , 5TM , 400, ,
        B, 1.30, DECAGON , 5TM , 400, ,
        C, 1.30, DECAGON , 5TM , 400, ,
        D, 1.30, DECAGON , 5TM , 400, ,
        Total number of sensors found: 4

        Time Elapsed (s), Address, Measurement 1, Measurement 2, … etc.
        ——————————————————————————-
        12, A, , , , , , , , , , ,
        13, B, , , , , , , , , , ,
        14, C, , , , , , , , , , ,
        15, D, 1.0500001000, 24.9000000000
        26, A, , , , , , , , , , ,
        27, B, , , , , , , , , , ,
        28, C, , , , , , , , , , ,
        29, D, 1.0500001000, 24.9000000000
        40, A, , , , , , , , , , ,
        41, B, , , , , , , , , , ,
        42, C, , , , , , , , , , ,
        43, D, 1.0500001000, 24.9000000000

        I’m fairly new to datalogging and Arduino, so I’m not really sure where to start debugging. Any ideas what might be causing the issue?

        Thanks in advance

      • #15675
        Erika
        Participant

          I noticed in a different example file (I think it was e_continuous_measurement) the getResults function used an “R” command instead of the “D” command and that seemed to fix the problem.

          I changed

          to

          and now it’s getting data from all of the sensors. However, I can’t find an “R” command in the 5TM documentation anywhere. Can anyone tell me what the “R” command does?

        • #15782
          Rick Vogel
          Participant
        Viewing 2 reply threads
        • You must be logged in to reply to this topic.