Sei sulla pagina 1di 14

Journal of Instrumentation

Application of Pulse-Width Modulation to stray light correction in


spectrophotometer
To cite this article: H. Su et al 2019 JINST 14 P06030

View the article online for updates and enhancements.

This content was downloaded from IP address 193.188.128.21 on 20/06/2019 at 16:26


Published by IOP Publishing for Sissa Medialab
Received: January 21, 2019
Revised: May 22, 2019
Accepted: May 23, 2019
Published: June 20, 2019

Application of Pulse-Width Modulation to stray light

2019 JINST 14 P06030


correction in spectrophotometer

H. Su,a,b K. Shi,a Q. Guo,a,b M. Zhang,c Q. Teng,a X. Zhanga and C. Xua,b,1


a School of Electronic Engineering and Automation, Guilin University of Electronic Technology,
1 Jinji Road, Qixing District, Guilin, China
b Guangxi Key Laboratory of Automatic Detecting and Instruments,

Guilin University of Electronic Technology, 1 Jinji Road, Qixing District, Guilin, China
c School of Life and Environmental Sciences, Guilin University of Electronic Technology,

1 Jinji Road, Qixing District, Guilin, China

E-mail: xcf4100@guet.edu.cn

Abstract: In order to correct the effects of stray light on spectrophotometer in real time, a method
based on Pulse-Width Modulation (PWM) was proposed, which makes up for the deficiency of
traditional instruments under the variation of interference source and improves the rapid deployment
capability in the wild. A system verifying to underlie the method was designed. Compared with
commercial instruments under the interference of different light sources, the experimental results
show that the method successfully corrected the error caused by stray light and improved the accuracy
and stability of the measurement. At the same time, the convenient and sensitive technique offers
great prospect for simple and cost-effective absorptive analysis instruments of stray light correction.

Keywords: Data processing methods; Detector control systems (detector and experiment monitor-
ing and slow-control systems, architecture, hardware, algorithms, databases); Spectrometers

1Corresponding author.

c 2019 IOP Publishing Ltd and Sissa Medialab


https://doi.org/10.1088/1748-0221/14/06/P06030
Contents

1 Introduction 1

2 Effects and method 2

3 Effects of stray light on absorbance measurement 2


3.1 Methods of correcting stray light 2

2019 JINST 14 P06030


4 Instrument structure 4
4.1 Photoelectric detector and light resource 4
4.2 Constant current source circuit 5
4.3 DAQ card 5
4.4 External shielding box 6

5 Results and discussion 6


5.1 Stability 6
5.1.1 The effect of time 6
5.1.2 The effect of changing stray light 7
5.2 Contrast experiment 7
5.2.1 Accuracy 8
5.2.2 Anti-interference and rapid deployment 8
5.3 Instrument integration 10

6 Conclusion 11

1 Introduction

Owing to the light absorbing characteristic of chemical substances, the spectrophotometer is widely
used for quantitative analysis of molecules in various fields, such as environmental chemistry,
biomedicine, food safety, etc. [1–4]. However, the presence of stray light is actually one of the main
error sources, which limits the accuracy and application range of the instrument. Meanwhile stray
light reduction often factors significantly in spectrophotometer design [5, 6].
Stray light means the signal being produced by detector but does not belong to transmitted
beam from light source [7]. It generally comes from the radiation light and scattered light of the
internal device in the instrument as well as the natural light and background light of the external
environment [6, 8]. With the benefit of prominent improvements in optical components, the effects
of stray light has been remarkably reduced in commercial spectrophotometers [9–11]. However the
sophisticated optical component is sensitive to instrument vibrations, which increases requirements
of system to working conditions, cost price, and routine maintenance [3, 12–14]. And the most well-
known approach for stray light correction is the cut-off filter method, which attempts to measure

–1–
and minimize stray light effects and increase the dynamic range of spectrophotometers [15, 16].
But stray light varies with the outside condition during use, the non-real time correction result will
be meaningless.
In this paper, we propose a novel method and build the system based on PWM for suppressing
stray light’s effect. By making a comparison between this system and mature instruments under
the interference of different light sources, the experimental results show that the method proposed
in this paper can correct the error caused by stray light, improve the accuracy and stability of the
measurement, and extend the range of the spectrophotometer.

2019 JINST 14 P06030


2 Effects and method

