Difference between revisions of "Spectrophotometer"

From BoSL Wiki
Jump to navigation Jump to search
(Created page with "This page is for Eric to update regarding the spectrophotometer.")
 
 
(213 intermediate revisions by the same user not shown)
Line 1: Line 1:
This page is for Eric to update regarding the spectrophotometer.
+
We have come up with a great idea to implement a low-cost spectroscopy sensor to measure various water quality parameters. The Sparkfun AS7265x spectroscopy sensor is introduced here (around AUD 60-100). It has three LEDS (VIS,UV,IR) which can measure the intensity for the wavelength ranging from 410nm to 940 nm. We would like to investigate any potential application with this sensor...
 +
 
 +
==== Video Introduction ====
 +
 
 +
We have introduced a confirmation recording here to quickly summarize the overall progress of multispectral sensor:
 +
 
 +
<br>
 +
 
 +
<embedvideo dimensions="700" service="youtube">https://youtu.be/FblovIZWngI</embedvideo>
 +
<br>
 +
 
 +
== 10/01/2023 ==
 +
Firstly, we hava come out an initial design for holding the sensor, and we use the clip to mount it to a vertical surface to do some preliminary tests.A black cup is 3D printed to store the water for measurement purpose.
 +
 
 +
<gallery>
 +
Spectroscopy - 100123.png|
 +
Case 1.0.jpg|
 +
</gallery>
 +
 
 +
It is good to know what roughly the spectroscopy for the water would be under low turbidty level. It can be seen that the sensor didn't receive much reflection for frequency between 710nm and 940nm.
 +
 
 +
== 25/01/2023 ==
 +
After the first design, we have come out some updated version for the stand that can hold the sensor instead of mounting to a cardbox. Now both the sensor and cup can be located in fixed position.And we have changed the colour of both cup and stand to be black to minimize the potential background noise.
 +
 
 +
This time we have using some different turbidty solution to measure the spectroscopy at each turbidty level.It can be seen that some correlation might exist at certain frequency (such as 610nm).
 +
 
 +
<gallery>
 +
Spectroscopy - 250123.png|
 +
Case 2.0.jpg|
 +
</gallery>
 +
 
 +
== 01/02/2023 ==
 +
 
 +
Today,we bring all the equipment to the wet lab and would like to test again with same turbidty solution, while we have found something interesting:
 +
 
 +
<gallery>
 +
Spectroscopy - 010223.png|
 +
</gallery>
 +
 
 +
It can be seen that large variation existed for the same measurement sample. We start thinking this might because of the light problem as the light in two rooms are different. And for now we just take one measurement reading with all LEDS on the sensors once to obtain the data. With strong light, the sensor might not be able to receive the correct reflection from the surface. So we need to get some improvements for our code to count for the background noise effect.
 +
 
 +
== 01/02/2023 ==
 +
 
 +
We have modified our code to include a initial scan without using LEDs, this spectroscopy reading is later used as background reference.For now, we try to use the spectroscopy that got with all LEDs minus the spectroscopy that got without LEDs to get our final spectroscopy. We have selected three test locations:
 +
 
 +
1) Office (Normal Light Condition)  2) Wet lab (Strong Light Condition)  3)Table outside the office (Slight Light Condition)
 +
 
 +
<gallery>
 +
Spectroscopy - 030223.png|
 +
</gallery>
 +
 
 +
The results looks pretty good as the spectroscopy obtained at different locations are very close to each other, the background noise has been reduced.
 +
 
 +
 
 +
 
 +
Later, we have also let the sensor stands on different surface to see whether this will affect the spectroscopy of the detected object. The surface we selected are:
 +
 
 +
1) Office Desk (White Surface) 2) Laptop (Grey Surface)  3) IOT Poster (Colourful Surface)
 +
 
 +
<gallery>
 +
Spectroscopy - 130223.png|
 +
</gallery>
 +
 
 +
The spectroscopy obtained from three different back surfaces aligned well with each other. Now we would like to continue testing the water with different turbidty level again.
 +
 
 +
== 16/02/2023 ==
 +
 
 +
Today we have found that the sensor case we designed originally is not aligned in the middle of the black cup. We have modified our design for both the sensor case and stand:
 +
 
 +
This stand have two trenches that we can adjust the sensor height in the future while maintain its stay in horizontal surface. And the arduino board has been locked on the top of the stand. A pre-cut circle surface is designed at the bottom of the stand that can fit the size of the cup,so that we can easily get the black cup out and in, making the filling progress more easier:
 +
 
 +
With this new design, we have tested it with all the turbidty solution again:
 +
 
 +
<gallery>
 +
Spectroscopy - 140223.png|
 +
Case 3.0.jpg|
 +
</gallery>
 +
 
 +
== 09/03/2023 ==
 +
 
 +
We have modified the container up to a black square box to maximize its capacity for carrying water.
 +
 
 +
Also, we have updated the sensor reading function, now the sensor can read the spectroscopy information from White, IR, UV and All LEDs together separately. This could help us better understand how different objects behaves to different LEDs).
 +
 
 +
For the experiment settings, we have added cardboard as the cover when we do the experiment to eliminate the effect of other light resources.
 +
 
 +
Four different turbidity solutions (60NTU, 100NTU, 200NTU, 400NTU) has been tested after five minutes settle time.The results (average of 6 times reading) are shown as follows:
 +
 
 +
<gallery>
 +
WhiteLED-090323.png|
 +
IRLED-090323.png|
 +
UVLED-090323.png
 +
AllLED-090323.png
 +
</gallery>
 +
 
 +
== 16/03/2023 ==
 +
We have extended our reference turbidity sets to a larger level:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Turbidity !! Values 
 +
|-
 +
| Low Turbidity Level || 0,0.61,0.68,1.23
 +
|-
 +
| Mid Turbidity Level || 25,50,55.5,75,108
 +
|-
 +
| High Turbidity Level || 199,300,393
 +
|}
 +
 
 +
We have then followed the same experiment procedure and have obtained the spectroscopy for the above 12 turbidity levels. After got the spectroscopy, we have started to look at if there is any correlation existed between turbidity level and normalized signal value.
 +
 
 +
White Light:
 +
 
 +
<gallery>
 +
White Spectro.png|
 +
White Correlation.png|
 +
</gallery>
 +
 
 +
UV Light:
 +
 
 +
<gallery>
 +
UV Spectro.png|
 +
UV Correlation - 410nm.png|
 +
UV Correlation - 435nm.png|
 +
</gallery>
 +
 
 +
IR Light:
 +
 
 +
<gallery>
 +
IR Spectro 160323.png|
 +
</gallery>
 +
 
 +
All LEDs:
 +
 
 +
<gallery>
 +
All LEDs 160323.png|
 +
All Correlation - 435nm - 160323.png|
 +
All Correlation - 485nm - 160323.png|
 +
</gallery>
 +
 
 +
For the IR, we didn't get any good correlation curve so it has been eliminated from the model.
 +
 
 +
After establish a few relationship curve ( overall above 90% for turbidity ranging from 0 to 300 NTU), We have started to establish a initial prediction model to see if we can predict the turbidity level:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! LEDs !! Wavelength  !! Regression Curve
 +
|-
 +
| White || 485 nm || y= 34.431x-342
 +
|-
 +
| UV || 410 nm || y= 4.7096x-249.06
 +
|-
 +
| UV || 435 nm || y= 24.651x-231.34
 +
|-
 +
| All || 435 nm || y= 16.582x-303.02
 +
|-
 +
| All || 485 nm || y= 32.224x-340.19
 +
|}
 +
 
 +
Later we have brought three water samples from Troups Creek Retention pond to see if we can actually predict the turbidity level, the output value are compared with the reference value that obtained from the Thermo Scientific Turbidity Sensor (ORION A14500), the results are shown as follows:
 +
 
 +
<gallery>
 +
1st trial - 160323.png|
 +
2nd trial - 160323.png|
 +
3rd trial - 160323.png
 +
</gallery>
 +
 
 +
'''From the result here, it can be seen that the best predict regression curve is using white LED at 485nm, with uncertainty generally under 30%.
 +
For some instance, the model could able to predict good turbidity level (the one marked as green), but it didn't occurred constantly under same LED condition.
 +
It is suggest further dataset might be needed to be fit into the predict model, and it needs to come up with a way that can reduce the uncertainty caused by the sensor.
 +
'''
 +
 
 +
== 23/03/2023 ==
 +
 
 +
In this week, we would like to test the impact of light (with or without cover box) and the impact of different height (the distance from the water surface)
 +
 
 +
=== Impact of Light ===
 +
 
 +
==== Experiment Setup ====
 +
 
 +
The experiment is conducted with and without cover box after 5-mins setting up time.
 +
 
 +
6 different turbidity solutions were used:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Turbidity !! Values 
 +
|-
 +
| Low Turbidity Level || 0
 +
|-
 +
| Mid Turbidity Level || 50,75,100
 +
|-
 +
| High Turbidity Level || 199,300
 +
|}
 +
 
 +
==== Result ====
 +
 
 +
The results shown here are calculated based on the difference between without case value with with case value.
 +
 
 +
The grey block shows the 5 reference points we selected previously.
 +
 
 +
The yellow blocks shows some new value which comes out when we did not use the cover.
 +
 
 +
<gallery>
 +
0 - Cover - 230323.png|
 +
50 - Cover - 230323.png|
 +
75 - Cover - 230323.png|
 +
100 - Cover - 230323.png|
 +
200 - Cover - 230323.png|
 +
300 - Cover - 230323.png|
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
Overall, when look at the 5 reference points, the '''difference is not significant ( error rate < 20%)'''. This result is not so bad as the sensor itself has around +/-12% accuracy (https://www.sparkfun.com/products/15050).
 +
 
 +
Except for those extreme error points(100% error rate), overall,''' the error is under 35% when turbidity under 100 NTU and under 50% when turbidity ranging from 100 to 300 NTU'''.
 +
 
 +
=== Impact of Height ===
 +
 
 +
==== Experiment Setup ====
 +
 
 +
The height defined here is referring to the height from the water surface to the edge of the sensor case. The height for previous experiment is 95mm.
 +
 
 +
The experiment is conducted with cover box after 5-mins setting up time.
 +
 
 +
We have conducted another two height at 35mm and 135mm (the minimum and maxmimum value we could reach for current stand). 6 different turbidity solutions were used:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Turbidity !! Values 
 +
|-
 +
| Low Turbidity Level || 0
 +
|-
 +
| Mid Turbidity Level || 50,75,100
 +
|-
 +
| High Turbidity Level || 199,300
 +
|}
 +
 
 +
