Public Lab Research note


Turbidity sensor prototype

by donblair | November 01, 2015 05:41 01 Nov 05:41 | #12350 | #12350

Surrounded by friends who were putting together Dracula, Zombie, and etc equipment, I decided to: work on turbidity!

Background

In conversations with folks who monitor turbidity, I'd gotten the impression that it's a difficult measurement to standardize / keep calibrated in the field -- also, there are quite a few ways of measuring turbidity out there, with different associated units.

But for many applications, what we're interested in is not an absolute measure of turbidity, suitable for comparison across locations -- what we really want to know is the trend -- has the water suddenly become much more turbid (due to a dumping event, or a storm -- etc)?

For these 'sudden changes from baseline' measurements, we might be able to get away with a very simple design ... let's see!

Setup

Because we've been playing around with putting sensors in water bottles, I wanted to see: what's the simplest, easiest-to-assemble approach for monitoring changes in turbidity? Here's the idea:

IMG_20151102_150636785.jpg

What if we just put a light sensor right up against the inside of the water bottle, looking out into the water ... and placed an LED right up against the inside of the water bottle, shining into the water?

The expectation: the amount of light reflected back from the water should change if there is an increase in the amount of stuff suspended in the water.

To test this idea, I used a $10 light sensor from Adafruit:

tsl2591.jpg

It has two channels -- one 'full spectrum' channel ("CH0") that is sensitive to a wide range of wavelengths, including a bunch of visible light and some near-IR -- as well as an 'IR-only' channel ("CH1") that is mostly sensitive up in the red / near-infrared region

Here's the light detector's response curve (from the datasheet (with the channels labeled), showing how sensitive it is to various wavelengths:

responsivity.png

I tried to make a little 'baffle' so that the light emitted by the LED wouldn't go directly into the light detector ...

IMG_20151031_192501791_HDR.jpg

... but it got pretty smooshed when inside the bottle, so probably didn't do much as a baffle (better design next round!):

IMG_20151031_192600764.jpg

Because folks have already determined that near-infrared light often has more useful scattering properties for assessing turbidity, my first thought was to use an IR LED and the IR channel of this detector. I gave this a go, but with only one IR led of unknown wavelength, I wasn't able to get a reasonable signal on the detector. I'll give this a go with LEDs of known wavelength, later.

So for this run, I just picked a random 'white' LED from a box at hand (not sure what the actual spectral output of the LED is -- that's another thing to get right next time!), and used the following prototcol:

  • Turn the LED on
  • Measure the light level
  • Turn the LED off
  • Measure the light level
  • Repeat!

The rationale: changes to ambient light (light not coming from the LED) over time might make it hard to assess changes in turbidity ... but if we always look at the difference between measuring-with-the-LED-on and measuring-with-the-LED-off, maybe that difference will be more robust to changes in ambient light.

I put the half-water bottle I was using as a test rig into a glass of water, and just played around with adding different amounts of coffee-with-creamer to the solution. This is what the protocol looked like:

In order to simulate conditions underwater (and perhaps the addition of an external enclosure that would shield from ambient light), I placed the entire setup under a relatively opaque recycling bin:

t2.png

I then ran this "ON/OFF" protocol for a while for several 'turbidity' preparations -- i.e., I made a measurement, removed the recycling bin shroud, added some coffee, made another measurement, repeated ...

Here's what the sample preparations looked like (I labeled them 'a', 'b', 'c', etc):

turbiditySamples.png

Results

The raw data I collected is in the first two columns (A: 'index', B: 'lux'), here:

https://docs.google.com/spreadsheets/d/1LOKQlfaRRVGEd4b5-_a1dDo8b4amicLkzn9PnjPZoRo/edit?usp=sharing

The raw data (including the measurements made when I was removing the recycling bin shroud in order to add more coffee) is here:

raw-lux.png

Once I removed the datapoints associated with the 'recycling bin transition' measurements, and simply focus on the times that the sensor was underneath the recycling bin, here's what I get:

lux.png

I labeled the "LED ON" and "LED OFF" parts of the light measurements, and also used labels so you can see which measurements are associated with which turbidity preparations ('a', 'b', 'c') in the photo above.

Pretty cool! I notice two trends:

  • as the water becomes more turbid, there is more light reflected back when the LED i son (as expected!)
  • as the water becomes more turbid, there is less ambient light being measured (the recycling bin wasn't completely opaque, so the sensor is picking up light from the room, transmitted through the turbid water, and into the bottle

At this point, it looks like we might have a pretty good indicator of changes in turbidity -- as the turbidity increases, we just look to see what the difference is between the LED-on and LED-off measurements ... neat!

Next steps

  • Need to see how this affected by changes in ambient light. It may be the case that we could simply 'normalize' the difference between LED-on and LED-off by e.g. dividing that difference by the LED-off value (the ambient measurement) -- or some more complicated function -- and not really need to use an external baffle. This would be nice, in that we wouldn't need to complicate the currently simple enclosure design -- just put the light sensor and emitter inside the bottle with some adhesive, and done! (But need to check to see if this'll work ...)

  • It might be important to check the effect of e.g. temperature on the light sensor's sensitivity. The datasheet indicates that the effect isn't enormous, but it could still be significant:

temp_response.png

e.g. we might want to normalize the measurements by some function of the temperature, if it's a significant effect.

  • try more IR leds of known wavelength!

  • It'd be nice to come up with a simple PCB mount that holds the Adafruit sensor, an LED or two, and positions a baffle of sorts in between them ... perhaps this could be combined with the conductivity + temp sensor board, to get temp + conductivity + turbidity all-in-one ...

Fun!


I did this Help out by offering feedback!


People who did this (0)

None yet. Be the first to post one!


7 Comments

real clever thinking!

Reply to this comment...


This looks very promising.

There are a couple of controls that might add a lot to the interpretability of your tests. 1) With the water bottle in air instead of in the beaker of coffee water. So clean air should not scatter any light back to the detector. 2) As above and with the outside of the water bottle covered in black tape or black felt. So no LED light should be able to reach the sensor. This tests if the sensor picks up electronic noise or maybe light leaking through the baffle or light travelling laterally through the clear plastic of the water bottle.

