Turbidity Sensor

From BoSL Wiki
Revision as of 05:28, 22 January 2020 by Miao Wang (talk | contribs)
Jump to navigation Jump to search

12th November 2019

So we finally made some nice progress with the Turbidity Sensor design.

The first step was to print our case using our 3D printer. Here it is:

TurbBoxV0.1.png

Next step was to test out some hardware for the little guy. We bought two main things: (1) a LED that puts out 850nm wavelength and (2) a phototransistor. The details of the connection we used is here:

TurbV0.1Circuitdiagram.png

We also needed some resistors in the circuit, a 5v power supply and something to read the output (obviously, we used an Arduino)


Next step, put it all together and see if it works! So, we used some epoxy and wired this all up to make this sensor:

TurbProbeOn.png

Next step, test the little bugger. We did this using turbidity solutions and a deep cylinder (at least 100mm deep). We tested five turbidity solutions ranging from 500 NTU to 1NTU (tap water). Here are the results we got:

TurbV01Graph.png

So, in conclusion, we are rather happy with the workings of this cheap turbidity sensor. It costs less than $5 AUD in components, and a little time to put together. The only issue is that the range of the sensor is really limited to just 0 to 500NTU; anything higher and we think we will need to include a photo-diode alongside the phototransistor to get those big NTU values. Also, we are concerned with the energy use that this little puppy dog may take up - the resistors are even heating up (NOT A GOOD SIGN!). The last thing we want to fix is to make this all run on 3.3v instead of 5v...our BoSL board is a 3.3 volt machine, so we want to keep that consistent. Finally (I know, I said the last thing was the final, but this will be) we need to continue to develop our turbidity wiping mechanism...turbidity probes need to be cleaned a lot, so a good wiper is essential or readings are lets just say poor...

Over and out for today.

13th November 2019

So, today we began making our circuitry for the new turbidity sensor. It is looking good, but when we tried to print the board on our new PCB printer, the ink was all dried up! Come on Voltera, please send us the new ink so we can start printing our boards again! Here is an image of the circuit we made today in an easy to use a program called EasyEDA.

BoSL Turb V.01.png

17th November 2019

We have begun designing our wiping device, but to do so we needed to revamp our circuit to allow for some motors to drive the wiping action. We began printing many different versions of the above-board on our Voltera printer (thanks Voltera for finally giving us our consumables), but there were a hole bunch of issues...including that the holes and pads were not optimised for our Voltera. So, we spent the day designing a new circuit that now looks like...

BoSL Turb Probe v0.5.png

More to come from Miao in the next few days...

19th November 2019

This is Miao's turn for updating the process.

Based on Dave's experience, we started to do the calibration of the sensor.

Now we don't want to use a deep cylinder for testing, as the glass cylinder is transparent, we designed a black box and printed it by our 3D printer. The box is designed to fit our sensor and it is 100% infill. Before we use the 100% infill black box, we have also done a waterproof test of the box. We fill some water in the box, and put the box on a piece of tissue, after 4 hours, we found that there is no water on the tissue. So it can be proved that the box should be waterproof.

Also, Dave printed another sensor case, which is smaller than the previous one and it has bulgy edges, so it is easier to glue epoxy on the surface of the LED and PT.

Small testing sensor.jpg

So now we have two sensors, the big one which Dave used for testing and a small one with bulgy edges.

After we wired the LED and PT for the small sensor, we tested that, it works and the analogue reading is more than 400 in air. However, when we cover the epoxy piece on the surface, the reading number became 0 or a quite small number(less than 10). Now we use liquid epoxy to glue the epoxy piece on the sensor box, and we need to wait until the epoxy drys and then we will test it in water to see if it has any difference.

To be continued……

20th November 2019

The liquid epoxy is dry and we put the sensor in DI water in the black box, the reading number changed to around 920, and when we get it out in the air, the number changed to 12.

Anyway, as it can be used for testing in water, we started dosing the solution for testing.

We use DI water(0.18NTU) and another lab solution(807NTU) to dose the solution, we change the testing solution's turbidity by adding more 807NTU solution into DI water and then record the analogue reading.

Solution with different turbidity was tested, the range of the turbidity is between 0.18NTU and 807NTU. The step of the testing solution is different in different turbidity range. From 0.18 to 50 NTU, the step is 5NTU, and the step changes to 10NTU for the solution between 50-100NTU, from 100-200NTU, the step is 20 NTU, and from 200-1000NTU solution, the step is 100. Both the big sensor and small sensor are tested.

Testing set up.jpg

The results can be seen in the following diagram.