==== Result ====
 +
 
 +
 
 +
5 Reference Points:
 +
<gallery>
 +
White 485 - 230323.png|White 485
 +
Uv 410 - 230323.png|UV 410
 +
Uv 435 - 230323.png|UV 435
 +
All 435 - 230323.png|All 435
 +
All 485 - 230323.png|All 485
 +
</gallery>
 +
 
 +
LEDs:
 +
 
 +
<gallery>
 +
White - 230323.png|White LED
 +
Uv -230323.png|UV LED
 +
All - 230323.png|All LED
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
When look at the 5 reference points, it can be seen clearly that '''better correlation relationship can be achieved when the height increased'''.
 +
 
 +
When look at each LED individually, '''better correlation could be achieved at lower wavelength if the height is increased'''.
 +
 
 +
Generally, '''the best relationship is still achieved at higher height''' (correlation above 97% for White, UV and All LEDs with height of 135mm).
 +
 
 +
== 30/03/2023 ==
 +
 
 +
In this week, we would like to continue test the impact of light (with or without cover box) and the impact of different height (the distance from the water surface)
 +
 
 +
=== Impact of Light ===
 +
 
 +
==== Experiment Setup ====
 +
 
 +
The experiment is conducted with and without cover box after 5-mins setting up time for same turbidity solution.
 +
 
 +
6 different turbidity solutions were used:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Turbidity !! Values 
 +
|-
 +
| Low Turbidity Level || 0
 +
|-
 +
| Mid Turbidity Level || 50,75,100
 +
|-
 +
| High Turbidity Level || 199,300
 +
|}
 +
 
 +
==== Result ====
 +
 
 +
The results shown here are box plot for White, UV and all LED conditions.
 +
 
 +
<gallery>
 +
White LED - 300323.png|White LED
 +
UV LED - 300323.png|UV LED
 +
All LED - 310323.png|All LED
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
Overall, the variation between with and without cover is not very significant.
 +
 
 +
Generally, when look at all LEDs and White LED, with-cover readings tend to be larger than the without-cover readings. For the UV LED only, the difference is not significant.
 +
 
 +
=== Impact of Height ===
 +
 
 +
==== Experiment Setup ====
 +
 
 +
The height defined here is referring to the height from the water surface to the edge of the sensor case.
 +
 
 +
As we would like to explore the how high the sensor could be able to provide valuable data, a 1000 mm long bar was used, thus no cover was used in this experiment.
 +
 
 +
The experiment is conducted after 5-mins setting up time for each turbidity solution.
 +
 
 +
We have conducted in total five different heights ranging from 25mm (Just above the water surface and 725mm:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Height !! 25,225,425,625,725 (mm)
 +
|}
 +
 
 +
3 different turbidity solutions were used:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Turbidity !! Values 
 +
|-
 +
| Low Turbidity Level || 0
 +
|-
 +
| Mid Turbidity Level || 100
 +
|-
 +
| High Turbidity Level || 300
 +
|}
 +
 
 +
==== Result ====
 +
 
 +
The results here were analyzed using coefficient of variation for each turbidity and individual LED condition. Then the average coefficient of variation value were taken by average all the readings at certain depth.
 +
 
 +
The results are shown here:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Coefficient of Variation !! Values 
 +
|-
 +
| 25mm || 1.86
 +
|-
 +
| 225mm || 1.48
 +
|-
 +
| 425mm || 1.49
 +
|-
 +
| 625mm || 1.59
 +
|-
 +
| 725mm || 1.61
 +
|}
 +
 
 +
It can be seen that when the sensor is very close to the water surface, the variation is very huge, thus hard to find the potential depth relationship, by remove the 25mm value for now, and use the rest value to plot a regression curve, the depth relationship can be found as:
 +
 
 +
[[File:Depth Relationship - 300323.png|Depth Relationship - 300323.png]]
 +
 
 +
==== Conclusion ====
 +
 
 +
This result could illustrate the potential of using spectrometer sensor as a depth sensor. More height experiments are needed to further approve this concept.
 +
 
 +
== 07/05/2023 ==
 +
 
 +
During the past period, we were aiming to investigate the potential of using two spectrometer sensors to see whether it can increase the accuracy of our data. The Sparkfun Qwwic Mux port is used to connect two Sparkfun AS7265X spectrometer sensors.
 +
 
 +
==== Experiment Setup ====
 +
 
 +
The experiment is conducted without cover box at 95mm height after 5-mins setting up time for same turbidity solution. The set up configuration is shown as below:
 +
 
 +
[[File:Dual Spectro Setup.jpg|150px|middle]]
 +
 
 +
For the first trial, the angle between two spectrometer sensors is set as 90 degree.
 +
 
 +
5 different turbidity solutions were used:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Turbidity !! Values 
 +
|-
 +
| Low Turbidity Level || 0
 +
|-
 +
| Mid Turbidity Level || 50,75,100
 +
|-
 +
| High Turbidity Level || 199
 +
|}
 +
 
 +
==== Result ====
 +
The spectroscopy graph of White LED is shown as follow and the best correlation relationship between turbidity level and normalized sensor reading can be found at 460nm wavelength.
 +
 
 +
<gallery>
 +
White LED 95 070523.png|Spectroscopy for White LED
 +
White460 080523.png|Regression curve for White LED at 460nm
 +
</gallery>
 +
 
 +
The spectroscopy graph of UV LED is shown as follow and the best correlation relationship between turbidity level and normalized sensor reading can be found at 410nm wavelength.
 +
 
 +
<gallery>
 +
UVLED 95 070523.png|Spectroscopy for UV LED
 +
UV410 080523.png|Regression curve for UV LED at 410nm
 +
</gallery>
 +
 
 +
The spectroscopy graph of All LEDs is shown as follow and the best correlation relationship between turbidity level and normalized sensor reading can be found at 860nm wavelength.
 +
 
 +
<gallery>
 +
All LED 95 070523.png|Spectroscopy for All LED
 +
All860 080523.png|Regression curve for All LED at 860nm
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
From the result, it can be shown that the dual Spectrosensor can get the better correlation relationship up to 97% for UV / White and All LEDs condition.
 +
 
 +
For the next experiment, we will adjust the angles between two sensors to let it have good reflectance over the water surface.
 +
 
 +
 
 +
== 18/05/2023 ==
 +
 
 +
Following the last experiment, we would like to continue investigate more parameters which may affect the spectrophotometer. In this experiment, we have adjusted the angle between two sensors and would like to let the receiver sensor can receive the light that sender sensor emitted reflected back from water surface.
 +
 
 +
==== Experiment Setup ====
 +
 
 +
The experiment is conducted without cover box at 90mm height after 5-mins setting up time for same turbidity solution. The set up configuration is shown as below:
 +
 
 +
<gallery>
 +
Dual Angle 180523.jpg|Adjusting angle using protractor
 +
Dual Setup 180523.jpg|Final Setup
 +
</gallery>
 +
 
 +
The angle between two spectrometer sensors is therefore set as 130 degree.
 +
 
 +
5 different turbidity solutions were used:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Turbidity !! Values 
 +
|-
 +
| Low Turbidity Level || 0
 +
|-
 +
| Mid Turbidity Level || 50,75,100
 +
|-
 +
| High Turbidity Level || 199
 +
|}
 +
 
 +
==== Result ====
 +
The spectrum graph of White LED is shown as follow and the best correlation relationship between turbidity level and normalized sensor reading can be found at 560nm wavelength.
 +
 
 +
<gallery>
 +
White 180523.png|spectrum for White LED
 +
White560 180523.png|Regression curve for White LED at 560nm
 +
</gallery>
 +
 
 +
The spectrum graph of UV LED is shown as follow and the best correlation relationship between turbidity level and normalized sensor reading can be found at 410nm wavelength.
 +
 
 +
<gallery>
 +
UV 180523.png|spectrum for UV LED
 +
UV410 180523.png|Regression curve for UV LED at 410nm
 +
</gallery>
 +
 
 +
The spectrum graph of All LEDs is shown as follow and the best correlation relationship between turbidity level and normalized sensor reading can be found at 645nm wavelength.
 +
 
 +
<gallery>
 +
All 180523.png|spectrum for All LED
 +
All645 180523.png|Regression curve for All LED at 645nm
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
From this experiment, the correlation we get from White, UV and All LEDs is not good as before, with 79%, 72% and 96%, respectively.
 +
 
 +
While look at the spectrum, it can be seen that the resolution get from this experiment is also worse than before.
 +
 
 +
== 15/01/2024 ==
 +
 
 +
Before continue to explore full capbility of the module, the settings and performance of the sensors have been re-assessed. From user guide, the user could be able to change:
 +
 
 +
'''Measurement Mode''': 6 Chan One Shot (Default), this generally take readings from six out of six photodiodes from each sensor, which suit for our purpose.
 +
 
 +
'''Gain''':64X (Default), this value can be up to 64X if value from the sensor are exceeded the limit.
 +
 
 +
'''Integration Time''': integer input ranging from 0 to 255, 1 integer equals to 2.8ms. Increase 1 integer can increase 1024 sensitivity. To reach maximum sensitivity of the sensor (65545), the integer of the integration time needs to be at least 49.
 +
 
 +
'''Light Source''':User can choose to use LED or not use LED.
 +
 
 +
'''Function''': User can choose to use Raw reading function or Calibrated reading function. Since the calibrated function needs to be performed within certain condition, which is not suit for our purpose, the raw reading function is used for future development.
 +
 
 +
== 16/01/2024 ==
 +
 
 +
Next, we would like to let the sensor capable of recording the spectra without using LED under office light or sunlight condition. This step can help for further sensor calibration.
 +
 
 +
==== Experiment Setup ====
 +
{| class="wikitable"
 +
|-
 +
! Settings!! Input
 +
|-
 +
| Integration Time Integer(cycles)|| 49
 +
|-
 +
| Measurement Mode || 6CHAN_ONE_SHOT
 +
|-
 +
| Light Source || Non-LED
 +
|-
 +
| Function || Example 4 (reading Raw Values) from library.
 +
|-
 +
| Gain|| 1X
 +
|-
 +
| Location|| Office Desk
 +
|}
 +
 
 +
==== Result ====
 +
 
 +
{| class="wikitable"
 +
|-
 +
! A!!B!!C!!D!!E!!F!!G!!H!!R!!I!!S!!J!!T!!U!!V!!W!!K!!L
 +
|-
 +
|5||39||16||0||79||0||109||142||143||91||8||4||7||4||15||4||1||1
 +
|}
 +
 
 +