3 Effects of stray light on absorbance measurement

According to the Lambert-Beer law [15], the ideal absorbance is calculated as:

A = − lg T = − lg (It /I0 ) (3.1)

where A is the true value of absorbance, T is the transmittance, that is, T = It /I0 = 10−A, It is
transmitted light intensity, I0 is the incident light intensity.
When the stray light S has existed [5, 6], eq. (3.1) can be rewritten as:

It + Is T +S
   
As = − lg Ts = − lg = − lg (3.2)
I0 + Is 1+S
where As is the absorbance measurement value which considered the effect of stray light, Is is stray
light intensity, S is the stray light which is given by the ratio of stray light intensity to the incident
light intensity, that is, S = Is /I0 .
Then the relation of the measuring error of absorbance and stray light is as follows:

1 + S × 10 A
 
∆A = A − As = lg Ts − lg T = lg (3.3)
1+S
where ∆A is the measuring error of absorbance.
It can be seen from eq. (3.3) that stray light makes the measured value less than the true value,
it causes a deviation from Lambert-Beer law. Obviously, stray light will make a restriction of the
upper limit and accuracy of spectrophotometer, resulting in measuring error that cannot be ignored.
So the measuring error brought by stray light should be corrected as far as possible for the accuracy
and reliability of the results.

3.1 Methods of correcting stray light


In order to correct the measuring error caused by the change of stray light in real time, the PWM
technique was introduced into the spectrophotometry. Taking the correction of the change of stray
light intensity on the measured value of transmission light as an example, the model is shown in
figure 1. The frequency of PWM signal, which has 50% duty ratio, is set as f . In the period T, the
stray light and the equipment noise are considered to be stationary process. The data sampling rate
is set as fs , and fs  f . So, the sample number is set as N = fs / f of a period.

–2–
2019 JINST 14 P06030
Figure 1. Real-time correction of stray light based on PWM model.

The light source is on by the constant current source, when the PWM was a low voltage. The
−→
data collected I Lt is the vector serials of transmitted and stray light intensity. The equation is
as follows:
−→ → − → −
I Lt = It + Is (3.4)
→− →−
where It is the intensity vector of transmitted light. Is is the intensity vector of stray light.
The light source is off by the constant current source, when the PWM was a high voltage. The
−−→
measured light intensity vector IHt is only the stray light. The equation is as follows:
−−→ → −
IHt = Is (3.5)
−−→
After removing the gross and systematic errors, the average value IHt is obtained from IHt and
−→
I Lt is obtained from I Lt . The difference of It is the transmitted light intensity after correcting stray
light, the equation is:
It = I Lt − IHt (3.6)
Similarly, the equation of incident light intensity is:

I0 = I L0 − IH0 (3.7)

The absorbance has been obtained after the correction of stray light interference. Inserting (3.6)
and (3.7) into (3.1) gives:  
I Lt − IHt
A = − lg (It /I0 ) = − lg (3.8)
I L0 − IH0
According to eq. (3.8), the interference of stray light on the absorbance measurement will be
corrected, and the measurement accuracy of the spectrophotometer can be improved. In addition, the

–3–
2019 JINST 14 P06030
Figure 2. Schematic diagram of the instrument.

I0 will be measured repeatedly to prevent the effect of drift in the process of samples’ measurement,
whenever a noticeable drift is observed. The latest samples’ absorbance will be calculated by a
new I0 .

4 Instrument structure

The structure of the instrument is shown in figure 2. The system consists of a signal generator,
a constant current source circuit, a data acquisition card (DAQ card), a personal computer and a
shielding box. The light source, photoelectric detector, sample pool are placed in the shielding
box. A closed space is constituted, to ensure that the photoelectric detector will not by receiving
too much external stray light in a saturated state. The PWM signal usually was generated by the
optical chopper [16]. However, which increase the mechanical structure of the instrument. The
microprocessor (STM32F103ZET6) for flexibility and convenience was selected to generate PWM
signal in the system.
The working principle of the system includes the following steps:

1. Pulse generator produces PWM signal with 50% duty ratio.


2. PWM signal controls constant current source circuit to drive light source on and off.
3. Photoelectric detector receives the signal, which includes light source absorbed by the sample
and stray light.
4. The DAQ card obtains the real-time output data of the photoelectric detector.
5. Data processing is carried out on the PC. Firstly, the systematic and gross error of the data are
removed, and then the stray light of the data is corrected in the real time. Finally, according
to eq. (3.8), the absorbance of the sample without stray light interference is obtained.