Small sensor output reading.jpg Large sensor output reading.jpg

From the data, it can be seen the results is different from Dave's result. From 0.17 to 50NTU, the analogue readings are floating and do not have too much change, and from 60 to 300NTU, the outputs decrease in a narrow range, after that the reading number suddenly changed to a very small number. We also found that for both sensors, the output almost fits a straight line between 60 to 200NTU.

The difference between my results and Dave's may be caused by changing the solution container. We need to do more test and found the problems.

To be continued……

21th Novermber 2019

As the results of the small sensor and the large sensor are different, we tested the two sensors to compare them.

We put both sensors in air, the analogue reading of both sensors is about 12. However, when we put the small sensor in a black box(just in the air without touching the water), the reading is also around 12, and after touching water, the number changed to around 926. For the big sensor, when put it in the black box without touching water, the reading is around 800, and if it touches water, it becomes 926.

I think the large sensor's results are more make sense, as the results in air and in DI water do not have a large difference.

But, why the two sensors perform so different when staying in the black box without water? Another question is why readings become different after touching water?

For the first question, we guess the reason may be the distance between the epoxy and the LED and PT, or maybe the bulgy edges? Now we know that base on our setting, LED and PT are very sensitive about the distance between the epoxy cover and their surface. More work needs to do to figure out these problems.

To be continued……


23th Novermber 2019

Today we did two things:

1. We repeated Dave's experiment(use the big sensor to do the experiment in a cylinder), 2. Recalibration(use the big sensor for testing, more accurate as we use a real turbidity sensor to test the turbidity of each solution)

Recalibration of the tests.jpg


For the first experiment, we got a similar trend but a different result.

Repeating Dave's experiment.png

I think the reason we got a different result is that we cannot make all the configuration of the environment exactly as same as before, and the sensor is very sensitive to the configuration(the distance between the epoxy and PT) and the surrounding environment, as the epoxy we glued to the sensor case has changed, so it has a different result.

For the second experiment, we use the big sensor for recalibration, and all the solution are tested to double-check their turbidity before testing.

The results are different from previous experiments.

Recalibration.png

The output results are between 860 to 900 for the solution between 0 to 200NTU, and the analogue output keeps floating, it does not have a specific trend. Therefore, it is not easy to calibrate the result with an equation.

Another problem is when we get the analogue reading for each solution, the reading numbers always have a floating vibration, I think it is a problem of the circuit.

Now the setting of our sensor reports different results in the same configuration, so it is difficult to duplicate the past experiment. We are thinking to change the setting of our sensor(change the resistor or change the sensor case or add some parts)…………

Need to search for more information to develop our sensor……


27th November 2019

As we still cannot get satisfactory results, we want to start to repeat the experiment on the paper and see if we can get the similar results, then we will find the difference between their settings and our design, then figure out the problem.

We did not get the exact same Acrylic tube, so we use the Vinyl tube with inner diameter 19mm to instead, and then we use our 3D printer to print a house of the sensor. The house can hold the tube in the centre and set LED on the top of the house and the PT on the side, so the LED and the PT are perpendicular to each other.

New sensor box and tube.jpg

After that, we use the Clear Liquid Epoxy to glue the tube, LED and the phototransistor in the sensor house, the Liquid Epoxy is fully waterproofed and 100% transparent. Now waiting for it dry and test it tomorrow……

Glued case for repeating test.jpg


28th November 2019

We do use the new sensor box for testing, the circuit is showed as following:

Paper circuit.jpg

However, the resistor we use has changed, R1 is changed to 500ohm and R2 is 330k ohm. But by using these resistors, the results do not change too much as the solution changes. We have to change the circuit configuration.

The first thing we want to change is connecting the base to the ground. We think the base may perform as an amplifier, and it may affect the analogue reading of our sensor. To compare with the previous test, we increase the resistance of the base, so the resistor is changed to 6M ohm. Another thing is that we want to make the LED brighter, so we change the resistor connecting to the LED as 50ohm. Therefore, the circuit is like:

New right circuit.jpg

We put the new black sensor in the glass cylinder for testing, for accuracy, we test the turbidity of each solution before the test.

Testing process of black sensor.jpg

Then we got the result, it looks pretty much better than before, the result is the linear relationship between the output reading and the turbidity.

Now we sure that the resistor on the base has the critical effects, and we changed the resistor even larger(10M ohm), but the result is not as good as 6M ohm, as the reading in 1000NTU solution is about 1000, that's good, but the reading in air and in DI water is not 0, that's not what we want, so we need to try to find an optimal resistor later.