==== Conclusion ====
 +
 
 +
From this experiment, it can be seen that 0 values occured at D (485nm) and F (535nm), we need further research to solve this problem.
 +
 
 +
== 22/01/2024 ==
 +
 
 +
To figure out why the zero occured, the integration time is first reason we could think about. So we start to add delay after the measurement function and before the serial.print to see what happened.
 +
 
 +
==== Experiment Setup ====
 +
{| class="wikitable"
 +
|-
 +
! Settings!! Input
 +
|-
 +
| Integration Time Integer (cycles)|| 49
 +
|-
 +
| Measurement Mode || 6CHAN_ONE_SHOT
 +
|-
 +
| Light Source || Non-LED
 +
|-
 +
| Function || Example 4 (reading Raw Values) from library.
 +
|-
 +
| Gain|| 64X
 +
|-
 +
| Location|| Office Desk
 +
|}
 +
 
 +
==== Result ====
 +
 
 +
When the delay less than 72ms:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! A!!B!!C!!D!!E!!F!!G!!H!!R!!I!!S!!J!!T!!U!!V!!W!!K!!L
 +
|-
 +
|5||40||17||0||80||37||112||143||142||91||9||5||7||4||15||4||1||1
 +
|}
 +
 
 +
When the delay at 100ms:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! A!!B!!C!!D!!E!!F!!G!!H!!R!!I!!S!!J!!T!!U!!V!!W!!K!!L
 +
|-
 +
|5||39||16||52||79||34||109||142||143||91||8||4||7||4||15||4||1||1
 +
|}
 +
 
 +
==== Conclusion ====
 +
 
 +
From this experiment, we found that when adding certain time of delay, the zero problem get solved. We hypotheisted that the sensor needs to take some time to complete the spectra conversion. Further work is required to verify this hypothesis.
 +
 
 +
== 29/01/2024 ==
 +
 
 +
The zero issue has been re-assesed. We started to create an array to store first 20 readings from same channel output to see what will happened. This step was repeated for all 18 channels.
 +
 
 +
==== Experiment Setup ====
 +
{| class="wikitable"
 +
|-
 +
! Settings!! Input
 +
|-
 +
| Integration Time Integer (cycles)|| 49
 +
|-
 +
| Measurement Mode || 6CHAN_ONE_SHOT
 +
|-
 +
| Light Source || Non-LED
 +
|-
 +
| Function ||
 +
[[File:Zero-issue-verification.ino|thumb]]
 +
|-
 +
| Gain|| 64X
 +
|-
 +
| Location|| Office Desk
 +
|}
 +
 
 +
==== Result ====
 +
 
 +
After 20 interations, we found that for channel D,F,R,J,W,L. The zero was observed for first 3-5 cycles of reading, after that, we can get stable readings. For remaining 12 channels, we can get good readings from the beginning.Therefore, for this six channels, we started to use millus() function to record the time it needs from take measurement until record the data, the result is shown below:
 +
 
 +
<gallery>
 +
49 Integration TIme.png|Average time (ms)
 +
</gallery>
 +
 
 +
It can be seen that for all these 6 channels, it generally required 80-90 ms to shown the data. Thus, we re-investigate the user guide and found this is related to the spectral conversion of the data itself:
 +
 
 +
[[File:Data Conversion Mechanism.png|thumb{left]]
 +
 
 +
All these 6 channels all within 2nd conversion zone of the sensor, which means they will need 2 * integration time to complete data conversion. For an integration time integer of 49, this means it will require (49+1)*2.8*2 = 280 ms at least. We use millus() to record the time that "takeMeasurement()" required, which is 225ms, this means it generally require extra 55 ms to complete spectral conversion, the recorded time is generally 30ms larger than the calculated time difference. That's why the zero readings will occur.
 +
 
 +
To verify our findings, we also tried smaller integration time (integration time integer 29):
 +
<gallery>
 +
29 integration time.png|Average time (ms)
 +
</gallery>
 +
 
 +
We could observe similar trend that for integration time intger of 29 ( integration time is 84ms), the time for measurement takes 140ms, thus 2*integration time (84ms) - 140 would come out 28ms. The results suggest the similar conclusion as above that the sensor needs 30ms + calculated time difference.
 +
 
 +
'''A second Way''' of verify this is simply change the output order from the example, originally is from A to L as shown below:
 +
 
 +
A,B,C,D,E,F,G,H,R,I,S,J,T,U,V,W,K,L
 +
 
 +
We re-order this and let and let that 6 channels to be the last, it become:
 +
 
 +
A,B,C,E,G,H,I,S,T,U,V,K,D,F,R,J,W,L
 +
 
 +
We will observe:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! A!!B!!C!!'''D'''!!E!!'''F'''!!G!!H!!'''R'''!!I!!S!!'''J'''!!T!!U!!V!!'''W'''!!K!!'''L'''
 +
|-
 +
|18||45||247||'''0'''||108||'''0'''||183||241||559||205||146||132||25||17||21||10||11||5
 +
|}
 +
 
 +
{| class="wikitable"
 +
|-
 +
! A!!B!!C!!E!!G!!H!!I!!S!!T!!U!!V!!K!!'''D'''!!'''F'''!!'''R'''!!'''J'''!!'''W'''!!'''L'''
 +
|-
 +
|19||44||232||107||182||235||215||148||25||16||21||10||'''183'''||'''92'''||563||138||10||4
 +
|}
 +
 
 +
This matches what we want as it allows more time for the sensor to complete data conversion.
 +
 
 +
==== Conclusion ====
 +
 
 +
The above two ways of experiments verify our hypothesis that the sensor needs double integration time to complete spectral conversion. This time increases when the integration time increases. Re-order the output matrix is suggested for future data processing.
 +
 
 +
== 18/02/2024 ==
 +
 
 +
After fixing the zero-issue, now we begin from investigating the effect from different light sources. We re-do the experiments in a more systematic way.
 +
 
 +
==== Experiment Setup ====
 +
{| class="wikitable"
 +
|-
 +
! Settings!! Input
 +
|-
 +
| Integration Time Integer (cycles)|| 49
 +
|-
 +
| Measurement Mode || 6CHAN_ONE_SHOT
 +
|-
 +
| Light Source || Non-LED and LED
 +
|-
 +
| Function ||
 +
|-
 +
| Gain|| 64X
 +
|-
 +
| Location|| Office Desk / Dark Environment / Sunlight
 +
|}
 +
 
 +
The experiment set-up is shown as follows:
 +
 
 +
<gallery>
 +
Office light.jpg| Setup under office light
 +
Sunlight.jpg| Setup under Sunlight
 +
Dark environment.jpg| Setup under Dark environment
 +
</gallery>
 +
 
 +
==== Result ====
 +
 
 +
The average spectra were taken as avaergae of 10 readings.
 +
 
 +
The results obtained under different light conditions are:
 +
<gallery>
 +
Spectra 01.png| Results under dark environment and office light.
 +
Spectra 02.png| Results under sunlight
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
It can be seen that under the office light and dark environment, very similar spectra can be obtained by using the substracting method. While for sunlight condition, the counts received by the sensor is much larger than other conditions. We might need to introduce dual sensor ( one facing up and one facing down) to solve this issue.
 +
 
 +
== 20/02/2024 ==
 +
 
 +
Previous Experiment found the substracting method works well in moderate light condition as well as dark condition. While under sunlight, this method is invalid. We would like to change some of the sensor settings to see if we could get similar spectra.
 +
 
 +
==== Hypothesis ====
 +
The light effects can be counted by subtracting the background noise or accounting for the sunlight irradiance to get similar spectra with spectra got with office light or dark environment.
 +
 
 +
==== Action Items ====
 +
 
 +
- Set up a completely dark environment and under office light Condition , prepare the sensor case without diffuser.
 +
 
 +
- Set up the sensor case without diffuser under the direct sunlight.
 +
 
 +
- Set up Purple Card
 +
 
 +
- Fix the sensor at certain height. (e.g. 75mm from the water surface from previous experimental settings)
 +
 
 +
- Shining the object without using LED, record the Raw DN output from the sensor (Default Settings), take 6 readings and take average spectra.
 +
 
 +
- Shining the LED for the object, record the Raw DN output from the sensor (Default Settings), take 6 readings and take average spectra.
 +
 
 +
- Letting One sensor facing up towards the sun and record the raw DN output from the sensor (Default settings), take 6 readings and take average spectra.
 +
 
 +
- Using step 5 result minus step 4 result.
 +
 
 +
- Change integration time and Gain to adjust the sensor DN output.
 +
 
 +
- Check the difference between various Test Conditions.
 +
 
 +
==== Result ====
 +
 
 +
The average spectra were taken as avaergae of 6 readings.
 +
 
 +
<gallery>
 +
File:200224.png|
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
From the result, it can be seen that:
 +
 
 +
Under default settings, the 64x gain would lead to maximum readings (65545), which would lead to 0 output if you using subtracting method.
 +
 
 +
The sensor output cannot be achieved easily by changing the gain or integration time.
 +
 
 +
== 22/02/2024 ==
 +
 
 +
Explore the potential of using Spectro sensor to detect turbidity in urban water samples.
 +
 
 +
==== Hypothesis ====
 +
 
 +
The Spectro sensor has good correlation with turbidity.
 +
 
 +
==== Action Items ====
 +
 
 +
- Set up the sensor with sensor case without diffuser, fixed the sensor at highest height of the stand.
 +
 
 +
- Prepare the black PLA+ tray
 +
 
 +
- Prepare different turbidity solution, using the turbidity meter to remeasure the concentration of the solution.
 +
 
 +
- Using subtracting method to get the spectra DN output readings from the sensor. The final reading was achieved by averaging six readings.
 +
 
 +
- Repeat the above process for five different solutions, collect the data and analysis the data.
 +
 
 +
==== Result ====
 +
 
 +
The average spectra were taken as average of 6 readings.
 +
 
 +
<gallery>
 +
File:220224.png|
 +
</gallery>
 +
 
 +
The normalized response (DN at specific channel/average of 18 channels total DN) of the reading at 860nm is selected to show the correlation due to turbidity is found to be more sensitive in NIR band:
 +
 
 +
<gallery>
 +
File:240524.png|
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
It can be seen that both model can achieve good correlation with turbidity (>95%). However, since the sample size is quite small (n=5) and we were testing against standard turbidity solution( which consist of white particles which tend to have better reflection properties than the normal environment sample),  we would need to extend our dataset to larger scope to verify our model.
 +
 
 +
== FOV - 29/02/2024 ==
 +
 
 +
We are worried the edge of the sensor case is too small that would affect the measurement reading.
 +
 
 +