4.1 Photoelectric detector and light resource


TSL257 integrated photoelectric detector was selected for its good accuracy and stability. According
to the spectral response curve shown in figure 3, the detector has the highest spectral response

–4–
2019 JINST 14 P06030
Figure 3. Spectral response characteristic of TSL257.

Figure 4. Controlled constant current source circuit based on PWM.

characteristic when the wavelength was at 700 nm. Therefore, red LED with wavelength range of
610 nm~760 nm was selected as the light source.

4.2 Constant current source circuit


The TL431 shunt regulator and NPN transistor construction was used in the constant current source
circuit. Its specific circuit diagram is shown in figure 4. The current provided by the constant
current source circuit to the light source is almost independent of the ambient temperature and the
load of the light source, and it has good temperature stability. The circuit can be adjusted through
potentiometer R5. That can not only satisfied light source of different rated current, but also can
adjust the intensity of light source in accordance with stray light. Therefore, the photoelectric
detector can operate in a linear region.

4.3 DAQ card


The DAQ card is used to collect the output voltage of the photoelectric detector and it can send
the collected data to the PC for analysis and processing. Considering the sampling accuracy, the
DAQ card of USB-6343 from NI Company was selected for the system. The specific parameters
are shown in table 1.

–5–
Table 1. USB-6343 DAQ card parameters.
Single analog Differential analog Maximum Analog input Analog input Analog input
input channel number input channel number sampling rate resolution absolute precision voltage range
32 16 500 kS/s 16 bits 2190 uV ±10 mV

2019 JINST 14 P06030


Figure 5. The box model for external shielding.

4.4 External shielding box

The TSL257 photodetector has a higher sensitivity, and the output is saturated when it was exposed
to natural light. In order to make the TSL257 work well under the interference of different ambient
light, a device is designed to block the external light. The model is shown in figure 5. A cuvette
containing the solution is placed on top, a light source is placed on the left, and an photodetector
is placed on the right. The light passes through the inner part, and the external light can hardly
through it, which ensures that TSL257 works in a linear region.

5 Results and discussion

5.1 Stability

In order to verify that the system can work normally under external influence, the stable working
state of the equipment in the long time and the ability of real-time correction to cope with external
stray light are investigated in this paper. In the experiments, the frequency of PWM signal is set as
100 Hz, and the sampling rate of DAQ card is set as 100 kHz.

5.1.1 The effect of time


The system stability with time is test for five hours on end. The cuvette groove is covered to
investigate the performances of the light source and detector without the effort of stray light. Due to
the huge data, the mean value results of measured intensity every 30 s are calculated and presented
in figure 6. The standard deviation is 0.0016 V, which shows that there is no significant difference
of the system stability with time. Imaging a typical sample measurement time is only a couple of
minutes, drift in such a short time should not give any significant effect.

–6–
2019 JINST 14 P06030
Figure 6. The light intensity measurement data of the system working continuously for 5 hours.

Table 2. Experimental data of transmission light intensity under varying of stray light.
No. Stray light Measured Corrected
intensity (V) intensity (V)
1 0.0865 2.1351 1.9503
2 0.0961 2.1614 1.9537
3 0.1043 2.1769 1.9499
4 0.1160 2.2081 1.9518
5 0.1337 2.2544 1.9530
6 0.1539 2.3089 1.9534
7 0.1876 2.4072 1.9553
8 0.2307 2.5353 1.9491
9 0.3053 2.8204 1.9572
10 0.3894 3.1995 1.9538

5.1.2 The effect of changing stray light


It can be seen from section 2.2 that the measured data should stabilize when the stray light intensity
changed. Taking the influence of the change of stray light intensity on the measured value of
transmission light as an example, the stray light is changed by adjusting the distance between the
phone flash and the shielding box, the data is shown in table 2.
According to the data in the table 2, as the stray light intensity increases, the fluctuation range
of the transmitted light intensity was within 10 mV. Compared with the variation of stray light
intensity, that is very small and can be basically ignored. The characteristics figure was drawn
with the influence of the outside stray light changes to measured transmitted light intensity, shown
in figure 7. It can be seen the interference of stray light has been corrected in real time and the
precision of corrected results has significantly improved.