As we think we have found the critical factor, we just use the 6M ohm resistor on the base and then use the circuit to test the previous sensor(the red one with a piece of epoxy on the surface), we still put the red sensor in the black box, just as the same configuration as before, although the result is better than before, some results are still unreasonable, for example, in DI water, the analogue reading is 177 which is not 0. That means we still got some problem with our design, now we are thinking about how to change our sensor case and design. Also, the floating vibration problem still exists, we are planning to use our PCB printer to get a better board to get rid of this problem.

To be continued……


29th November 2019

As we still want to use the wiper, so the black sensor case we used yesterday should be changed. We are wondering if half of the case can still work. Therefore, we use our 3D printer to print half of our case which is a triangular case. We also use the Liquid Epoxy to glue tube on the case, both the whole tube and half tube are used for testing. The settings are shown as the picture below. Also, our new board is printed out by our PCB printer, just waiting for the sensor ready and then test them.

Half case sensor settings.jpg PCB printed board.jpg

Just waiting for the Epoxy dry.


2nd December 2019

Now we have two new sensors, one is a triangular case with half tube and another one is a triangular case with a whole tube, now we are going to use these two sensors for testing.

Firstly, we still use the same circuit for testing, and when we found the analogue reading is small, we changed the resistor which connected to the base. From the past experience, we found the analogue reading is getting larger as the resistor connected to the base increases, so we used 20M ohm instead of 6M ohm on the base.

The results can be seen as the following:

For the case with the half tube:

Half case with half tube 6M ohm.jpg Half case with half tube 20M ohm.jpg

From the result, it can be seen that the sensor with 6M ohm connecting base performs perfectly, and the results show a linear relationship between the output voltage and the turbidity. However, for the 20ohm sensor, it does not perform as good as the first one, so we won't use such a big resistor for our design.

For the case with the whole tube:

Half case with whole tube 6M ohm.jpg Half case with whole tube 20M ohm.jpg

The sensor with a whole tube shows a similar result, as the 6M resistor is better than the 20M ohm resistor.

Another thing is that we have test the 3.3v input, and we found the sensor does work with 3.3v input voltage, however, we need to do change our design to optimize the circuit performance.


Although the sensor with half tube works not bad, we still want to use the flat surface, more tests need to be done to find a better way for a flat surface.


3rd December 2019

Now we need to think more and retest the previous experiment which using the flat sensor box.

Today we tested the performance of LED and the phototransistor with the different distance between the transparent epoxy and the parts. We use tape to make the LED and the phototransistor in a fix location, and then change the position of the transparent epoxy board.

Distance test setting

From the photo above, each unit is 5mm, when we made the LED and phototransistor face to face, the analogue reading is around 760 which is the largest number. Then we start to fix them in a specific location, then change the epoxy's location. Firstly, we make the transparent epoxy board touch the LED and the PT, the analogue is 0, and then we slowly make the epoxy far away from the two parts, in a certain distance the reading number became larger, and kept increasing until the intersection point, at that point, the reading number is 760 which is the largest number. After that, as the distance kept increasing, the number became decreasing and then became 0. Those results mean that: 1. If the epoxy is as close as touching LED and the PT, the sensor does work; 2. If the solution is within a certain distance away from the surface of LED and the PT, the turbidity of the solution can be detected by the sensor 3. In a certain distance, the phototransistor cannot detect the reflected light from the LED, which means the sensor actually does not need a specific boundary condition, because the light cannot reach such far away distance.

From the results, we know that for the flat sensor box, we need to make the epoxy touch the LED and the PT, and this configuration makes the analogue reading is 0 in the air which means the setting of our previous design should be all right. Another thing is that we do not need a boundary condition in our design because the sensor can only detect the reflected light at a certain distance.

Now the transparent epoxy board we use is much clear than the epoxy we used before, the next step we need to use this board for further testing.


4th December 2019

Today we are planning to test the sensor with a flat surface, and the epoxy needs to be glued on the surface of the sensor box.

At first, we used 100% infill white box for testing. The distance between the two holes is 20mm(centre to centre).

White sensor box front.jpg White sensor box back.jpg

At the beginning of the test, we just put the LED and the PT in the two holes to test if the analogue reading is 0 in the air. However, we found that the analogue reading is not 0 when the two little bulbs are in the holes, we took them out and found even they are perpendicular to each other, the reading is not 0. When we used the black box to hide the LED, the analogue reading is still not 0. We found that two problems cause this result, one is the light source of LED is not from the edge of the bulb but the inner part, so the light can penetrate the glass bulb and be detected by the PT. Another problem is that the white box is not light-proof, so the light from the LED can be transmitted from the white box and it can be detected by the phototransistor. That can also explain why the analogue reading is not 0 in the air for the previous test(by using the red sensor box).