==== Hypothesis ====
 +
 
 +
Our reading would be impacted by the field of view due to wrong design of the sensor case
 +
 
 +
==== Action Items ====
 +
 
 +
For upward Sensor:
 +
 
 +
- Take off the lid from top of the sensor case, take the measurement from the upward sensor facing the office light
 +
 
 +
- Normalized spectra and compare the result with previous readings.
 +
 
 +
For downward Sensor:
 +
 
 +
- Fix the sensor with the pole at 20 cm and 40cm.
 +
 
 +
- Prepare different settings include: with original case, with ground glass diffuser, with white diffuser and without any casing.
 +
 
 +
- Observe the lighting pattern and compare the results.
 +
 
 +
==== Result ====
 +
 
 +
The Upward Sensor:
 +
 
 +
<gallery>
 +
File:290224-1.png|
 +
</gallery>
 +
 
 +
The Downward Sensor:
 +
 
 +
<gallery>
 +
File:290224-2.png
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
The result shows very similar readings, major difference observed for wavelength ranging from 550-600 nm. This result would indicate that the field of view didn’t been effected by the size of the cover when not using LED. Further test may need to be done for the downward sensor.
 +
 
 +
As for the downward sensor, it can be seen that the field of view is impacted by the current case design. The ground glass diffuser for now looks work better than the white diffuser based on the criteria that we want the light to be concentrated and bright. The next step would be expand the size of the sensor case.
 +
 
 +
== Disturbance Effect - 13/03/2024 ==
 +
 
 +
This experiment we would like to see whether the disturbance of the measurable water would affect the sensor reading or not.
 +
 
 +
==== Action Items ====
 +
 
 +
- Fix the sensor at 175mm from the water surface using 3D printing stand.
 +
 
 +
- Prepare the sensor without lens cover without diffuser.
 +
 
 +
- Prepare turbidity solution with 50NTU,330NTU and 1000NTU.
 +
 
 +
- Measure the response when the turbidity is stable (wait 3 mins) or Shake the turbidity solution with hands.
 +
 
 +
- Take average readings for 6 spectra measurements and compare the data.
 +
 
 +
==== Result ====
 +
 
 +
The data has been normalized and shown below:
 +
 
 +
<gallery>
 +
File:Disturb130324-888NTU.png|888NTU
 +
File:Disturb130324-334NTU.png|334NTU
 +
File:Disturb130324-47NTU.png|47NTU
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
From the result, it can be seen that the results tend to be stable from 410 to 510 nm, and 700-940nm. Relatively large fluctuation was observed around 510 - 700nm, especially at 47 NTU and 334 NTU.
 +
 
 +
This zone tend to be green, yellow, orange and red zone.  The hypothesis for now is when the turbidity concentration is low, when the water is disturbed, the spectra is highly likely being affected by the reflection of the bottom of the testing tray. When the turbidity increase, the sensor mainly receive signal from particle itself, which would tend to get more stable and match data.
 +
 
 +
== FOV - 08/04/2024 ==
 +
 
 +
==== Hypothesis ====
 +
 
 +
The FOV is changing together with the increasing of height
 +
 
 +
==== Action Items ====
 +
 
 +
- Select big enough object  —- Green grass and the concrete has been selected.
 +
 
 +
- Change height (10cm, 50cm, 100cm)
 +
 
 +
- Take 5 readings, get the average spectra and compute the normalized spectra based on the average spectra reading.
 +
 
 +
- Observe normalized average readings
 +
 
 +
==== Result ====
 +
 
 +
<gallery>
 +
File:040824-Grass.png | Spectra measure over grass
 +
File:040824-Concrete.png | Spectra measure over concrete
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
From the result, it can be seen that generally the normalized response for different heights were kept roughly same for grass and slight difference observed for the concrete. Two normalized spectra indicate that the sensor can still receive valuable signal within 1m height.
 +
 
 +
This means if FOV is large enough, the height shouldn’t affect the sensor readings. This means previous settings have limited the FOV, which we should aim for a larger tray or limit the ROI.
 +
 
 +
Next step would be to compute what the actual FOV area would be based on the information from the datasheet.
 +
 
 +
== FOV - 09/04/2024 ==
 +
 
 +
We are worried the edge of the sensor case is too small that would affect the measurement reading. Previous V2 experiment has verified that the height shouldn’t have huge impact on the sensor readings. So now we would like to investigate what the actual field of view of the sensor is.
 +
 
 +
==== Hypothesis ====
 +
 
 +
Our reading would be impacted by the field of view
 +
 
 +
==== Action Items ====
 +
 
 +
- Modelling the potential field of view area using the shaper 3D. (Scale 3x in shaper 3D)
 +
 
 +
- Record the area for the FOV
 +
 
 +
- Find the regression curve which we could use for the future analysis.
 +
 
 +
- Do quick test to verify the findings.
 +
 
 +
 
 +
==== Result ====
 +
 
 +
Result:
 +
<gallery>
 +
File:Spectra290424.png|Test for 100mm height FOV
 +
File:040924-4.png|Test for 200mm height FOV
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
From the result, it can be seen that when the object is within the FOV (middle position), it generally distinguished from other spectra, this is what we want, as this quick test partly
 +
 
 +
== Comparison With Commerical HSI - 25/04/2024 ==
 +
 
 +
We would like to investigate how is our data quality when compared to the commercial sensor
 +
 
 +
==== Hypothesis ====
 +
 
 +
We hypothesis that our sensor output can achieve similar spectra with commercial sensor (+/- 10%)
 +
 
 +
==== Action Items ====
 +
 
 +
- Set up testing Frame in the WISE Lab both for low-cost sensor and the commercial MV/X Camera
 +
- Setting up the testing object within the FOV ( Note: Distance for low-cost sensor and MV.X camera to the object is different)
 +
- The testing objects are: 1) Orange lid, 2) black tray 3) brown small card box 4) White Paper 5) White Reference Panel 6) Dark Reference
 +
- For low-cost sensor, the integration time is setting as 100 digital number, and the non-led reading is taken and final reading is taken as the average of 6 readings.
 +
- The normalized value is calculated using the following formula:
 +
 
 +
$$
 +
normalized value = (Sensor Reading - Dark Reference)/(White Reference - DARK Reference)
 +
$$
 +
 
 +
- The MV.X readings is taken by Pierre
 +
 
 +
==== Result ====
 +
 
 +
 
 +
<gallery>
 +
File:250424.png|Comparison with HSI
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
The first trail between low-cost and commercial one is beyond my expectation. From the last graph, we could observe that generally, after the normalization, the low-cost sensor could capture the key spectral feature especially between 450-700 nm range with roughly 10% error.
 +
 
 +
However, as mentioned per Pierre’s analysis, is quite strange that the low-cost sensor is capturing the spectral readings in the NIR range ( 750-900nm). Which shouldn’t be the case as we are using the office lighting as the light source, which did not emit any NIR photons. This would need further investigation.
 +
 
 +
Also, some potential thinking that could improve our data quality might be:
 +
 
 +
1) Put in the dark environment to avoid ambient light effect
 +
 
 +
2) Clean the white reference panel for a better data acquisition and normalization ( this trail test we did not clean it before measurement)
 +
 
 +
3) Consider the height effect?
 +
 
 +
4) Investigate the reasons for getting the NIR readings for low-cost sensor.
 +
 
 +
== FOV - 29/04/2024 ==
 +
 
 +
To prove the hypothesis from FOV we did before
 +
 
 +
==== Hypothesis ====
 +
 
 +
The FOV is same as we found from previous simulation.
 +
 
 +
==== Action Items ====
 +
 
 +
- Putting the whole setup in the dark environment.
 +
 
 +
- Shine the LED to take measurements, record the raw readings with and without LED.
 +
 
 +
- Prepare paper with black circle in the middle just match the size of the hypothesis size.
 +
 
 +
- The hypothesis size is taken as the equivalent circle of the previous simulated area. For 160mm height, the diameter is 136mm, 100mm height is 90mm.
 +
 
 +
- Two sets of size have been prepared: For highest setup (160mm height), the size is 200mm,167mm,136mm,100mm,50mm and 20mm.
 +
 
 +
- For another setup (100mm height), the size is 167mm, 100mm, 90 mm, 50mm and 20mm.
 +
 
 +
- The final spectra was obtained by using the LED spectra minus the spectra without LED to account for the sensor noise itself caused. Final spectra was taken as the average of 6 readings.
 +
 
 +
<gallery>
 +
File:Experiment setup290424.png|
 +
</gallery>
 +
 
 +
==== Result ====
 +
 
 +
 
 +
<gallery>
 +
File:Spectra290424.png|Test for 100mm height FOV
 +
File:Spectra290424-1.png|Test for 160mm height FOV
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
According to previous simulation, when the height is at 100 mm, the FOV would equivalent to a circle with 90mm diameter. So look at the 90mm, theoretically, spectra for circles larger than or equal to 90mm should have same spectra. Generally, the result matches this theory, with small offset observed at 460nm and around 650nm. For the circle within the FOV (<90mm), obvious difference observed for 50mm diameter circle and 20mm diameter circle.
 +
 
 +
When look at higher height (160mm), according to the function, the FOV should be 136mm. Spectra for circles larger than or equal to 136mm should have same spectra. This is generally true as well, while offset also observed at 460nm and 650nm. For the circles within the FOV (<136mm), difference can be observed for 100mm, 50mm and 200mm diameter circle.
 +
 
 +
In conclusion, this black circle test could prove our hypothesis that the FOV proposed previously is correct and we should take further steps to account for this FOV issue. There are two ways to solve it: 1) Develop complex optical system to narrow down the FOV 2) Develop a buoy system that the sensor will be kept at a relative constant height against the water surface. Both options would be explored.
 +
 
 +
== Bottom Effect V1- 21/05/2024 ==
 +
 
 +
To investigate how the bottom surface might affect spectra readings, we conducted a series of tests to further understand this issue.
 +
 
 +
==== Hypothesis ====
 +
 
 +
The bottom would affect the spectra readings if the water surface is shallow or if the turbidity level is low.
 +
 
 +
==== Action Items ====
 +
 
 +
-Put the sensor under a black curtain (in a dark environment), and fix it with the testing stand.
 +
 
 +
-Set up a plastic grey cup within the Field of View (FOV) of the sensor.
 +
 
 +
-Fill the environment samples Pierre brought in (Tested with Turbidity Meter: NTU=70) to the level of 4cm to 9cm, with 1 cm intervals counted from the bottom.
 +
 
 +
-Take LED readings minus background readings to get the final spectra.
 +
 
 +