5.2 Contrast experiment


The absorbance of phosphate solution is determined with the system and the mature instrument
UH5300 spectrophotometer (Hitachi, Japan), the experimental environment is shown as in figure 8.
According to the national standard method (GB 11893-89), water was used as a reference [17, 18].

–7–
2019 JINST 14 P06030
Figure 7. Transmission light intensity before and after correction for stray light.

Figure 8. The experimental environment of the system (a) and the UH5300 (b).

And the 2.00 mg/L phosphate standard solution was selected, which was configured with 7 groups
of different concentrations of phosphate solution (0.00, 0.04, 0.08, 0.24, 0.40, 0.80, and 1.20 mg/L).

5.2.1 Accuracy
The standard curves between concentration and absorbance were determined without interference
of stray light, the diagram are shown in figure 9(a). The R-squared (R2 ) of this system is 0.9991
higher than 0.9985 of UH5300 within the same concentration range. Clearly, the system has a
higher accuracy. The measured curves of UH5300, which was under normal working conditions,
are shown in figure9(b). It shows that the curves have the only wave peak in scanning wavelength
range of 610 nm ∼ 760 nm without outside interference, and this wave peak appears near the
maximum absorption wavelength of phosphate solution which is 710 nm.

5.2.2 Anti-interference and rapid deployment


The phone flash was used to simulate solid discharge light source, table lamp was used to simulate
gas discharge light source and outdoor sunlight was used to simulate thermal radiation light source.
The above three light sources are applied to the system and UH5300 as external stray light.
Due to that the UH5300 has to cover the dark box in the measurement, the only phone flash
that can be placed in a dark box is selected as an interference source. The measured data during

–8–
2019 JINST 14 P06030
Figure 9. Absorbance of phosphate solution with different concentration. (a) Standard curves of UH5300
and this system (b) Measured waveform of UH5300.

Figure 10. Measured waveform of UH5300 under the interference of phone flash. (a) the curves at different
concentrations. (b) the curve at the concentration of 0.40mg/L.

the different concentrations of phosphate solution is shown in figure 10(a). It can be seen that the
curves do not have a unique wave peaks within the scanning wavelength range of 610 nm ∼ 760
nm. The absorbance curve of 0.40 mg/L phosphorus solution was taken as an example which is
shown in figure 10(b). It shows that this curve has 6 wave peaks, and maximum wave peak appears
at the wavelength of 655 nm not at about 710 nm. So the absorbance of the corresponding solution
cannot be obtained. From what has been discussed above, UH5300 cannot work at the interference
of the phone flash. It can been imply that UH5300 cannot have a normal work when it has the
interference of external stray light.

Under the three interference sources of phone flash, table lamp and sunshine, the standard
curves of this system are shown in figure 11. Obviously, the system can still work normally. In
particular, the intensity of the sunlight changes randomly. And the R2 is all above 0.999, which
indicates that the system not only has good accuracy and stability, but anti-interference and rapid
deployment ability.

According to the above experiments, the system can stably work under no matter the change
of outside light source or intensity. Obviously, the proposed method successfully corrects the stray
light and improves the accuracy and stability of the system.

–9–
2019 JINST 14 P06030
Figure 11. Standard curves of the system under three interference sources.

Figure 12. The block diagram of integrated instrument.

5.3 Instrument integration

To improve the integrated level, the STM32F103ZET6 is used to process data instead of the DAQ
card and PC. The block diagram is shown in figure 12. The PWM signal is generated by the Timer 3.
The Timer 1 is configured to trigger the internal analog-to-digital converter (ADC) to acquire data
at the sampling rate of 50 kHz. The direct memory access module (DMA) and PING-PONG buffers
are used to complete data transferring without CPU intervention, so the CPU can process data in
real time. The voltage follower ensures the impedance matching between photoelectric detection
and the ADC. The operating staff can control the instrument by buttons and obtain absorbance
results by the LCD.
The physical object of the integrated instrument is shown in figure 13(a). The standard curves
between absorbance and concentration obtained by measuring the standard phosphate solution
under the phone flash, table lamp and sunlight are shown in figure 13(b). Compared with figure 11,
R2 has gone a little down. The reason would be likely to the sampling rate of the integrated
instrument. However, the instrument still can correct the interference of external stray light to the
absorbance measurement in real time, which indicates that the method proposed in this paper has
good portability.