Then we used the 100% infill black box to test if the light will transmit through, and we found that the light cannot be transmitted through the black box.

Therefore, to solve the problems, we determine to use our 3D printer to print the 100% infill black sensor box, and to get rid of the light transmitting from the internal part of the box, the sensor box is designed to have two tube at the back the two holes, the two tubes will cover the body of the two bulbs so that light can no longer transmit through the sensor box.

New sensor box with plastic tube.jpg New sensor box with plastic tube back.jpg

After we set up the sensor box, we glue the epoxy cover on the sensor box surface, and then start our test. The tested sensor is shown in the following photo:

New tested sensor box 3.3v.jpg

In our test, when the sensor is exposed in air, the analogue reading is 0, and in DI water, it is also 0. It is a good result as it matches our hypothesis. However, when we put it in the solution with 200NTU, the analogue reading is about 10, and when we use 1000NTU solution for testing, the reading number is about 76, so the problem is that the reading number is too small for calibration.

We thought that the problem may be the PT is too deep in the box, so it can detect little light from the LED, next step we need to print another sensor box to make the PT more close to the surface.

To be continued……


5th December 2019

The first thing we need to do is make the tube at the back of the hole shorter, so the LED and the PT are closer to the surface and can touch the epoxy.

The sensor box we used yesterday is a black box with 20mm distance between two holes(centre to centre). Now we use a new sensor box with 14.3mm distance between two holes. We use 14.3mm distance because in the past experiment the tube diameter we used is 19mm, so the distance between the LED and the PT is about 14.3mm. So we test this distance to see the performance. The new case can be seen as the following photo:

New sensor box with led and pt.jpg

And we also connect LED and the PT to the Arduino and found the analogue reading is 0 in air, and when we put the transparent epoxy on the surface, the reading number is also 0. That shows the sensor works well. Next step, we are going to print more sensor boxes with different distance between the holes, 12mm, 10mm and 8.5mm, and then test if the distance between LED and the PT will affect the performance, and then we will choose the best one and test in solution.

To be continued……


6th December 2019

Now we have a sensor box family! Sensor boxes with different distance between holes(8.5mm, 10mm, 12mm, 14.3mm). And we will use these boxes for testing.

Sensor box family.jpg

Distance testing

We try to put the transparent epoxy board in front of the different boxes with different distance, and then see the analogue reading in different distance. The results showed that if the two holes are closed, the distance between the board and the sensor box to reach the maximum reading number is smaller. For example, for the 14.3mm distance box, when the board is 3mm away from the box, the reading number is 380, and the reading number changed to 650 at 4mm distance. However, for 8.5mm distance box, the reading number is 650 when the board is 1mm away from the box.

So, after the test, we found 14.3mm between the holes is too far away and 8.5mm is too close, so we choose 12mm box and 10mm box for testing.

Solution testing

We used 10mm distance box and 12mm distance box to get the analogue reading in the different solution. For the 10mm box, the readings are still 0 for the solution below 80NTU, and for the 1070NTU turbidity solution, the analogue reading is only 128. For the 12mm box, the number is even smaller, for 1070NTU turbidity is 48. That result cannot be used for analysis. We have also changed the base resistor from 6M ohm to 20M ohm, however, when the resistor is larger than 7M ohm, the reading number in air and DI water is no longer 0, that is not what we want.

We compared with the current design and the previous test design(with round tube in the box), the difference between these two designs is the transparent board, one is a flat board and another is a round tube, that means the LED and the PT have a certain angle between the board, but with the tube, they are perpendicular to the tube surface. So we want to have another test which makes the LED and the PT perpendicular to the epoxy board and see if it will get better.

New sensor box testing

We use our 3D printer to print a new sensor box which is shown below, this sensor box can also make the LED and the PT perpendicular to each other, and the epoxy board could also be glued on the surface of the box which makes the board perpendicular to the bulbs. And the distance between the two bulbs is 14.3mm which is as same as the previous testing box(with a round tube in the centre). Our hypothesis is that if this sensor works, that means the epoxy board should be set as perpendicular to the LED and the PT, so we can try to cut two small round epoxy board and set them into the two holes which are perpendicular to the two bulbs.

New testing box for perpendicular board.jpg

To be continued……


10th December 2019

Today we used the L shape sensor box for testing. When we started our test, we got a serious floating vibration problem. When the sensor is exposed in air, the analogue reading is not 0, the range is between 8 to 21, and the numbers keep changing.