==== Result ====
 +
<gallery>
 +
File:Bottomeffectspectra.png
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
The results indicate that the bottom surface significantly impacts the spectra readings, especially when the water surface is shallow. This is consistent with the hypothesis, as light reflection and absorption from the bottom alter the readings. Further adjustments may be required to mitigate this effect in field applications.
 +
 
 +
In conclusion, this experiment confirms that the bottom can affect spectra readings under certain conditions. To minimize this issue, potential solutions include adjusting the sensor placement or developing a method to compensate for these variations.
 +
 
 +
== Bottom Effect V2 - 23/05/2024 ==
 +
 
 +
In this test, we continue to investigate the bottom effect on the sensor readings and explore methods that can address this issue. To avoid sensor receive a lot of specular reflection, we tested using a separate LED set at a 45-degree angle along with the sensor to increase the diffuse reflectance and evaluate its performance.
 +
 
 +
==== Hypothesis ====
 +
 
 +
The bottom would affect the spectra readings, and using a side LED can help mitigate the effects.
 +
 
 +
==== Action Items ====
 +
 
 +
-Place the sensor under a black curtain (in a dark environment) and secure it with the testing stand.
 +
 
 +
-Set up a side LED mounted at a 45-degree angle relative to the sensor.
 +
 
 +
-Set up a plastic grey cup within the Field of View (FOV) of the sensor.
 +
 
 +
-Fill the environment samples provided by Pierre (Tested with Turbidity Meter: NTU=70) to the levels of 4cm, 6cm, and 8cm from the bottom.
 +
 
 +
-Take LED readings minus background readings to get the final spectra.
 +
 
 +
<gallery>
 +
File:BottomV201.jpg|Experiment setup for Bottom Effect - V2
 +
</gallery>
 +
 
 +
==== Result ====
 +
 
 +
<gallery>
 +
File:Bottomv202.png|The normalized result when using up LED
 +
File:Bottomv203.png|The normalized result when using side LED
 +
</gallery>
 +
 
 +
==== Conclusion ====
 +
 
 +
The results indicate that the use of a side LED can mitigate the effects of the bottom surface on the spectra readings. The setup demonstrates that a 45-degree angle placement can reduce interference caused by reflection and absorption from the bottom, especially in shallow water conditions. Further testing is recommended to optimize this setup and explore its effectiveness across different environments.
 +
 
 +
== Bottom Effect V3 - 24/05/2024 ==
 +
 
 +
In this test, we continue to investigate the performance when the LED is separated. We also tested changing the bottom color to see whether the bottom effect has been eliminated.
 +
 
 +
==== Hypothesis ====
 +
 
 +
Changing the bottom color won’t affect sensor readings when using the side LED settings.
 +
 
 +
==== Action Items ====
 +
 
 +
-Put the sensor under a black curtain (in a dark environment) and fix it with the testing stand.
 +
 
 +
-Set up a side LED mounted at a 45-degree angle relative to the sensor.
 +
 
 +
-Set up a plastic grey and green cup within the Field of View (FOV) of the sensor.
 +
 
 +
-Fill the environment samples provided by Pierre (Tested with Turbidity Meter: NTU=70). The level has been fixed at a maximum height (around 8cm from the bottom).
 +
 
 +
-Take LED readings minus background readings to get the final spectra.
 +
 
 +
<gallery>
 +
 
 +
File:Bottomv301.jpg|Cup with black bottom
 +
File:Bottomv302.jpg|Cup with green bottom
 +
</gallery>
 +
 
 +
==== Results ====
 +
 
 +
The normalized response when using the normal LED is shown below:
 +
 
 +
<gallery>
 +
File:Bottomv303.png|Normalized response using normal LED
 +
</gallery>
 +
 
 +
The normalized response when using the side LED is shown below:
 +
 
 +
<gallery> File:Bottomv304.png|Normalized response using side LED </gallery>
 +
==== Discussion ====
 +
 
 +
From the results, it can be seen that the up LED still has an uncommon peak feature versus the side LED, which matches the previous LED feature. Although the up LED presents closer results compared to the side LED, the orange bottom would still affect the sensor readings, even when using the side LED. This suggests that the current setup is still affected by the bottom surface.
 +
 
 +
== August Sampling Campaign - 01/08/2024 ==
 +
 
 +
==== Aim ====
 +
 
 +
We plan to conduct this sampling campaign to collect different wastewater/stormwater samples from different sites to test the potential of low-cost spectrophotometer for water quality monitoring purpose.
 +
 
 +
==== Sensor Case ====
 +
 
 +
For this experiment, I have come up with some new designs suit for lab analysis purpose. The sensor case is shown as follows:
 +
<gallery>
 +
File:Spectrosensor.png| Side view of the sensor
 +
File:Spectrosensorcup.jpg| Sensor Cup
 +
</gallery>
 +
As can be seen from the picture, now the device has five AS7265X boards in total. The middle one is the receiver sensor which is only used for receiving the light signal reflected back from the water surface. The surrounded four sensors are used to provide enough lighting (White, UV and IR) during the experiment. All these sensors are connected to Sparkfun Qwwic Mux Breakout to allow the BoSL Board can communicate with different sensors which have same I2C address.
 +
 
 +
==== Sampling Sites ====
 +
 
 +
During this sampling campaign, we have grab samples from four different sites, which three of them are wastewater treatment plant sites: Koo Wee Rup (KWR), Bling Bight (BB) and Pakenham (PAK), and with one stormwater site: Troups Creek Wetland. For each site, we have grab 50 samples using HACH autosampler. The autosampler is set up to collect samples at pre-determined time interval across different time frames. Some of them is collected during daytime with 1hr interval. Some of them is collected for whole day with two hour interval. The general idea of this is to extend the dataset varibility as much as possible. The picture shown below is some illustrations of the sites we did.
 +
 
 +
<gallery>
 +
File:KWR.jpg|KWR Site
 +
File:BB.jpg|BB Site
 +
File:PAK.jpg|PAK Site
 +
File:TC.jpg|TC Site
 +
</gallery>
 +
 
 +
==== Lab Analysis ====
 +
 
 +
After collecting the samples from the above mentioned sites, all the samples were brought back to the lab for further analysis, we have did the following measurements for all the samples:
 +
 
 +
Turbidity
 +
 
 +
EC and Temperature
 +
 
 +
Absorbance
 +
 
 +
TSS, TP, TN
 +
 
 +
NH4 and DOC
 +
 
 +
Image
 +
 
 +
MV.X Hyperspectral Camera Reading
 +
 
 +
Low-cost Multispectral Sensor Reading
 +
 
 +
==== Turbidity Analysis - Raw Data ====
 +
 
 +
The reference turbidity reading is acquired by commercial turbidity meter. For each sample, we take 20 readings using our low-cost spectrophotometer. Therefore, we are interested to see what method we can use to extract the neccssary information we need. Do we need all 20 readings of data? Or do we need only one readings? Should we simply calculate the average readings of all 20 readings, or we can try some more advanced technique like Kalman Filter? Which can count the errors during measurement, and adjust itself throughout the process. The pucture below shows a typical readings for a sample with turbidity value of 209.5 NTU
 +
 
 +
<gallery>
 +
File:Example of turbidity readings = 209.5.png
 +
</gallery>
 +
 
 +
As can be seen from this graph, the dot points shows that for relatively high turbidity values (around 200NTU), there are variations for continuous 20 readings. This make sense as particles tend to settle down, which will leave the particle further away from the water surface thus reduce the light intensity that sensor can receive. As for using the average and Kalman Filter, it is very similar in our case. So we will continue with average readings for now. But the author suggest the Kalman Filter might have better performance when we go for the field test.
 +
 
 +
==== Turbidity Analysis - PLS model ====
 +
 
 +
As we have 18 channels of readings, we cannot simply use all 18 channels to perform multivariate regression as we will have issue with collinearity. If two or more bands already have correlation with each other, the increase in one band will already cause the increase in the other band, which will bias the performance of the multivariate regression. To solve this issue, we start to think of using PLS model to solve this problem. In order to find the optimal number we need, we will change the number of components for PLS model ranging from 1 to 18, and using K-fold cross validation method (k=5) to test its performance. The matrix we are using here is R2 and RMSE value, the result is plot as follows:
 +
 
 +
<gallery>
 +
File:PLSresult.png
 +
</gallery>
 +
 
 +
From the graph, we can see that when only using 1 band, the RMSE is pretty high with low R2 as well. When we use more bands, the performance start to getting better. The optimal band is around 12 bands, the model can reach near optimal performance, so we will keep 12 components for PLS model and running the model to see its performance for predicting turbidity value. The result is shown as follows:
 +
<gallery>
 +
File:PLSresult1.png
 +
</gallery>
 +
 
 +
As can be seen from the graph, the PLS model have very good prediction capacity for turbidity. This match the expectation as the turbidity is optical sensitive parameter, so our low-cost sensor would be able to capture its change. This results prove the potential of our low-cost spectrophotometer. For now the result is taken under lab condition. Our next step is to bring the sensor to the field to further test its performance.

Latest revision as of 23:06, 18 December 2024

We have come up with a great idea to implement a low-cost spectroscopy sensor to measure various water quality parameters. The Sparkfun AS7265x spectroscopy sensor is introduced here (around AUD 60-100). It has three LEDS (VIS,UV,IR) which can measure the intensity for the wavelength ranging from 410nm to 940 nm. We would like to investigate any potential application with this sensor...

Contents

Video Introduction

We have introduced a confirmation recording here to quickly summarize the overall progress of multispectral sensor:



10/01/2023

Firstly, we hava come out an initial design for holding the sensor, and we use the clip to mount it to a vertical surface to do some preliminary tests.A black cup is 3D printed to store the water for measurement purpose.

It is good to know what roughly the spectroscopy for the water would be under low turbidty level. It can be seen that the sensor didn't receive much reflection for frequency between 710nm and 940nm.

25/01/2023

After the first design, we have come out some updated version for the stand that can hold the sensor instead of mounting to a cardbox. Now both the sensor and cup can be located in fixed position.And we have changed the colour of both cup and stand to be black to minimize the potential background noise.

This time we have using some different turbidty solution to measure the spectroscopy at each turbidty level.It can be seen that some correlation might exist at certain frequency (such as 610nm).

01/02/2023

Today,we bring all the equipment to the wet lab and would like to test again with same turbidty solution, while we have found something interesting:

It can be seen that large variation existed for the same measurement sample. We start thinking this might because of the light problem as the light in two rooms are different. And for now we just take one measurement reading with all LEDS on the sensors once to obtain the data. With strong light, the sensor might not be able to receive the correct reflection from the surface. So we need to get some improvements for our code to count for the background noise effect.