– 10 –
2019 JINST 14 P06030
Figure 13. The experimental environment and results of integrated instruments. (a) the physical picture of
the instrument. (b) the standard curves of the instrument under three interference sources.

6 Conclusion

New growth points of spectrophotometer were miniaturization, intelligence, portability and net-
working. Due to the need of wild and online analysis and testing, the system must be accurate, fast
and reliable. Appropriate methods must be adopted to correct the interference of stray light on the
measurement.
In this paper, a method of correcting stray light in real time based on PWM has been proposed.
It makes up for the disadvantages that traditional spectrophotometer cannot be calibrated in real
time according to the variation of external stray light, and improves the rapid deployment capability
of spectrophotometer in the wild. A measurement system based on the method was developed. The
system improves the accuracy and stability of the traditional instrument, and has a wide application
prospect for absorptive analysis instruments.

Acknowledgments

This work was supported by the Nature Science Foundation of Guangxi of China
(No. 2016GXNSFBA380117), the Guilin Scientific Research and Technology development Project
(No. 2016010404-3), the Open Project of Key Laboratory of Underwater Acoustic Communica-
tion and Marine Information Technology (Xiamen University) Ministry of Education (201601),
the Director Fund Project of Guangxi Key Laboratory of Automatic Detecting and Instruments
(YQ15116), the Guangxi Bagui Scholar Program.

References

[1] N. Chaianantakul et al., Development of mini-spectrophotometer for determination of plasma glucose,


Spectrochim. Acta A 204 (2018) 670.
[2] Z. Shen et al., Objectification of facial color inspection to differentiate obstructive/nonobstructive
jaundice in neonates by spectrophotometer, J. Pediatr. Surg. 52 (2017) 1981.
[3] X. Y. Bao et al., Using a PC camera to determine the concentration of nitrite, ammonia nitrogen,
sulfide, phosphate, and copper in water, Anal. Meth. 10 (2018) 2096.

– 11 –
[4] C. Wang et al., Simple spectrophotometric determination of sulfate free radicals, Anal. Meth. 10
(2018) 3470.
[5] R. B. Cook and R. Jankow, Effects of stray light in spectroscopy, J. Chem. Educ. 49 (1972) 405.
[6] M. R. Sharpe, Stray light in UV-VIS spectrophotometers, Anal. Chem. 56 (1984) 339A.
[7] E. Fest, Stray light analysis and control, SPIE Press, U.S.A. (2013).
[8] Y. Qu et al., A method of reducing stray light of 1.5 um laser 3D vision system, Infrared Phys.
Technol. 92 (2018) 266.
[9] E.S. Oh et al., Novel ray tracing method for stray light suppression from ocean remote sensing
measurements, Opt. Expr. 24 (2016) 10232.

2019 JINST 14 P06030


[10] G. Wang et al., Rapid optimization method of the strong stray light elimination for extremely weak
light signal detection, Opt. Expr. 25 (2017) 26175.
[11] T. Sara et al., A simple homemade spectrophotometer, J. Anal. Chem. 72 (2017) 239.
[12] D.R. Albert, A low-cost quantitative absorption spectrophotometer, J. Chem. Educ. 89 (2012) 1432.
[13] S. Grabarnik., Optical design method for minimization of ghost stray light intensity, Appl. Opt. 54
(2015) 3083.
[14] A. Ehn et al., Stray light suppression in spectroscopy using periodic shadowing, Opt. Expr. 22 (2014)
7711.
[15] J. Gordon, A graduated cylinder colorimeter: an investigation of path length and the Beer-Lambert
law, J. Chem. Educ. 79 (2002) 611.
[16] R. Alonso et al., Low-cost, digital lock-in module with external reference for coating glass
transmission/reflection spectrophotometer, Meas. Sci. Technol. 14 (2003) 551.
[17] Water quality — Determination of total phosphorus — Ammonium molybdate spectrophotometric
method, GB 11893-89, National Standards of the People’s Republic of China.
[18] A.M. Cooket al., Determination of phosphorus-containing compounds by spectrophotometry, Anal.
Chem. 50 (1978) 1716.

– 12 –

Potrebbero piacerti anche