How much will the color of the turbid suspended sediment influence the readings? Will whitish silt give similar readings to dark organic suspended soil? Will green algal blooms register the same as gray silt? Just curious.

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


At the Somerville coworking yesterday it occurred to me how similar this is to the optical particulate monitor designs!

http://publiclab.org/notes/Willie/04-01-2014/field-testing-the-shenyei-pm-sensor

Reply to this comment...


Yes, nice! In the picture, it looks like one could place a little cuvette right there in the middle and assess the turbidity :)

Reply to this comment...


@donblair I noticed you have a more recent post about turbidity, I was wondering if you would choose a different light sensor than the Adafruit one if you were to try this again?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


@donblair, I was just reading this again, and am again impressed by your elegantly simple approach -- such a great idea! It seems like this alternating light, with signal subtraction, would work to reduce the stray light issue in @bhickman's prototype, here: https://publiclab.org/notes/bhickman/05-09-2016/turbidity-sensor.

Reply to this comment...


Hi @gretchengehrke! Sorry for the much-delayed reply :) and thanks for the comment. I, too, liked this approach -- basically, using the difference in the amplitude of back-scattered light, between the 'LED-on' and 'LED-off' states as a measure of turbidity -- for how simple it was. In retrospect, however, I might worry whether that measured difference would remain the same depending on how much stray light is entering the system. One problematic scenario, for example: if there is so much stray light that it 'maxes out' the sensor -- in that case, the 'LED-on' case wouldn't even register at all (though I suppose one could detect this condition in software, and simply report an error in this case). There's also the possible issue that the measured difference might not be remain the same as the stray light amplitude changes -- perhaps due to some non-linear response of the sensor, say (though this could be tested -- and, if it's a problem, perhaps some calibration process could account for it).

Anyway: as you point out, the setup is indeed on the 'simple' side (just buy the sensor from Adafruit, and an LED) of things, relatively speaking -- so it might not take too much effort to test it out in different stray light conditions, and see whether my worries above are well-founded ...

Cheerio! D

Reply to this comment...


Login to comment.