01/02/2023

We have modified our code to include a initial scan without using LEDs, this spectroscopy reading is later used as background reference.For now, we try to use the spectroscopy that got with all LEDs minus the spectroscopy that got without LEDs to get our final spectroscopy. We have selected three test locations:

1) Office (Normal Light Condition) 2) Wet lab (Strong Light Condition) 3)Table outside the office (Slight Light Condition)

The results looks pretty good as the spectroscopy obtained at different locations are very close to each other, the background noise has been reduced.


Later, we have also let the sensor stands on different surface to see whether this will affect the spectroscopy of the detected object. The surface we selected are:

1) Office Desk (White Surface) 2) Laptop (Grey Surface) 3) IOT Poster (Colourful Surface)

The spectroscopy obtained from three different back surfaces aligned well with each other. Now we would like to continue testing the water with different turbidty level again.

16/02/2023

Today we have found that the sensor case we designed originally is not aligned in the middle of the black cup. We have modified our design for both the sensor case and stand:

This stand have two trenches that we can adjust the sensor height in the future while maintain its stay in horizontal surface. And the arduino board has been locked on the top of the stand. A pre-cut circle surface is designed at the bottom of the stand that can fit the size of the cup,so that we can easily get the black cup out and in, making the filling progress more easier:

With this new design, we have tested it with all the turbidty solution again:

09/03/2023

We have modified the container up to a black square box to maximize its capacity for carrying water.

Also, we have updated the sensor reading function, now the sensor can read the spectroscopy information from White, IR, UV and All LEDs together separately. This could help us better understand how different objects behaves to different LEDs).

For the experiment settings, we have added cardboard as the cover when we do the experiment to eliminate the effect of other light resources.

Four different turbidity solutions (60NTU, 100NTU, 200NTU, 400NTU) has been tested after five minutes settle time.The results (average of 6 times reading) are shown as follows:

16/03/2023

We have extended our reference turbidity sets to a larger level:

Turbidity Values
Low Turbidity Level 0,0.61,0.68,1.23
Mid Turbidity Level 25,50,55.5,75,108
High Turbidity Level 199,300,393

We have then followed the same experiment procedure and have obtained the spectroscopy for the above 12 turbidity levels. After got the spectroscopy, we have started to look at if there is any correlation existed between turbidity level and normalized signal value.

White Light:

UV Light:

IR Light:

All LEDs:

For the IR, we didn't get any good correlation curve so it has been eliminated from the model.

After establish a few relationship curve ( overall above 90% for turbidity ranging from 0 to 300 NTU), We have started to establish a initial prediction model to see if we can predict the turbidity level:

LEDs Wavelength Regression Curve
White 485 nm y= 34.431x-342
UV 410 nm y= 4.7096x-249.06
UV 435 nm y= 24.651x-231.34
All 435 nm y= 16.582x-303.02
All 485 nm y= 32.224x-340.19

Later we have brought three water samples from Troups Creek Retention pond to see if we can actually predict the turbidity level, the output value are compared with the reference value that obtained from the Thermo Scientific Turbidity Sensor (ORION A14500), the results are shown as follows:

From the result here, it can be seen that the best predict regression curve is using white LED at 485nm, with uncertainty generally under 30%. For some instance, the model could able to predict good turbidity level (the one marked as green), but it didn't occurred constantly under same LED condition. It is suggest further dataset might be needed to be fit into the predict model, and it needs to come up with a way that can reduce the uncertainty caused by the sensor.

23/03/2023

In this week, we would like to test the impact of light (with or without cover box) and the impact of different height (the distance from the water surface)

Impact of Light

Experiment Setup

The experiment is conducted with and without cover box after 5-mins setting up time.

6 different turbidity solutions were used:

Turbidity Values
Low Turbidity Level 0
Mid Turbidity Level 50,75,100
High Turbidity Level 199,300

Result

The results shown here are calculated based on the difference between without case value with with case value.

The grey block shows the 5 reference points we selected previously.

The yellow blocks shows some new value which comes out when we did not use the cover.

Conclusion

