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

Low Cost EC sensor Station upgrade

Home Forums Mayfly Data Logger Low Cost EC sensor Station upgrade

Viewing 12 reply threads
  • Author
    Posts
    • #14038
      Jim Moore
      Participant

      I currently have six of the subject sensor stations (Photo of GMI_EC2 attached) deployed and logging data to SD cards. I recently setup two of these stations using PlatformIO to load the DRWI_CitSci.ino code with the AtlasScientificEC.h patched in. This library function did not match my hardware which uses the Sensorex probe with the Atlas EZO circuit operating in UART communication mode. I attached a photo of my temporary setup to get the station uploading to MonMW with the EZO circuit set for I2C.

      The mods I need to the Atlas Scientific ModularSensors library are shown in the following code snippets from my arduino IDE code which I am currently using.

      I am not a comp sci major so tweeking the ModularSensor library is way above my pay grade so any help would be appreciated.

      Thanks

    • #14060
      Jim Moore
      Participant

      @srgdamiano I decided to go back to basics with ModularSensors – getting started but took a while to get PCsync to load.  See attached screenshot with the corrections I had to make on the src_dir.

      What is the function of the .pio folder and is it automatically populated when creating a new project?  I had to manually load the .pio/mayfly folder from another project to get PCsync to load.

      I finally got that all working and reporting the time on the serial monitor but when I launched PCsync.exe it responded with “no FTDI found” and I did have the code running in the mayfly and connected to my PC (Windows 10).  Any thoughts where my problem may be?

      Thanks

    • #14062
      Jim Moore
      Participant

      I seem to have “detached” my screen shot

    • #14081
      Jim Moore
      Participant

      Hi Sara @srgdamiano

      I think I have gone as far as I am able on my Low Cost EC sensor project.  I added #include <sensors/ExternalVoltage.h> to the DRWI_CitSci code and registered GMI_test site using new ExternalVoltage_Volt(&extvolt) from the Sensorex RTD votage divider as a proxy for temperature.  I need to apply a simple linear correction (y=mx + b) to have the readings on MonMW in ºC rather than voltage.

      Is there anyway to do this in the main code or do I need a new #include <AtlasSensorex.h> to do the job?

      If so how hard would this be or more to the point could you add this to the ModularSensors library?

      Thanks

      -jim

    • #14082
      Jim Moore
      Participant

      @adamgold  Hi Adam-

      Dave Bressler suggested I contact you for my issues noted above.

      Thanks

      -jim

    • #14083
      Adam Gold
      Participant

      @w3asa

      Hi Jim – To get the linear correction, you should be able to make a calculated variable in .ino file and have that reported to MMW. It looks like there’s no code for calculated variables in the DRWI_CitSci.ino, but it is in the menu_a_la_carte.ino. Hope this helps!

    • #14084
      Jim Moore
      Participant

      @adamgold

      Hi Adam-

      Thanks for getting back to me.  Since my software expertise is limited and I don’t understand how all the code in ModularSensors works I have not been able to get “calculated variable” to compile in my simple_logging.ino code.  I have been successful in getting the code to work with external_voltage and the Atlas EZO circuits (EC and pH).  I attached a screenshot of what works with the calculated variable code commented out.  I suspect my problem has something to do with pointers.

      Your help would be appreciated.  I probably need step by step instructions of if there simple fix to my code that would be great!

      Thanks

      -jim

    • #14095
      Jim Moore
      Participant

      <h4 class=”user-nicename”>@chuckkir</h4>
      Thanks Chuck for offering to help with my coding issues.  I have two sets of code that I am currently testing with my Low Cost Sensor Station.  Simple_logging.ino is working on my mayfly platform which I am using to test the compensation routines to convert the raw data from the AtlasScientific EC sensor and the RTD temperature probe to µS and ºC.

      Here is the code I currently have deployed on GMI_EC1 and GMI_test which is uploading the raw sensor data to MonMW.

       

       

    • #14156
      Jim Moore
      Participant

      @chuckkir

      Thanks Chuck for getting my Sensorex RTD voltage divider output converted to °C.  I plan to leave the EC as the raw value from the AtlasScientific EZO circuit.  Attached is the code addition to DRWI_CitSci.ino to get the Sensorex probe data published to MonMW:

       

    • #14379
      Jim Moore
      Participant

      Hi Sara  @srgdamiano

      I haven’t used PIO for several months but in preparation for the transition from 2G to 4G I launched PIO this week and it apparently did an upgrade and now my code won’t load.

      I get the following error:

      avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

      PIO is currently core 4.3.4 and home 3.2.3

      Any help on this would be appreciated.

      Thanks

    • #14380
      Sara Damiano
      Moderator

      Is your Mayfly turned on and plugged in? That error means your Mayfly isn’t being detected.

    • #14381
      Jim Moore
      Participant

      Thanks.  I am using the FTDI port and wiggled some plugs, etc and now is loading ok.  I assume when I was getting that error the mayfly was plugged in and turned on because when I attempt to load with the pwr switch turned off I get the following error:

      Uploading .pio\build\mayfly\firmware.hex
      avrdude: ser_open(): can’t open device “\\.\COM4”: Access is denied.
      avrdude done.  Thank you.
      *** [upload] Error 1
      I guess a bad connection somewhere.
    • #14382
      Sara Damiano
      Moderator

      The access is denied error doesn’t mean the Mayfly is off, it means something else (another program or window on your computer) is monopolizing that serial port. Usually you see it when you try to upload a program or start a serial port monitor when another serial port monitor was already running.

      If you have the Mayfly plugged directly into the USB of your computer and the Mayfly is off, the error is more to the effect that the serial port doesn’t exist, not access is denied. If you’re using something like an ftdi friend between the Mayfly and your computer, you’ll see avrdude sync errors if the Mayfly is off.

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