To solve this problem, we try to change the resistor on the base and on the emitter. For the base, when we changed the resistor from 6M ohm to 4M ohm and then 1M ohm, the analogue reading number became smaller but still not 0, and the floating vibration problem still exists. We have also changed the PCB board to the breadboard, but the situation did not change. The resistor on the emitter has also changed, however the analogue reading did not change too much.

At last, we used a new LED and a new phototransistor which are soldered by new wire, this wire we used is thicker and more rigid than that we used before. After we changed that, the analogue reading in the air is constantly 0. However, when we face the PT to the lamp, in a certain angle, the reading increases.

Now we found that the floating vibration problem may be caused by the wire, and the lamp may emit light which can be detected by the phototransistor, and that problem may affect the results of our experiments.

In the following test, we still need to use a black box for solution container to avoid noise from the lamp or other light sources.

To be continued……


18th December 2019

New update for our turbidity sensor.

Now we need to continue testing the last sensor with L shape sensor box. This time, to avoid the noise from the breadboard, we would not connect the resistors in the breadboard, instead, we will solder the resistor on the pins. Apart from that, to get rid of the noise from the lamp or the laptop screen, the solution will be contained in a black box which is printed by our 3D printer, and the cap of the black box is also printed. That cap will cover the top of the box, only one small hole will sit on the cap to allow the cables to come out, with this configuration, the noise from the other light source will almost be eliminated.

Just wait for the 3D printer completing the printing task, and then we can use the case and the container for testing.

To be continued……


19th December 2019

All the facilities for testing are completed this morning, as usual, we still use the liquid epoxy to glue the plastic board on the sensor case, and then pouring the liquid epoxy at the back of the LED and the phototransistor so that the sensor is fully water-proof. When testing the sensor, the solution container will be covered by the cap. The testing facilities can be seen as the following pictures:


L shape sensor testing1.jpg L shape sensor testing2.jpg L shape sensor testing.jpg


This time, the thick wire and the black container with a cap are used to avoid the noise. As a result, the analogue reading is much stable than before. When we put the sensor in the black box and covered with the cap, the analogue reading is constantly 0, and the reading number is also 0 in DI water, the floating vibration problem is almost disappeared.

By testing different solution, the results are shown in the table:

L shape sensor testing result.jpg
Media(NTU) Analogue reading
Air(in black box) 0
0.18 0
62 0
82 0
165 26
432 198
600 220
1036 352



The problem is that the analogue reading number is too small for the solution below 100NTU(almost 0), so it is not suitable for stormwater monitoring.

The reason may be the light source is not strong enough, we need to change some settings to let the light source stronger. For example, the successful sensor insert the tube in the middle of the case and the tube can congregate the light as a concave lens, can we use concave lens on the top of the LED to get the light source together?

We will try to do this kind of thing.

To be continued……


20th January 2020

We got the new update of our turbidity sensor development.

Now we have done several tests: distance test, LED resistor test, and the PT base resistor test.

Now we are using our new turbidity sensor board, this board is small and easy to connect all the pins when testing, and the analogue reading output is also more stable than the breadboard, the following picture shows our new board.

Sensor board pcb.jpg

To make sure the LED and the PT sit at the fix position, we used our 3D printer to print a rail and the LED and PT holder, the holder can move on the rail and stand at a fixed position, as the following figure shows.

Rail and holders.jpg


Distance test

Experiment Description: To test which distance will affect the analogue reading of the LED(6 degrees) and the PT. We use the 5 voltage input for the circuit, and use 51ohm resistor connecting to the LED, for the phototransistor, connecting 1M ohm resistor on the emitter, and connecting 5M ohm resistor on the base. By changing the distance between the LED and the PT(centre to centre) in the air, and use the cardboard box to cover them(making dark environment and avoiding noise), then record the analogue readings to see what the closest distance can be used between them. The closest distance means when we put them in the air, the analogue reading should be 0. The results for this circuit configuration is in the table below:

Distance(mm) 6 7 8 9 10
Analogue reading 20 0 0 0 0

Distance test results.jpg

That means for this configuration, the closest distance should be 7mm(centre to centre).

LED resistor test

Experiment Description: As the test shows when put PT 6mm away from the LED, it has analogue reading. We just use this distance, and change the resistor on the LED, and then see how the analogue reading changes. We still use the 6 degrees angle LED, and the 1M ohm resistor on the emitter, 5M ohm resistor on the base.

The results are shown in the table below:

LED resistor(ohm) 10 20 50 100 200
Analogue reading 200 100 20 0 0

LED resistor test results.png