Overall, when look at the 5 reference points, the difference is not significant ( error rate < 20%). This result is not so bad as the sensor itself has around +/-12% accuracy (https://www.sparkfun.com/products/15050).

Except for those extreme error points(100% error rate), overall, the error is under 35% when turbidity under 100 NTU and under 50% when turbidity ranging from 100 to 300 NTU.

Impact of Height

Experiment Setup

The height defined here is referring to the height from the water surface to the edge of the sensor case. The height for previous experiment is 95mm.

The experiment is conducted with cover box after 5-mins setting up time.

We have conducted another two height at 35mm and 135mm (the minimum and maxmimum value we could reach for current stand). 6 different turbidity solutions were used:

Turbidity Values
Low Turbidity Level 0
Mid Turbidity Level 50,75,100
High Turbidity Level 199,300

Result

5 Reference Points:

LEDs:

Conclusion

When look at the 5 reference points, it can be seen clearly that better correlation relationship can be achieved when the height increased.

When look at each LED individually, better correlation could be achieved at lower wavelength if the height is increased.

Generally, the best relationship is still achieved at higher height (correlation above 97% for White, UV and All LEDs with height of 135mm).

30/03/2023

In this week, we would like to continue test the impact of light (with or without cover box) and the impact of different height (the distance from the water surface)

Impact of Light

Experiment Setup

The experiment is conducted with and without cover box after 5-mins setting up time for same turbidity solution.

6 different turbidity solutions were used:

Turbidity Values
Low Turbidity Level 0
Mid Turbidity Level 50,75,100
High Turbidity Level 199,300

Result

The results shown here are box plot for White, UV and all LED conditions.

Conclusion

Overall, the variation between with and without cover is not very significant.

Generally, when look at all LEDs and White LED, with-cover readings tend to be larger than the without-cover readings. For the UV LED only, the difference is not significant.

Impact of Height

Experiment Setup

The height defined here is referring to the height from the water surface to the edge of the sensor case.

As we would like to explore the how high the sensor could be able to provide valuable data, a 1000 mm long bar was used, thus no cover was used in this experiment.

The experiment is conducted after 5-mins setting up time for each turbidity solution.

We have conducted in total five different heights ranging from 25mm (Just above the water surface and 725mm:

Height 25,225,425,625,725 (mm)

3 different turbidity solutions were used:

Turbidity Values
Low Turbidity Level 0
Mid Turbidity Level 100
High Turbidity Level 300

Result

The results here were analyzed using coefficient of variation for each turbidity and individual LED condition. Then the average coefficient of variation value were taken by average all the readings at certain depth.

The results are shown here:

Coefficient of Variation Values
25mm 1.86
225mm 1.48
425mm 1.49
625mm 1.59
725mm 1.61

It can be seen that when the sensor is very close to the water surface, the variation is very huge, thus hard to find the potential depth relationship, by remove the 25mm value for now, and use the rest value to plot a regression curve, the depth relationship can be found as:

Depth Relationship - 300323.png

Conclusion

This result could illustrate the potential of using spectrometer sensor as a depth sensor. More height experiments are needed to further approve this concept.

07/05/2023

During the past period, we were aiming to investigate the potential of using two spectrometer sensors to see whether it can increase the accuracy of our data. The Sparkfun Qwwic Mux port is used to connect two Sparkfun AS7265X spectrometer sensors.

Experiment Setup

The experiment is conducted without cover box at 95mm height after 5-mins setting up time for same turbidity solution. The set up configuration is shown as below:

Dual Spectro Setup.jpg

For the first trial, the angle between two spectrometer sensors is set as 90 degree.

5 different turbidity solutions were used:

Turbidity Values
Low Turbidity Level 0
Mid Turbidity Level 50,75,100
High Turbidity Level 199

Result

The spectroscopy graph of White LED is shown as follow and the best correlation relationship between turbidity level and normalized sensor reading can be found at 460nm wavelength.

The spectroscopy graph of UV LED is shown as follow and the best correlation relationship between turbidity level and normalized sensor reading can be found at 410nm wavelength.

The spectroscopy graph of All LEDs is shown as follow and the best correlation relationship between turbidity level and normalized sensor reading can be found at 860nm wavelength.

Conclusion

From the result, it can be shown that the dual Spectrosensor can get the better correlation relationship up to 97% for UV / White and All LEDs condition.

For the next experiment, we will adjust the angles between two sensors to let it have good reflectance over the water surface.


18/05/2023

Following the last experiment, we would like to continue investigate more parameters which may affect the spectrophotometer. In this experiment, we have adjusted the angle between two sensors and would like to let the receiver sensor can receive the light that sender sensor emitted reflected back from water surface.

Experiment Setup

The experiment is conducted without cover box at 90mm height after 5-mins setting up time for same turbidity solution. The set up configuration is shown as below:

The angle between two spectrometer sensors is therefore set as 130 degree.

5 different turbidity solutions were used:

Turbidity Values
Low Turbidity Level 0
Mid Turbidity Level 50,75,100
High Turbidity Level 199

Result

The spectrum graph of White LED is shown as follow and the best correlation relationship between turbidity level and normalized sensor reading can be found at 560nm wavelength.

The spectrum graph of UV LED is shown as follow and the best correlation relationship between turbidity level and normalized sensor reading can be found at 410nm wavelength.

The spectrum graph of All LEDs is shown as follow and the best correlation relationship between turbidity level and normalized sensor reading can be found at 645nm wavelength.

Conclusion

From this experiment, the correlation we get from White, UV and All LEDs is not good as before, with 79%, 72% and 96%, respectively.

While look at the spectrum, it can be seen that the resolution get from this experiment is also worse than before.

15/01/2024

Before continue to explore full capbility of the module, the settings and performance of the sensors have been re-assessed. From user guide, the user could be able to change:

Measurement Mode: 6 Chan One Shot (Default), this generally take readings from six out of six photodiodes from each sensor, which suit for our purpose.

Gain:64X (Default), this value can be up to 64X if value from the sensor are exceeded the limit.

Integration Time: integer input ranging from 0 to 255, 1 integer equals to 2.8ms. Increase 1 integer can increase 1024 sensitivity. To reach maximum sensitivity of the sensor (65545), the integer of the integration time needs to be at least 49.

Light Source:User can choose to use LED or not use LED.

Function: User can choose to use Raw reading function or Calibrated reading function. Since the calibrated function needs to be performed within certain condition, which is not suit for our purpose, the raw reading function is used for future development.

16/01/2024

Next, we would like to let the sensor capable of recording the spectra without using LED under office light or sunlight condition. This step can help for further sensor calibration.

Experiment Setup

Settings Input
Integration Time Integer(cycles) 49
Measurement Mode 6CHAN_ONE_SHOT
Light Source Non-LED
Function Example 4 (reading Raw Values) from library.
Gain 1X
Location Office Desk

Result

A B C D E F G H R I S J T U V W K L
5 39 16 0 79 0 109 142 143 91 8 4 7 4 15 4 1 1

Conclusion

From this experiment, it can be seen that 0 values occured at D (485nm) and F (535nm), we need further research to solve this problem.

22/01/2024

To figure out why the zero occured, the integration time is first reason we could think about. So we start to add delay after the measurement function and before the serial.print to see what happened.

Experiment Setup

Settings Input
Integration Time Integer (cycles) 49
Measurement Mode 6CHAN_ONE_SHOT
Light Source Non-LED
Function Example 4 (reading Raw Values) from library.
Gain 64X
Location Office Desk

Result

When the delay less than 72ms:

A B C D E F G H R I S J T U V W K L
5 40 17 0 80 37 112 143 142 91 9 5 7 4 15 4 1 1

When the delay at 100ms:

A B C D E F G H R I S J T U V W K L
5 39 16 52 79 34 109 142 143 91 8 4 7 4 15 4 1 1

Conclusion

From this experiment, we found that when adding certain time of delay, the zero problem get solved. We hypotheisted that the sensor needs to take some time to complete the spectra conversion. Further work is required to verify this hypothesis.

29/01/2024

The zero issue has been re-assesed. We started to create an array to store first 20 readings from same channel output to see what will happened. This step was repeated for all 18 channels.

Experiment Setup

Settings Input
Integration Time Integer (cycles) 49
Measurement Mode 6CHAN_ONE_SHOT
Light Source Non-LED
Function

File:Zero-issue-verification.ino

Gain 64X
Location Office Desk

Result

After 20 interations, we found that for channel D,F,R,J,W,L. The zero was observed for first 3-5 cycles of reading, after that, we can get stable readings. For remaining 12 channels, we can get good readings from the beginning.Therefore, for this six channels, we started to use millus() function to record the time it needs from take measurement until record the data, the result is shown below:

It can be seen that for all these 6 channels, it generally required 80-90 ms to shown the data. Thus, we re-investigate the user guide and found this is related to the spectral conversion of the data itself:

thumb{left

All these 6 channels all within 2nd conversion zone of the sensor, which means they will need 2 * integration time to complete data conversion. For an integration time integer of 49, this means it will require (49+1)*2.8*2 = 280 ms at least. We use millus() to record the time that "takeMeasurement()" required, which is 225ms, this means it generally require extra 55 ms to complete spectral conversion, the recorded time is generally 30ms larger than the calculated time difference. That's why the zero readings will occur.

To verify our findings, we also tried smaller integration time (integration time integer 29):

We could observe similar trend that for integration time intger of 29 ( integration time is 84ms), the time for measurement takes 140ms, thus 2*integration time (84ms) - 140 would come out 28ms. The results suggest the similar conclusion as above that the sensor needs 30ms + calculated time difference.

A second Way of verify this is simply change the output order from the example, originally is from A to L as shown below:

A,B,C,D,E,F,G,H,R,I,S,J,T,U,V,W,K,L

We re-order this and let and let that 6 channels to be the last, it become:

A,B,C,E,G,H,I,S,T,U,V,K,D,F,R,J,W,L

We will observe:

A B C D E F G H R I S J T U V W K L
18 45 247 0 108 0 183 241 559 205 146 132 25 17 21 10 11 5
A B C E G H I S T U V K D F R J W L
19 44 232 107 182 235 215 148 25 16 21 10 183 92 563 138 10 4

This matches what we want as it allows more time for the sensor to complete data conversion.

Conclusion

The above two ways of experiments verify our hypothesis that the sensor needs double integration time to complete spectral conversion. This time increases when the integration time increases. Re-order the output matrix is suggested for future data processing.

18/02/2024

After fixing the zero-issue, now we begin from investigating the effect from different light sources. We re-do the experiments in a more systematic way.

Experiment Setup

Settings Input
Integration Time Integer (cycles) 49
Measurement Mode 6CHAN_ONE_SHOT
Light Source Non-LED and LED
Function
Gain 64X
Location Office Desk / Dark Environment / Sunlight

The experiment set-up is shown as follows:

Result

The average spectra were taken as avaergae of 10 readings.

The results obtained under different light conditions are:

Conclusion

It can be seen that under the office light and dark environment, very similar spectra can be obtained by using the substracting method. While for sunlight condition, the counts received by the sensor is much larger than other conditions. We might need to introduce dual sensor ( one facing up and one facing down) to solve this issue.

20/02/2024

Previous Experiment found the substracting method works well in moderate light condition as well as dark condition. While under sunlight, this method is invalid. We would like to change some of the sensor settings to see if we could get similar spectra.

Hypothesis

The light effects can be counted by subtracting the background noise or accounting for the sunlight irradiance to get similar spectra with spectra got with office light or dark environment.

Action Items

- Set up a completely dark environment and under office light Condition , prepare the sensor case without diffuser.

- Set up the sensor case without diffuser under the direct sunlight.

- Set up Purple Card

- Fix the sensor at certain height. (e.g. 75mm from the water surface from previous experimental settings)

- Shining the object without using LED, record the Raw DN output from the sensor (Default Settings), take 6 readings and take average spectra.

- Shining the LED for the object, record the Raw DN output from the sensor (Default Settings), take 6 readings and take average spectra.

- Letting One sensor facing up towards the sun and record the raw DN output from the sensor (Default settings), take 6 readings and take average spectra.

- Using step 5 result minus step 4 result.

- Change integration time and Gain to adjust the sensor DN output.

- Check the difference between various Test Conditions.

Result

The average spectra were taken as avaergae of 6 readings.

Conclusion

From the result, it can be seen that:

Under default settings, the 64x gain would lead to maximum readings (65545), which would lead to 0 output if you using subtracting method.

The sensor output cannot be achieved easily by changing the gain or integration time.

22/02/2024

Explore the potential of using Spectro sensor to detect turbidity in urban water samples.

Hypothesis

The Spectro sensor has good correlation with turbidity.

Action Items

- Set up the sensor with sensor case without diffuser, fixed the sensor at highest height of the stand.

- Prepare the black PLA+ tray

- Prepare different turbidity solution, using the turbidity meter to remeasure the concentration of the solution.

- Using subtracting method to get the spectra DN output readings from the sensor. The final reading was achieved by averaging six readings.

- Repeat the above process for five different solutions, collect the data and analysis the data.

Result

The average spectra were taken as average of 6 readings.

The normalized response (DN at specific channel/average of 18 channels total DN) of the reading at 860nm is selected to show the correlation due to turbidity is found to be more sensitive in NIR band:

Conclusion

It can be seen that both model can achieve good correlation with turbidity (>95%). However, since the sample size is quite small (n=5) and we were testing against standard turbidity solution( which consist of white particles which tend to have better reflection properties than the normal environment sample), we would need to extend our dataset to larger scope to verify our model.

FOV - 29/02/2024

We are worried the edge of the sensor case is too small that would affect the measurement reading.

Hypothesis

Our reading would be impacted by the field of view due to wrong design of the sensor case

Action Items

For upward Sensor:

- Take off the lid from top of the sensor case, take the measurement from the upward sensor facing the office light

- Normalized spectra and compare the result with previous readings.

For downward Sensor:

- Fix the sensor with the pole at 20 cm and 40cm.

- Prepare different settings include: with original case, with ground glass diffuser, with white diffuser and without any casing.

- Observe the lighting pattern and compare the results.

Result

The Upward Sensor:

The Downward Sensor:

Conclusion

The result shows very similar readings, major difference observed for wavelength ranging from 550-600 nm. This result would indicate that the field of view didn’t been effected by the size of the cover when not using LED. Further test may need to be done for the downward sensor.

As for the downward sensor, it can be seen that the field of view is impacted by the current case design. The ground glass diffuser for now looks work better than the white diffuser based on the criteria that we want the light to be concentrated and bright. The next step would be expand the size of the sensor case.

Disturbance Effect - 13/03/2024

This experiment we would like to see whether the disturbance of the measurable water would affect the sensor reading or not.

Action Items

- Fix the sensor at 175mm from the water surface using 3D printing stand.

- Prepare the sensor without lens cover without diffuser.

- Prepare turbidity solution with 50NTU,330NTU and 1000NTU.

- Measure the response when the turbidity is stable (wait 3 mins) or Shake the turbidity solution with hands.

- Take average readings for 6 spectra measurements and compare the data.

Result

The data has been normalized and shown below:

Conclusion

From the result, it can be seen that the results tend to be stable from 410 to 510 nm, and 700-940nm. Relatively large fluctuation was observed around 510 - 700nm, especially at 47 NTU and 334 NTU.

This zone tend to be green, yellow, orange and red zone. The hypothesis for now is when the turbidity concentration is low, when the water is disturbed, the spectra is highly likely being affected by the reflection of the bottom of the testing tray. When the turbidity increase, the sensor mainly receive signal from particle itself, which would tend to get more stable and match data.

FOV - 08/04/2024

Hypothesis

The FOV is changing together with the increasing of height

Action Items

- Select big enough object —- Green grass and the concrete has been selected.

- Change height (10cm, 50cm, 100cm)

- Take 5 readings, get the average spectra and compute the normalized spectra based on the average spectra reading.

- Observe normalized average readings

Result

Conclusion

From the result, it can be seen that generally the normalized response for different heights were kept roughly same for grass and slight difference observed for the concrete. Two normalized spectra indicate that the sensor can still receive valuable signal within 1m height.

This means if FOV is large enough, the height shouldn’t affect the sensor readings. This means previous settings have limited the FOV, which we should aim for a larger tray or limit the ROI.

Next step would be to compute what the actual FOV area would be based on the information from the datasheet.

FOV - 09/04/2024

We are worried the edge of the sensor case is too small that would affect the measurement reading. Previous V2 experiment has verified that the height shouldn’t have huge impact on the sensor readings. So now we would like to investigate what the actual field of view of the sensor is.

Hypothesis

Our reading would be impacted by the field of view

Action Items

- Modelling the potential field of view area using the shaper 3D. (Scale 3x in shaper 3D)

- Record the area for the FOV

- Find the regression curve which we could use for the future analysis.

- Do quick test to verify the findings.


Result

Result:

Conclusion

From the result, it can be seen that when the object is within the FOV (middle position), it generally distinguished from other spectra, this is what we want, as this quick test partly

Comparison With Commerical HSI - 25/04/2024

We would like to investigate how is our data quality when compared to the commercial sensor

Hypothesis

We hypothesis that our sensor output can achieve similar spectra with commercial sensor (+/- 10%)

Action Items

- Set up testing Frame in the WISE Lab both for low-cost sensor and the commercial MV/X Camera - Setting up the testing object within the FOV ( Note: Distance for low-cost sensor and MV.X camera to the object is different) - The testing objects are: 1) Orange lid, 2) black tray 3) brown small card box 4) White Paper 5) White Reference Panel 6) Dark Reference - For low-cost sensor, the integration time is setting as 100 digital number, and the non-led reading is taken and final reading is taken as the average of 6 readings. - The normalized value is calculated using the following formula:

