Difference between revisions of "PSD Sensor"

From BoSL Wiki
Jump to navigation Jump to search
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Introduction==
+
== Introduction ==
This page will present the development of the Camera Turbidity and PSD Sensor.
+
The PSD Sensor is a novel, low-cost camera-based sensor designed for near-continuous in-situ measurements of Particle Size Distribution (PSD) in stormwater. This sensor addresses the limitations of traditional PSD measurement methods, which are often expensive, labour-intensive, or unable to provide real-time data.
More introductions to come...
 
  
==Development Log==
+
== Key Features ==
===04 July 2022 (The 1st Experiment)===
+
[[File:BoSLCam front and back.png|thumb|right|300px|Front and back of BoSLCam. Orange: OV7575 camera module, light blue: SIM card slot, yellow: UART connection, grey: battery connector, dark blue: LTE and GPS antenna, red: nRF9160, purple: 23LCV1024 SRAM chip, mint: SD card slot.]]
'''Camera:''' [https://www.arducam.com/ov2640/ 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 [https://www.arducam.com/product/b0051b0011-arducam-f-shield-v2-camera-module-shield-with-ov2640-for-arduino-uno-mega2560-due/ ArduCAM Arduino Shield] which is compatible with the Arduino Mega board. The board is set up using ArduCAM's [https://github.com/ArduCAM/Arduino/tree/master/ArduCAM 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.
+
* Utilizes a self-developed and highly customised compact camera with a 25x macro lens
 +
* Employs image processing techniques for particle size estimation
 +
* Provides affordable (less than $100), low-power, and mini-sized solution
 +
* Capable of near-continuous measurements
 +
* Designed for field deployment in stormwater systems (work in progress)
 +
<br><br><br><br>
 +
== Methodology ==
 +
=== Image Acquisition ===
 +
The core of the PSD sensor is the [[BoSLcam|BoSLCam]], a self-developed camera logger. Key features of the BoSLCam include:
  
'''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.
+
* Custom-designed PCB measuring 70 mm by 15 mm
 +
* Powered by a single 3.7V Li-ion battery
 +
* OV7675 colour camera module capable of capturing VGA (640x480) resolution images
 +
* nRF9160 chip for main microcontroller functions and LTE-M1 cellular connectivity
 +
* GPS location and time data acquisition capability
 +
* 23LCV1024 SRAM buffer for image data processing
 +
* SD card storage for captured images, and SIM card capability to upload images to FTP servers
 +
* Power-efficient design with sleep mode reducing current consumption to less than 400 µA
 +
* UART port for communication with external sensors and dataloggers
  
'''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.
+
=== Image Processing ===
 +
[[File:PSD image processing steps.png|thumb|right|300px|Image processing steps of a 75-90µm sample. (a) Original image captured by BoSLCam, (b) converted grayscale image, (c) image treated by Fourier Transform and high-pass filter, (d) binary mask created after applying threshold.]]
 +
The image processing workflow consists of the following detailed steps:
  
'''Results:'''
+
==== 1. Image Pre-Processing ====
 +
# RGB to Grayscale Conversion:
 +
#* The RGB image is converted to grayscale using the following equation:
 +
#*: <code>Grayscale = 0.299 × Red + 0.587 × Green + 0.114 × Blue</code>
 +
#* This equation is commonly used in camera-based measurement of turbidity.
 +
# Fourier Transform and High-Pass Filter:
 +
#* A Fast Fourier Transform (FFT) is applied to convert the image from the spatial domain to the frequency domain.
 +
#* A high-pass filter with a cutoff frequency of 2 is used to mitigate background noise and enhance image contrast.
 +
#* The process involves:
 +
## Applying 2D Fourier transform to the grayscale image
 +
## Shifting the zero-frequency component to the center of the spectrum
 +
## Creating a high-pass filter mask
 +
## Applying the mask to the shifted Fourier transform
 +
## Performing inverse Fourier transform to obtain the filtered image
 +
 
 +
==== 2. Image Segmentation (Thresholding) ====
 +
# Threshold Determination:
 +
#* A threshold grayscale value of 241 was determined to be adequate for the BoSLCam sample images.
 +
#* This threshold distinguishes pixels representing particles (darker) from the background (brighter).
 +
# Binary Image Creation:
 +
#* The grayscale image is converted to a binary image where:
 +
#** 1 represents particle (foreground)
 +
#** 0 represents background
 +
 
 +
==== 3. Feature Extraction ====
 +
# Connected Component Labelling:
 +
#* 8-connectivity is used to perform connected component labelling on the binary image.
 +
#* This process identifies and labels patches of pixels that are grouped together, representing individual particles.
 +
# Particle Size Estimation:
 +
#* For each labeled pixel patch (particle):
 +
## The pixel size is multiplied by the theoretical area-per-pixel value (e.g., 30x30µm for BoSLCam).
 +
## Assuming spherical particles, the equivalent spherical diameter is calculated.
 +
## Particle surface area and volume are also calculated based on this diameter.
 +
 
 +
==== 4. Data Cleaning and Preparation ====
 +
* Particles larger than 500 µm (exceeding the proposed detection range) are excluded.
 +
* Histogram bins containing fewer than 2 particle counts are removed to mitigate potential noise effects, such as those caused by bubbles.
 +
 
 +
=== PSD Analysis ===
 +
The sensor produces the following outputs:
 +
* Number-based (count-based) and volume-weighted particle size distribution histograms
 +
* Cumulative distribution curves
 +
* Statistical parameters such as D10, D50 (median diameter), and D90
 +
 
 +
== Validation Results ==
 +
Laboratory validation tests were conducted to assess the performance of the PSD Sensor against traditional laboratory analysis methods. The tests used standard particles of various sizes ranging from 38 to 355 µm, providing a comprehensive evaluation across different size ranges relevant to stormwater sediment analysis.
 +
 
 +
=== Experimental Setup ===
 +
The laboratory validation test setup, as shown in Figure 1, consisted of the following components:
 +
* A 3D-printed black, closed container with an openable lid for sample changing
 +
* An LED backlight module (white, 3.3V, 20mA, 110cd/m²) at the bottom of the container
 +
* A clear acrylic plate above the LED module to hold a shallow depth (<5 mm) of water sample
 +
* The BoSLCam coupled with a 25x macro lens, mounted on top of the container
 +
* The shallow sample depth was chosen to prevent particle overlapping and minimize distance-related distortions
 +
 
 +
=== Standard Particles and Sample Preparation ===
 +
The following standard particle size ranges were used in the validation tests:
 +
* 38-45 µm
 +
* 53-63 µm
 +
* 75-90 µm
 +
* 125-150 µm
 +
* 300-355 µm
 +
 
 +
Samples were prepared using deionized (DI) water dosed with these artificial particles. To ensure proper dispersion of hydrophobic particles, surfactant and anti-foam agents were added to the samples.
 +
 
 +
=== Comparison with Laboratory Analyzer ===
 +
The PSD Sensor's performance was evaluated against the Accusizer 780 (Entegris), a traditional laboratory particle sizing system. The comparison revealed:
 +
 
 +
* Strong correlations (R² > 0.99) between the two methods for key PSD parameters (volume-weighted D10, D50, and D90)
 +
* Consistent performance across various particle sizes, with some systematic differences:
 +
** Slight overestimation for particles smaller than 50 µm
 +
** Accurate measurements for mid-range particles (50-300 µm)
 +
** Some underestimation for particles larger than 300 µm
 +
 
 +
Figure 2 demonstrates this performance using a 75-90 µm sample, showing similar histogram shapes and peak locations in the volume-weighted particle size distribution and cumulative distribution plots for both methods.
 +
 
 +
Figure 3 further illustrates the correlation between the PSD Sensor and Accusizer 780A measurements across all tested size ranges. The graph shows strong linear relationships for D10 (red), D50 (blue), and D90 (green) values, with slopes around 0.70-0.75.
 +
 
 +
=== Performance Considerations ===
 +
While the PSD Sensor showed excellent overall performance, some limitations were observed:
 +
 
 +
* The slight overestimation for smaller particles (<50 µm) is likely due to the current image resolution and quality limitations of the BoSLCam
 +
* The underestimation for larger particles (>300 µm) may be partially attributed to the upper detection limit of the Accusizer 780, rather than solely a limitation of the PSD Sensor
 +
 
 +
These findings highlight areas for future optimization, particularly in improving resolution for smaller particles and extending the accurate measurement range for larger particles.
 +
 
 +
<gallery>
 +
File:PSD sensor lab test setup.png|Figure 1: Laboratory validation test setup for image acquisition.
 +
File:PSD results comparison example.png|Figure 2: Comparison example: volume-weighted particle size distribution and cumulative distribution plots for a 75-90µm sample analysed by (a) Accusizer 780A, and (b) proposed PSD sensor.
 +
File:PSD results D-values comparison.png|Figure 3: Comparison and linear relationships of the averaged volume-weighted D10, D50, and D90 reported by the proposed PSD sensor and Accusizer 780A. Red: D10, blue: D50, green: D90.
 +
</gallery>
 +
 
 +
== Future Work ==
 +
Planned improvements and future research directions include:
 +
* Trialing a 100x microscopy lens to improve measurement accuracy for smaller particles
 +
* Optimizing the image processing algorithm and calibration method
 +
* Investigating the underestimation issue for larger particle sizes
 +
* Developing a field-ready sensor and testing with real-world stormwater samples
 +
* Exploring machine learning algorithms for improved particle detection
 +
* Investigating simultaneous measurement of other water quality parameters such as turbidity and TSS
 +
 
 +
== References ==
 +
For a complete list of references, please refer to the original research paper (currently not available, but contact Canwei if you are interested).
 +
A presentation slide on this PSD sensor is avilable at: https://docs.google.com/presentation/d/1nz9B4ax-7Trgf9BWI-0MAw2LRiOo3SrO/edit?usp=sharing&ouid=118015437923291707850&rtpof=true&sd=true

Latest revision as of 02:07, 2 October 2024

Introduction

The PSD Sensor is a novel, low-cost camera-based sensor designed for near-continuous in-situ measurements of Particle Size Distribution (PSD) in stormwater. This sensor addresses the limitations of traditional PSD measurement methods, which are often expensive, labour-intensive, or unable to provide real-time data.

Key Features

Front and back of BoSLCam. Orange: OV7575 camera module, light blue: SIM card slot, yellow: UART connection, grey: battery connector, dark blue: LTE and GPS antenna, red: nRF9160, purple: 23LCV1024 SRAM chip, mint: SD card slot.
  • Utilizes a self-developed and highly customised compact camera with a 25x macro lens
  • Employs image processing techniques for particle size estimation
  • Provides affordable (less than $100), low-power, and mini-sized solution
  • Capable of near-continuous measurements
  • Designed for field deployment in stormwater systems (work in progress)





Methodology

Image Acquisition

The core of the PSD sensor is the BoSLCam, a self-developed camera logger. Key features of the BoSLCam include:

  • Custom-designed PCB measuring 70 mm by 15 mm
  • Powered by a single 3.7V Li-ion battery
  • OV7675 colour camera module capable of capturing VGA (640x480) resolution images
  • nRF9160 chip for main microcontroller functions and LTE-M1 cellular connectivity
  • GPS location and time data acquisition capability
  • 23LCV1024 SRAM buffer for image data processing
  • SD card storage for captured images, and SIM card capability to upload images to FTP servers
  • Power-efficient design with sleep mode reducing current consumption to less than 400 µA
  • UART port for communication with external sensors and dataloggers

Image Processing

Image processing steps of a 75-90µm sample. (a) Original image captured by BoSLCam, (b) converted grayscale image, (c) image treated by Fourier Transform and high-pass filter, (d) binary mask created after applying threshold.

The image processing workflow consists of the following detailed steps:

1. Image Pre-Processing

  1. RGB to Grayscale Conversion:
    • The RGB image is converted to grayscale using the following equation:
      Grayscale = 0.299 × Red + 0.587 × Green + 0.114 × Blue
    • This equation is commonly used in camera-based measurement of turbidity.
  2. Fourier Transform and High-Pass Filter:
    • A Fast Fourier Transform (FFT) is applied to convert the image from the spatial domain to the frequency domain.
    • A high-pass filter with a cutoff frequency of 2 is used to mitigate background noise and enhance image contrast.
    • The process involves:
    1. Applying 2D Fourier transform to the grayscale image
    2. Shifting the zero-frequency component to the center of the spectrum
    3. Creating a high-pass filter mask
    4. Applying the mask to the shifted Fourier transform
    5. Performing inverse Fourier transform to obtain the filtered image

2. Image Segmentation (Thresholding)

  1. Threshold Determination:
    • A threshold grayscale value of 241 was determined to be adequate for the BoSLCam sample images.
    • This threshold distinguishes pixels representing particles (darker) from the background (brighter).
  2. Binary Image Creation:
    • The grayscale image is converted to a binary image where:
      • 1 represents particle (foreground)
      • 0 represents background

3. Feature Extraction

  1. Connected Component Labelling:
    • 8-connectivity is used to perform connected component labelling on the binary image.
    • This process identifies and labels patches of pixels that are grouped together, representing individual particles.
  2. Particle Size Estimation:
    • For each labeled pixel patch (particle):
    1. The pixel size is multiplied by the theoretical area-per-pixel value (e.g., 30x30µm for BoSLCam).
    2. Assuming spherical particles, the equivalent spherical diameter is calculated.
    3. Particle surface area and volume are also calculated based on this diameter.

4. Data Cleaning and Preparation

  • Particles larger than 500 µm (exceeding the proposed detection range) are excluded.
  • Histogram bins containing fewer than 2 particle counts are removed to mitigate potential noise effects, such as those caused by bubbles.

PSD Analysis

The sensor produces the following outputs:

  • Number-based (count-based) and volume-weighted particle size distribution histograms
  • Cumulative distribution curves
  • Statistical parameters such as D10, D50 (median diameter), and D90

Validation Results

Laboratory validation tests were conducted to assess the performance of the PSD Sensor against traditional laboratory analysis methods. The tests used standard particles of various sizes ranging from 38 to 355 µm, providing a comprehensive evaluation across different size ranges relevant to stormwater sediment analysis.

Experimental Setup

The laboratory validation test setup, as shown in Figure 1, consisted of the following components:

  • A 3D-printed black, closed container with an openable lid for sample changing
  • An LED backlight module (white, 3.3V, 20mA, 110cd/m²) at the bottom of the container
  • A clear acrylic plate above the LED module to hold a shallow depth (<5 mm) of water sample
  • The BoSLCam coupled with a 25x macro lens, mounted on top of the container
  • The shallow sample depth was chosen to prevent particle overlapping and minimize distance-related distortions

Standard Particles and Sample Preparation

The following standard particle size ranges were used in the validation tests:

  • 38-45 µm
  • 53-63 µm
  • 75-90 µm
  • 125-150 µm
  • 300-355 µm

Samples were prepared using deionized (DI) water dosed with these artificial particles. To ensure proper dispersion of hydrophobic particles, surfactant and anti-foam agents were added to the samples.

Comparison with Laboratory Analyzer

The PSD Sensor's performance was evaluated against the Accusizer 780 (Entegris), a traditional laboratory particle sizing system. The comparison revealed:

  • Strong correlations (R² > 0.99) between the two methods for key PSD parameters (volume-weighted D10, D50, and D90)
  • Consistent performance across various particle sizes, with some systematic differences:
    • Slight overestimation for particles smaller than 50 µm
    • Accurate measurements for mid-range particles (50-300 µm)
    • Some underestimation for particles larger than 300 µm

Figure 2 demonstrates this performance using a 75-90 µm sample, showing similar histogram shapes and peak locations in the volume-weighted particle size distribution and cumulative distribution plots for both methods.

Figure 3 further illustrates the correlation between the PSD Sensor and Accusizer 780A measurements across all tested size ranges. The graph shows strong linear relationships for D10 (red), D50 (blue), and D90 (green) values, with slopes around 0.70-0.75.

Performance Considerations

While the PSD Sensor showed excellent overall performance, some limitations were observed:

  • The slight overestimation for smaller particles (<50 µm) is likely due to the current image resolution and quality limitations of the BoSLCam
  • The underestimation for larger particles (>300 µm) may be partially attributed to the upper detection limit of the Accusizer 780, rather than solely a limitation of the PSD Sensor

These findings highlight areas for future optimization, particularly in improving resolution for smaller particles and extending the accurate measurement range for larger particles.

Future Work

Planned improvements and future research directions include:

  • Trialing a 100x microscopy lens to improve measurement accuracy for smaller particles
  • Optimizing the image processing algorithm and calibration method
  • Investigating the underestimation issue for larger particle sizes
  • Developing a field-ready sensor and testing with real-world stormwater samples
  • Exploring machine learning algorithms for improved particle detection
  • Investigating simultaneous measurement of other water quality parameters such as turbidity and TSS

References

For a complete list of references, please refer to the original research paper (currently not available, but contact Canwei if you are interested). A presentation slide on this PSD sensor is avilable at: https://docs.google.com/presentation/d/1nz9B4ax-7Trgf9BWI-0MAw2LRiOo3SrO/edit?usp=sharing&ouid=118015437923291707850&rtpof=true&sd=true