PSD Sensor
Contents
Introduction
This page will present the development of the Camera Turbidity and PSD Sensor. More introductions to come...
Development Log
04 July 2022 (The 1st Experiment)
Camera
OmniVision OV2640 Camera, 640*480, JPG output, default camera settings (automatic exposure, gain, and white balance), lens not changed. The camera is connected to a ArduCAM Arduino Shield which is compatible with the Arduino Mega board. The board is set up using ArduCAM's Arduino Library. When taking images, the Arduino Mega is connected directly to the PC, and the images are sent and saved on the PC directly, for now.
Turbidity Solution
The tap water is mixed with natural silts to create the synthetic solution. The turbidity value ranges from 0 to 639 NTU in this experiment.
Methods
First, put the synthetic turbidity solution into the 3d-printed black container, after measuring the actual turbidity (in the unit of NTU) using the Thermo Fisher turbidity meter. Then, light up the LED (from the top hole of the container lid) and take images (from the side window) of the solution at a 90-degree angle. This light scattering method is a common method used for turbidity measurement. Generally, when the water is more turbid, the increased particles in the water scatter more light beams in directions other than the straight direction, hence the light intensity received from the side directions (such as 90 degrees) will increase. The RGB (red, green, and blue) values of each pixel of the images are obtained using python script and converted into a single value - grayscale (0 - 255, completely black to completely white) using the Luma formula (Y = 0.299R + 0.587G + 0.114B). The average grayscale value of all pixels of each photo is calculated. Finally, plot the relationship between the average grayscale value of each image and its corresponding solution turbidity.
Results
As shown in the plot, there is a linear relationship between the log(NTU) and average grayscale, with the squared-R = 0.8726. However, this result is not good at all, as the grayscale values almost plateau when the turbidity values go above 100 NTU. This may be attributed to the strength of the LED. To be more specific, the light intensity of the LED is too strong, hence when the turbidity reaches a certain value (more than 100 in this case), the particles in the water have already scattered too much light that the camera is not able to handle. Therefore, in future experiments, the LED intensity should be lowered. Another issue of this experiment is that the silts are so heavy that they settle down very quickly, thus the actual turbidity of the solution may also change quickly. Moreover, the container design should be improved so that the camera can be placed in a relatively fixed position near the "window".
10 August 2022 (The 2nd Experiment)
Camera
Camera changed to OmniVision OV7675 Camera for better documentation, size changed to 320*240, format changed to BMP output, camera setting changed (automatic exposure, gain, and white balance are disabled), lens not changed. The connection and software of the new camera remain the same as previous one.
Turbidity Solution
To overcome the problem that the settlement of turbidity particles is too fast, the standard turbidity solution is used this time. 4000 NTU Formazin turbidity standard solution and DI water are used to make standard solutions with the following turbidity values: 0 (pure water), 25, 50, 75, 100, 200, 300, and 400 NTU. The actual turbidity of each solution is measured and differs from the "standard value". The actual turbidity values are used in the plotting.
Methods
Most of the processes remain the same with the following few exceptions. (1) The 3d-printed container design is improved, so the camera can be placed in a relatively fixed position. (2) In the previous experiment, the software provided in the ArduCAM library is used to take and save images. But this time a Python script is used to obtain the images, hence we can set the image format to bitmap (BMP). (3) Most importantly, the white LED used for the experiment is tested with 3 resistors (20, 470, and 4700 ohms) which can provide different levels of light intensity (strong, moderate, and weak).
Results
High Intensity: If we look at the turbidity estimation ranging from 0 to 400 NTU, the LED with full brightness is not ideal, as there is no correlation found. However, the hypothesis is that high-intensity LED may be useful when the turbidity is in a low range, and the strong scattered light may be sensitive to the change of turbidity in that range. Further experiments are needed to test this hypothesis.
Moderate Intensity: The average grayscale values for 300 and 400 NTU are almost the same, the assumption is that the detection limit is also reached for this level of LED intensity. Excluding 400 NTU, we are able to find a good linear relationship (R2 = 0.9837). And surprisingly, the range below 100 NTU shows a nearly perfect linear relationship (R2 = 0.9994).
Low Intensity: Although the images taken are extremely dark and I could not distinguish them using naked eyes, the linear relationship looks not bad (R2 = 0.9641). It appears that the linear relationship for the NTU ranging above 100 looks better (R2 = 0.9891). A consistent hypothesis is that, with the low LED intensity, the camera may be able to estimate the very turbid solutions. Further experiments are needed to test beyond 400 NTU.