$$ normalized value = (Sensor Reading - Dark Reference)/(White Reference - DARK Reference) $$

- The MV.X readings is taken by Pierre

Result

Conclusion

The first trail between low-cost and commercial one is beyond my expectation. From the last graph, we could observe that generally, after the normalization, the low-cost sensor could capture the key spectral feature especially between 450-700 nm range with roughly 10% error.

However, as mentioned per Pierre’s analysis, is quite strange that the low-cost sensor is capturing the spectral readings in the NIR range ( 750-900nm). Which shouldn’t be the case as we are using the office lighting as the light source, which did not emit any NIR photons. This would need further investigation.

Also, some potential thinking that could improve our data quality might be:

1) Put in the dark environment to avoid ambient light effect

2) Clean the white reference panel for a better data acquisition and normalization ( this trail test we did not clean it before measurement)

3) Consider the height effect?

4) Investigate the reasons for getting the NIR readings for low-cost sensor.

FOV - 29/04/2024

To prove the hypothesis from FOV we did before

Hypothesis

The FOV is same as we found from previous simulation.

Action Items

- Putting the whole setup in the dark environment.

- Shine the LED to take measurements, record the raw readings with and without LED.

- Prepare paper with black circle in the middle just match the size of the hypothesis size.

- The hypothesis size is taken as the equivalent circle of the previous simulated area. For 160mm height, the diameter is 136mm, 100mm height is 90mm.

- Two sets of size have been prepared: For highest setup (160mm height), the size is 200mm,167mm,136mm,100mm,50mm and 20mm.

- For another setup (100mm height), the size is 167mm, 100mm, 90 mm, 50mm and 20mm.

- The final spectra was obtained by using the LED spectra minus the spectra without LED to account for the sensor noise itself caused. Final spectra was taken as the average of 6 readings.

Result

Conclusion

According to previous simulation, when the height is at 100 mm, the FOV would equivalent to a circle with 90mm diameter. So look at the 90mm, theoretically, spectra for circles larger than or equal to 90mm should have same spectra. Generally, the result matches this theory, with small offset observed at 460nm and around 650nm. For the circle within the FOV (<90mm), obvious difference observed for 50mm diameter circle and 20mm diameter circle.

When look at higher height (160mm), according to the function, the FOV should be 136mm. Spectra for circles larger than or equal to 136mm should have same spectra. This is generally true as well, while offset also observed at 460nm and 650nm. For the circles within the FOV (<136mm), difference can be observed for 100mm, 50mm and 200mm diameter circle.

In conclusion, this black circle test could prove our hypothesis that the FOV proposed previously is correct and we should take further steps to account for this FOV issue. There are two ways to solve it: 1) Develop complex optical system to narrow down the FOV 2) Develop a buoy system that the sensor will be kept at a relative constant height against the water surface. Both options would be explored.

Bottom Effect V1- 21/05/2024

To investigate how the bottom surface might affect spectra readings, we conducted a series of tests to further understand this issue.

Hypothesis

The bottom would affect the spectra readings if the water surface is shallow or if the turbidity level is low.

Action Items

-Put the sensor under a black curtain (in a dark environment), and fix it with the testing stand.

-Set up a plastic grey cup within the Field of View (FOV) of the sensor.

-Fill the environment samples Pierre brought in (Tested with Turbidity Meter: NTU=70) to the level of 4cm to 9cm, with 1 cm intervals counted from the bottom.

-Take LED readings minus background readings to get the final spectra.

Result

Conclusion

The results indicate that the bottom surface significantly impacts the spectra readings, especially when the water surface is shallow. This is consistent with the hypothesis, as light reflection and absorption from the bottom alter the readings. Further adjustments may be required to mitigate this effect in field applications.

In conclusion, this experiment confirms that the bottom can affect spectra readings under certain conditions. To minimize this issue, potential solutions include adjusting the sensor placement or developing a method to compensate for these variations.

Bottom Effect V2 - 23/05/2024

In this test, we continue to investigate the bottom effect on the sensor readings and explore methods that can address this issue. To avoid sensor receive a lot of specular reflection, we tested using a separate LED set at a 45-degree angle along with the sensor to increase the diffuse reflectance and evaluate its performance.

Hypothesis

The bottom would affect the spectra readings, and using a side LED can help mitigate the effects.

Action Items

-Place the sensor under a black curtain (in a dark environment) and secure it with the testing stand.

-Set up a side LED mounted at a 45-degree angle relative to the sensor.

-Set up a plastic grey cup within the Field of View (FOV) of the sensor.

-Fill the environment samples provided by Pierre (Tested with Turbidity Meter: NTU=70) to the levels of 4cm, 6cm, and 8cm from the bottom.

-Take LED readings minus background readings to get the final spectra.

Result

Conclusion

The results indicate that the use of a side LED can mitigate the effects of the bottom surface on the spectra readings. The setup demonstrates that a 45-degree angle placement can reduce interference caused by reflection and absorption from the bottom, especially in shallow water conditions. Further testing is recommended to optimize this setup and explore its effectiveness across different environments.

Bottom Effect V3 - 24/05/2024

In this test, we continue to investigate the performance when the LED is separated. We also tested changing the bottom color to see whether the bottom effect has been eliminated.

Hypothesis

Changing the bottom color won’t affect sensor readings when using the side LED settings.

Action Items

-Put the sensor under a black curtain (in a dark environment) and fix it with the testing stand.

-Set up a side LED mounted at a 45-degree angle relative to the sensor.

-Set up a plastic grey and green cup within the Field of View (FOV) of the sensor.

-Fill the environment samples provided by Pierre (Tested with Turbidity Meter: NTU=70). The level has been fixed at a maximum height (around 8cm from the bottom).

-Take LED readings minus background readings to get the final spectra.

Results

The normalized response when using the normal LED is shown below:

The normalized response when using the side LED is shown below:

Discussion

From the results, it can be seen that the up LED still has an uncommon peak feature versus the side LED, which matches the previous LED feature. Although the up LED presents closer results compared to the side LED, the orange bottom would still affect the sensor readings, even when using the side LED. This suggests that the current setup is still affected by the bottom surface.

August Sampling Campaign - 01/08/2024

Aim

We plan to conduct this sampling campaign to collect different wastewater/stormwater samples from different sites to test the potential of low-cost spectrophotometer for water quality monitoring purpose.

Sensor Case

For this experiment, I have come up with some new designs suit for lab analysis purpose. The sensor case is shown as follows:

As can be seen from the picture, now the device has five AS7265X boards in total. The middle one is the receiver sensor which is only used for receiving the light signal reflected back from the water surface. The surrounded four sensors are used to provide enough lighting (White, UV and IR) during the experiment. All these sensors are connected to Sparkfun Qwwic Mux Breakout to allow the BoSL Board can communicate with different sensors which have same I2C address.

Sampling Sites

During this sampling campaign, we have grab samples from four different sites, which three of them are wastewater treatment plant sites: Koo Wee Rup (KWR), Bling Bight (BB) and Pakenham (PAK), and with one stormwater site: Troups Creek Wetland. For each site, we have grab 50 samples using HACH autosampler. The autosampler is set up to collect samples at pre-determined time interval across different time frames. Some of them is collected during daytime with 1hr interval. Some of them is collected for whole day with two hour interval. The general idea of this is to extend the dataset varibility as much as possible. The picture shown below is some illustrations of the sites we did.

Lab Analysis

After collecting the samples from the above mentioned sites, all the samples were brought back to the lab for further analysis, we have did the following measurements for all the samples:

Turbidity

EC and Temperature

Absorbance

TSS, TP, TN

NH4 and DOC

Image

MV.X Hyperspectral Camera Reading

Low-cost Multispectral Sensor Reading

Turbidity Analysis - Raw Data

The reference turbidity reading is acquired by commercial turbidity meter. For each sample, we take 20 readings using our low-cost spectrophotometer. Therefore, we are interested to see what method we can use to extract the neccssary information we need. Do we need all 20 readings of data? Or do we need only one readings? Should we simply calculate the average readings of all 20 readings, or we can try some more advanced technique like Kalman Filter? Which can count the errors during measurement, and adjust itself throughout the process. The pucture below shows a typical readings for a sample with turbidity value of 209.5 NTU

As can be seen from this graph, the dot points shows that for relatively high turbidity values (around 200NTU), there are variations for continuous 20 readings. This make sense as particles tend to settle down, which will leave the particle further away from the water surface thus reduce the light intensity that sensor can receive. As for using the average and Kalman Filter, it is very similar in our case. So we will continue with average readings for now. But the author suggest the Kalman Filter might have better performance when we go for the field test.

Turbidity Analysis - PLS model

As we have 18 channels of readings, we cannot simply use all 18 channels to perform multivariate regression as we will have issue with collinearity. If two or more bands already have correlation with each other, the increase in one band will already cause the increase in the other band, which will bias the performance of the multivariate regression. To solve this issue, we start to think of using PLS model to solve this problem. In order to find the optimal number we need, we will change the number of components for PLS model ranging from 1 to 18, and using K-fold cross validation method (k=5) to test its performance. The matrix we are using here is R2 and RMSE value, the result is plot as follows:

From the graph, we can see that when only using 1 band, the RMSE is pretty high with low R2 as well. When we use more bands, the performance start to getting better. The optimal band is around 12 bands, the model can reach near optimal performance, so we will keep 12 components for PLS model and running the model to see its performance for predicting turbidity value. The result is shown as follows:

As can be seen from the graph, the PLS model have very good prediction capacity for turbidity. This match the expectation as the turbidity is optical sensitive parameter, so our low-cost sensor would be able to capture its change. This results prove the potential of our low-cost spectrophotometer. For now the result is taken under lab condition. Our next step is to bring the sensor to the field to further test its performance.