Forum Replies Created
-
AuthorPosts
-
The calibration sheet from Turner was very accurate for the new sensor, so if you don’t want to buy expensive rhodamine standard right now, you’re probably fine to use the data from the sheet. But we’ve found that the sensors tend to drift over time so we do quarterly recalibrations of the sensors to make sure they’re still accurate.
Here’s a simple sketch to take 100 analog readings quickly and average them, then constantly repeat that, and printing all data to the serial port. Then I just copy/paste the text from the serial port into Excel so I can do an analysis and overall average.
Arduino123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778//Takes lots of readings from the EnviroDIY Mayfly's ADS1115 Aux Analog ADC and averages them, prints to screen#include <SPI.h>#include <Wire.h>#include <Adafruit_ADS1015.h>Adafruit_ADS1115 ads; // The Mayfly's ADS1115 Aux ADC is 16-bit versionfloat average_volts; //variable to hold the calculated averageint State8 = LOW;int State9 = LOW;int aux_channel = 0; //channel number of whatever pin you've got your input connected to for the ADS1115 Aux Analog chip (AA0 = 0, AA1 = 1, AA2 = 2, AA3 = 3)int readcount = 100; //the number of readings you want to take for each sampleint time_between_readings = 10; //number of milliseconds between each reading in a samplevoid setup(){Serial.begin(57600); //Start the serial connection with the computerads.begin(); //begin adafruit ADS1015pinMode(8, OUTPUT); // define the red and green LEDs as outputspinMode(9, OUTPUT);digitalWrite(8, HIGH); //turn on one of the LEDs to start withdigitalWrite(9, LOW);pinMode(22, OUTPUT); //switched power pin declared as outputdigitalWrite(22, HIGH); //turn on the Switched sensor voltageSerial.println("EnviroDIY Mayfly Aux-Analog Averaging Sketch ");Serial.print("Aux ADC Channel: ");Serial.print(aux_channel); Serial.print("(AA"); Serial.print(aux_channel);Serial.print(") Number of readings per sample: ");Serial.println(readcount);Serial.println("-------------------------------------------------------------");delay(2000); //wait 2 seconds}void loop(){auxanalog_sample(); //go take a measurement with the ADS1115//blink the red and green LEDs in alternating fashion on each loopif (State8 == LOW) {State8 = HIGH;} else {State8 = LOW;}digitalWrite(8, State8);State9 = !State8;digitalWrite(9, State9);// Serial.print("Averaged analog voltage (volts): "); //print the results to the serial monitorSerial.println(average_volts,5);delay(100); //wait a little bit between loops, adjust as you want} //end loopvoid auxanalog_sample() // function that takes reading from ADS1115 Aux Analog chip on Mayfly{int16_t adc_bits = 0; //int to hold the value of the bits that get readfloat bit_sum = 0.0; //sum of all the bits readfor (int i = 0; i < readcount; i++){adc_bits = ads.readADC_SingleEnded(aux_channel); //take a single-ended reading with the ADS1115bit_sum += adc_bits; //add the latest reading to the sumdelay(time_between_readings); //wait x milliseconds between readings, adjust as you want}float average_bits = bit_sum / readcount; //find the average by dividing the bit_sum by readcount//now convert bits into volts//average_volts = (average_bits * 3.3)/17585.0;// use this next line instead of the previous line if you're using a voltage divider to reduce an external sensor's voltageaverage_volts = ((average_bits * 3.3)/17585.0) * 2.0; //multiply by 2 if you used a 50/50 divider}Both of those sensor models ship from their manufacturers with their SDI12 address set to ‘0’ (zero). In order for the Hydros21 sensor to work with the Mayfly logger in SDI12 mode, you MUST change the address of the sensor to anything other than zero (otherwise the sensors is in TTL output and not SDI12). It’s okay for the ClariVue sensor to remain at channel 0, but your logging sketch should agree with whatever you’ve set it to, and your sketch says 2, so you’ll need to use the address-changing sketch to set the channels. Note that you can’t connect both new sensors at the same time when setting the channel. Only connect one sensor to the Mayfly when doing the address changing procedure. Once you’ve got one sensor connected, the sketch will cycle though all 62 possible channels. If it’s not stopping on zero (or maybe another channel if you’ve been able to successfully change the channel earlier), then that means your logger doesn’t hear anything from the sensor. If that’s the case, then your wiring to the Mayfly may be wrong or something else. Are you supplying 12v to the ClariVue sensor using a screw terminal board (either directly from the Mayfly’s onboard 12v option or the external 12-v boost screw terminal board)? The Hydros21 works fine at 3.3v or 5v or 12v. If you’re using the 3.5mm stereo plug option, make sure it’s plugged firmly into the jack on the Grove adapter board. If you’re using bare wires, make sure you’ve got the 3 wires from the sensor connected to the proper screw terminals (Ground, V+, and S2).
I assume you are using a Mayfly v1.1 board and not an older v1.0, because it had a hard time providing a stable 12v for that particular type of sensor. But are you using the onboard 12v source by selecting 12v on the Grove voltage selector jumper, or are you using one of the new screw terminal boards that has its own 12v boost circuit on it? And have you put a voltmeter on the power wires going to the sensor when it’s on to verify that it’s receiving 12volts?
That all looks correct. I usually put the Mayfly’s analog Grove jack voltage selector jumper to the 5v position because the old sensors required 5v for excitation, but supposedly these newer ones are happy with 3v to 15v, but we still use them at 5v and calibrate them with that excitation voltage. If you connect the 6-pin screw terminal board shown in your photo to the Mayfly’s upper aux analog jack (AA0-AA1), then your sensor will be connected to the A0 pin, so make sure that’s what you’ve entered on the line of your sketch that looks like this:
const int8_t cyclopsChloroADSChannel = 0; // ADS channel
We’ve only used the C-FLUOR sensors for phycocyanin but I would assume their operation and performance would be the same for the chlorophyll model. Which one are you using? The ModularSensors library for the Cyclops sensors assumes you’ll be entering the two voltages of the sensor output (blanking voltage and standard concentration voltage), and the concentration of the standard. So for my station, it looks like this:
Arduino123456// Cyclops calibration informationconst float cyclopsChloroStdConc = 40.000; // Concentration of the standard used// for a 1-point sensor calibration.const float cyclopsChloroStdVolt = 1.155488; // The voltage (in volts) measured for the conc_std.const float cyclopsChloroBlankVolt = 0.020348; // The voltage (in volts) measured for a blank.These voltages were obtained by placing the sensor (with power applied) in nanopure water (or distilled if that’s all you’ve got) in a large dark contained (a black opaque 1-liter bottle) and measuring the output voltage of the sensor. Then we repeat it with 1 liter of the standard (the Rhodamine standard purchased from Turner). If you’re measuring the voltage with an external voltmeter, remember that you’ll need to divide the voltmeter voltage by 2 because you’ve got that resistor-divider circuit on your screw terminal board. So if you put the sensor in the standard and get 2.2 volts, you would then enter 1.1 volts into the sketch. Same thing for the blanking voltage (although it’s usually a really small number closer to zero.) We usually measure the voltage out to 5 decimal places using the Mayfly to measure the analog voltage 100 times (20 milliseconds apart) and take an average, then do that at least 50 more times, and take an average of all those measurements.
If you’ll be entering the data from the sensor’s calibration sheet instead, you’ll need to enter blanking voltage from the sheet (again, dividing by 2 because of the res-div). So let’s pretend the datasheet says the blanking offset is 0.02 volts, so divide that by 2 and get 0.01. And then the sheet gives you the calibration coefficient as ppb per volt (parts per billion per volt). So pretend a sensor’s datasheet said 1035.4234 ppb/v. So you could enter that number in the concentration line and 0.5v for the voltage (because that’s half of one volt), like this:
Arduino1234const float cyclopsPhycoStdConc = 1035.4234; // Concentration of the standard used// for a 1-point sensor calibration.const float cyclopsPhycoStdVolt = 0.5; // The voltage (in volts) measured for the conc_std.const float cyclopsPhycoBlankVolt = 0.01; // The voltage (in volts) measured for a blank.The file is there. Is your computer behind a firewall that is blocking github? What happens if you click on the link for the EnviroDIY json file? You should see a simple text webpage with some code talking about packages and platforms.
2024-10-29 at 4:19 PM in reply to: Inconsistent and erroneous analog differential measurements #18713Can you email me your code at mayfly@envirodiy.org so I can take a look at it? How many other adafruit ADC boards do you have attached to the Mayfly in question and are they the 12-bit or 16-bit versions? The Mayfly’s ADC is permanently set to 0x48. What is the typical and maximum voltages you should see on the sensor?
The two sensor models perform exactly the same. We’ve used a couple in the field with existing loggers when replacing some old broken Cyclops 7f sensors. All we did was swap the sensors and redo the calibration and edit the appropriate 2 lines in the code for the voltage measured in the standard and the blank (nanopure water). The C-FLUOR sensors do come with a calibration voltage on a datasheet in the package, but we prefer to do our own, plus we recalibrate them in the field periodically once deployed. We use a rhodamine standard we purchased from Turner. So you can just use the existing ModularSensors Turner Cyclops library. Keep in mind that the sensors output a 0-5v analog signal, so you’ll need to use a resistor-divider to read them properly with a Mayfly logger. Our new multipurpose screw terminal board has that option if you add your own resistors and change the solder jumpers on the back of the board.
Can you email me the entire .ino sketch that you’re using with the board, and also a clear, in-focus photo of the back of the Mayfly board, and the front of the Mayfly board, with and without the LTEbee attached.
Everyone has been out of stock of that particular battery for the past 6 months. As you said, you can use the Adafruit 6600mAh pack (https://www.digikey.com/en/products/detail/adafruit-industries-llc/353/5054549), or you can use the single-cell 2200mAh cell (https://www.digikey.com/en/products/detail/adafruit-industries-llc/1781/5054543). As long as the pack is 3.7v nominal and has the correct polarization of the red and black wires on the JST-PH connector, it’ll work. We recommend using packs from Adafruit or Sparkfun because they always have the right polarity. Using packs from other sources will usually have the connector pins backwards, which will result in catastrophic damage to the Mayfly board if it gets plugged in.
We ordered a couple of these modules and they arrived a few days ago. I did some testing the past couple days and had only occasional success at sending data to MMW with them. We’re thinking the code libraries probably need to be tweaked to work with these new modules, but there’s no usable electrical or software documentation for these particular modules from Digi at this time, so we’ve got limited info to work with. We also used one of our standard Hologram SIM cards and the module would only connect to either T-Mobile or AT&T, so you might need to have a different carrier’s SIM card if you want to get these to work with Verizon.
-
AuthorPosts