Connecting an Atlas Scientific Conductivity K 1.0 sensor to an Arduino.
First of all, let me just say that I adore the packaging of the EZO conductivity and power isolation circuit boards.
They were a lot smaller than I expected, which is a nice surprise, as it’ll mean a smaller end product once I’ve packaged them all into a box.
The EZO Conductivity Circuit Datasheet is more like a getting started guide, so I followed that first.
Finding a spare breadboard, I wired the EZO board to the voltage isolator (which is optional so that any other devices don’t interfere with the conductivity sensor), and then to an Arduino Mega. I thought it better to test it with a plain Arduino before migrating over to The Things Uno, as I haven’t looked into whether the standard serial pins are still usable or not.
With everything connected I uploaded the sample code to the Arduino, opened the serial monitor and out came my first data!
EC:0.00 TDS: SAL: GRAV:
Noticing that the TDS (total dissolved solids), SAL (salinity) and GRAV (specific gravity) values were all blank, I followed the guide a little longer to see that they’re all off by default. Setting these to return values is as simple as sending the following commands via the Arduino IDE serial monitor:
// Turn on TDS (capital letter O, capital letters TDS, number 1, separated by commas) O,TDS,1 // Turn on SAL O,S,1 // Turn on GRAV O,SG,1
Once you send a command you should see the return value: *OK
Then the output will look more like this:
EC:0.00 TDS:0 SAL:0.00 GRAV:1.000
Next step is to calibrate the sensor for dry air. To do this, send the command using the Arduino IDE serial monitor:
The other calibration steps you can do are to check against the supplied samples. My samples are 12,880 uS/cm and 80,000 uS/cm which can be set to low and high calibration settings using the commands:
// Put the sensor in the 12,880 sample, and then send the command: Cal,low,12880 EC:13580 TDS:7336 SAL:7.83 GRAV:1.007 *OK EC:13580 TDS:7337 SAL:7.83 GRAV:1.007 // Put the sensor in the 80,000 sample, and then send the command: Cal,high,80000 EC:82530 TDS:44569 SAL:42.00 GRAV:1.041 *OK EC:79990 TDS:43195 SAL:42.00 GRAV:1.040
To save the calibration from your device, send:
// Send the export calibration command Export // My response EC:53D44200803F // If ever you need to import it again, simply type Import
Now we’re ready for our first water quality sample! I poured a glass of Port Willunga tap water in the 80’s cottage I was staying at, and it gave these values:
EC:601.2 TDS:325 SAL:0.29 GRAV:1.000 EC:602.0 TDS:325 SAL:0.29 GRAV:1.000 EC:602.6 TDS:325 SAL:0.29 GRAV:1.000 EC:602.8 TDS:326 SAL:0.29 GRAV:1.000 EC:603.4 TDS:326 SAL:0.29 GRAV:1.000 EC:603.8 TDS:326 SAL:0.29 GRAV:1.000 EC:604.0 TDS:326 SAL:0.29 GRAV:1.000 EC:604.4 TDS:326 SAL:0.29 GRAV:1.000 EC:604.3 TDS:326 SAL:0.29 GRAV:1.000
So it works! But what do those values mean and how do they compare to reported averages?
From page 56 of this 2013/14 SA Water drinking quality report, here are some water quality Total Dissolved Solids figures from areas nearby in mg/L (which is the same as ppm reported by the sensor):
|Town||Min TDS||Max TDS||Ave TDS|
|Myponga||320 mg/L||410 mg/L||353 mg/L|
|Mount Compass||120 mg/L||260 mg/L||172 mg/L|
Port Willunga’s average that I read of 326 mg/L (only a few readings on one day) sits towards the Myponga end of those two readings, which seems to validate the data I just read.
Just out of interest, on page 54 of that report, the “Aesthetic guideline” for water TDS is less than or equal to 600 mg/L. So I think that’s a safe upper limit to compare against for drinking water.
Update: I found that the SA Water “what’s in your water” search returned this 2018 data from South Metro: Average 290 mg/L. So that’s in the same ballpark too which is nice.
Next step is to get it working with I2C on The Things Uno, so that I can push the data to their network.
I might also build a quick iOS Bluetooth app and plug it into my Red Bear BLE Nano so that I can send data to my phone too.
Update: Today I tested some salt water from the beach at Port Willunga 2nd Jan 2019:
-- SENSOR READING EC:51291 TDS:27697 SAL:33.69 GRAV:1.026 -- SENSOR READING EC:51341 TDS:27724 SAL:33.73 GRAV:1.026 -- SENSOR READING EC:51381 TDS:27750 SAL:33.76 GRAV:1.026 -- SENSOR READING EC:51431 TDS:27775 SAL:33.79 GRAV:1.026 -- SENSOR READING EC:51481 TDS:27799 SAL:33.83 GRAV:1.026 -- SENSOR READING EC:51501 TDS:27814 SAL:33.85 GRAV:1.026 -- SENSOR READING EC:51521 TDS:27826 SAL:33.86 GRAV:1.026 -- SENSOR READING EC:51561 TDS:27843 SAL:33.89 GRAV:1.026 -- SENSOR READING EC:51581 TDS:27857 SAL:33.91 GRAV:1.026 -- SENSOR READING EC:51631 TDS:27881 SAL:33.94 GRAV:1.026
And an average reading from the Adelaide CBD:
// Tap water at an apartment block 2nd Jan 2019 EC:600.4 TDS:324 SAL:0.29 GRAV:1.000 // Tap water at a second apartment block 4th Jan 2019 EC:556.3 TDS:300 SAL:0.27 GRAV:1.000 // Pura tap (2 year old filter) EC:567.7 TDS:307 SAL:0.28 GRAV:1.000 // Pura tap (6 month old filter) EC:530.5 TDS:286 SAL:0.26 GRAV:1.000
An average reading from Saint Kilda East in Melbourne:
// Tap water from St Kilda East 6th Jan 2019 EC:61.37 TDS:33 SAL:0.00 GRAV:1.000 // Rain water from St Kilda East 6th Jan 2019 EC:38.91 TDS:21 SAL:0.00 GRAV:1.000
An average reading from a Melbourne CBD apartment (top of the CBD):
// Tap water from Melbourne CBD apartment 10th Jan 2019 EC:117.9 TDS:64 SAL:0.00 GRAV:1.000
// Tap water from a Southbank apartment 2nd Feb 2020 EC:80.1 TDS:43 SAL:0.00 GRAV:1.000
// Neverfail spring water (box) EC:211.6 TDS:114 SAL:0.10 GRAV:1.000 // Mount Franklin spring water (600mL bottle) EC:162.9 TDS:88 SAL:0.00 GRAV:1.000 // Cool Ridge spring water (600mL bottle) EC:79.76 TDS:43 SAL:0.00 GRAV:1.000