Advanced Search

ISSN1001-3806 CN51-1125/TN Map

Volume 45 Issue 4
Jun.  2021
Article Contents
Turn off MathJax

Citation:

Research on an on-line turbidity sensor for traditional Chinese medicine based on spectrum analysis

  • Corresponding author: QIU Xuanbing, qiuxb@tyust.edu.cn
  • Received Date: 2020-08-03
    Accepted Date: 2020-09-11
  • In order to realize the on-line accurate measurement of turbidity of traditional Chinese medicine (TCM), the spectrum characteristics analysis method was used to establish the relationship between the spectrum characteristics and turbidity of the transmitted and scattered light signals. A near-infrared LED was employed as the light source of the sensor. The transmitted light and scattered light signals were converted into weak current signals by FDS100 photodiodes, then conditioned by a trans-impedance amplifier and a low-pass filter. The processed signals then were converted by A/D converters to digital signals. A MCU (STM32F405) was used to calculate fast Fourier transformation and turbidity. Finally, sixteen groups of standard turbidity solution (Formazin) ranging from 0NTU to 1000NTU were prepared using gradient dilution method to calibrate our sensor and make further verification, in addition, the sensor was applied for determination of the turbidity of angelica essential oil. The results show that the related coefficients of linear fitting of a ratio of the third and fifth harmonics components of the transmitted signal amplitude and the scattered signal amplitude are 0.9883 and 0.9946, respectively. And the minimum error and maximum error of our sensor are 0.471% and 3.768%, respectively. A good linear fitting degree of the turbidity of angelica essential oil is 0.99176, which satisfies real-time and on-line measurement requirements of essential oil extraction, concentration and drying. Therefore, the sensor has certain application filed for manufacturing and quality monitoring of TCM.
  • 加载中
  • [1]

    WEI X Y, LIU Q, LI R, et al. Discussion on pharmacological understanding and inheritance of ancient Chinese medicines[J]. Shanghai Journal of Traditional Chinese Medicine, 2020, 54(5): 73-76(in Chinese).
    [2]

    CHANG Y, YU F J, HU Ch L. Discussion on the test of clarity and degree of opalescence of liquids in Ch. P 2015[J]. Chinese Pharmaceutical Journal, 2017, 52(9): 802-808(in Chinese).
    [3]

    IRVINE C A, BACKUS S, COOKE S, et al. Application of continuous turbidity sensors to supplement estimates of total phosphorus concentrations in the Grand River, Ontario, Canada[J]. Journal of Great Lakes Research, 2019, 45(4): 840-849. doi: 10.1016/j.jglr.2019.05.007
    [4]

    WU Y H, WU H, HUANG H D, et al. Study on influuencial factor for detecting the concentration of HPAM by turbidimetry[J]. Journal of Oil and GAS Technology, 2009, 31(4): 139-142(in Chinese).
    [5]

    LIANG J H, WEN D J, LI M F, et al. Study on the determination of phosphorus content in soybean hair oil by turbidity method[J]. Cereal & Food Industry, 2019, 26(3): 70-72(in Chinese).
    [6]

    YU J Q, XU B, HUANG Y Y, et al. Evaluation and classification of dissolution behavior and capability of Chinese medicine granules based on an inline turbidity sensor[J]. China Journal of Chinese Materia Medica, 2020, 45(2): 259-266(in Chinese).
    [7]

    EBERT F V, REITZ C, CRUZ-BOURNAZOU M N, et al. Characterization of a noninvasive on-line turbidity sensor in shake flasks for biomass measurements[J]. Biochemical Engineering Journal, 2018, 132: 20-28. doi: 10.1016/j.bej.2018.01.001
    [8]

    LIU Y N, DUAN Q H, ZHANG Y. Study on metal detergent turbidity measurement by scattered light turbidimeter[J]. Petroleum Processing and Petrochemicals, 2017, 48(2): 100-105(in Chinese).
    [9]

    PARRA L, ROCHER J, ESCRIVÁ J, et al. Design and development of low cost smart turbidity sensor for water quality monitoring in fish farms[J]. Aquacultural Engineering, 2018, 81: 10-18. doi: 10.1016/j.aquaeng.2018.01.004
    [10]

    PAUL W, ALAN T, COLIN P, et al. Encyclopedia of analytical science[M]. 3rd ed. Amsterdam, Amsterdam, Netherlands: Elsevier, 2019: 152-163.
    [11]

    GILLETT D, MARCHIORI A. A low-cost continuous turbidity monitor[J]. Sensors, 2019, 19(14): 3039. doi: 10.3390/s19143039
    [12]

    YEOH S, MATJAFRI M Z, MUTTER K N, et al. Plastic fiber evanescent sensor in measurement of turbidity[J]. Sensors & Actuators, 2019, A285: 1-7.
    [13]

    HU Y, SUN L, YE S, et al. A highly sensitive in-situ turbidity sensor with low power consumption[J]. Photonic Sensors, 2014, 4(1): 77-85. doi: 10.1007/s13320-013-0154-z
    [14]

    QI Sh B, YI B A, YU J D. Turbidity detection system based on scattering and transmission method[J]. Mechanical & Electrical Engineering Magazine, 2019, 36(8): 771-776(in Chinese).
    [15]

    ZANG Zh Zh, QIU X B, GUAN Y M, et al. Determining moisture content of traditional Chinese medicines using a near-infrared LED-based moisture content sensor with spectrum analysis[J]. Optical and Quantum Electronics, 2019, 51(5): 133. doi: 10.1007/s11082-019-1848-2
    [16]

    ZANG Zh Zh, QIU X B, GUAN Y M, et al. A novel low-cost turbidity sensor for in-situ extraction in TCM using spectral components of transmitted and scattered light[J]. Measurement, 2020, 160: 107838. doi: 10.1016/j.measurement.2020.107838
    [17]

    ZHU L K, JIA F X, LI X L. Design of parallel high-speed FFT algorithm based on laser seeker signal[J]. Laser Technology, 2018, 42(1): 89-93(in Chinese).
    [18]

    BAI J W, ZHANG D Y, LIU Ch. Research of turbidity measuring influence caused by two different light source[J]. Optical Instruments, 2008, 30(2): 1-3(in Chinese).
    [19]

    LI N, QIU X B, WEI Y B, et al. A portable low-power integrated current and temperature laser controller for high-sensitivity gas sensor applications[J]. Review of Scientific Instruments, 2018, 89(10): 103103. doi: 10.1063/1.5044230
    [20]

    QIU X B, WEI Y B, SUN D Y, et al. A miniaturized laser mea-surement instrument of ammonia escaping from coal-fired power plants[J]. Laser Technology, 2019, 43(5): 697-701(in Chin-ese).
    [21]

    QIU X B. Design and application of embedded photoelectric detection system[M]. Beijing: Publishing House of Electronics Industry, 2019: 76-81(in Chinese).
    [22]

    INTERNATIONAL ORGANIZATION FOR STANDARDIZATION. ISO 7027-1: 2016. Water quality-determination of turbidity[S]. Geneva, Switzerland: The Spanish Association for Standardization and Certification, 2016: 1-7.
  • 加载中
通讯作者: 陈斌, bchen63@163.com
  • 1. 

    沈阳化工大学材料科学与工程学院 沈阳 110142

  1. 本站搜索
  2. 百度学术搜索
  3. 万方数据库搜索
  4. CNKI搜索

Figures(9) / Tables(2)

Article views(6814) PDF downloads(23) Cited by()

Proportional views

Research on an on-line turbidity sensor for traditional Chinese medicine based on spectrum analysis

    Corresponding author: QIU Xuanbing, qiuxb@tyust.edu.cn
  • 1. School of Applied Science, Taiyuan University of Science and Technology, Taiyuan 030024, China
  • 2. Key Laboratory of Modern Preparation of TCM, Ministry of Education, Jiangxi University of Traditional Chinese Medicine, Nanchang 330004, China

Abstract: In order to realize the on-line accurate measurement of turbidity of traditional Chinese medicine (TCM), the spectrum characteristics analysis method was used to establish the relationship between the spectrum characteristics and turbidity of the transmitted and scattered light signals. A near-infrared LED was employed as the light source of the sensor. The transmitted light and scattered light signals were converted into weak current signals by FDS100 photodiodes, then conditioned by a trans-impedance amplifier and a low-pass filter. The processed signals then were converted by A/D converters to digital signals. A MCU (STM32F405) was used to calculate fast Fourier transformation and turbidity. Finally, sixteen groups of standard turbidity solution (Formazin) ranging from 0NTU to 1000NTU were prepared using gradient dilution method to calibrate our sensor and make further verification, in addition, the sensor was applied for determination of the turbidity of angelica essential oil. The results show that the related coefficients of linear fitting of a ratio of the third and fifth harmonics components of the transmitted signal amplitude and the scattered signal amplitude are 0.9883 and 0.9946, respectively. And the minimum error and maximum error of our sensor are 0.471% and 3.768%, respectively. A good linear fitting degree of the turbidity of angelica essential oil is 0.99176, which satisfies real-time and on-line measurement requirements of essential oil extraction, concentration and drying. Therefore, the sensor has certain application filed for manufacturing and quality monitoring of TCM.

引言
  • 中药(traditional Chinese medicine,TCM)多来源于天然药物,迄今为止,中药的发展已有两千多年的历史[1]。浊度是中药成品质量检测的一项重要指标,中国药典规定的传统检测方法为目测比浊法[2],但在中药的制作加工过程中越来越需要对其浊度进行严格控制,精度要求较高,传统检测方法操作繁琐且误差较大,无法实现实时在线的准确检测,因此, 在线浊度检测就起到了至关重要的作用。

    浊度指的是液体的浑浊程度,是光与液体中悬浮微粒相互作用产生的一种光学效应,导致液体透明度的下降,浊度可以用仪器来进行测量[2]。目前,浊度测量已经广泛应用于饮用水、污水、江河湖泊等水质的监测[3],在化工[4](如石油开采等)、食品[5]、制药[6]、微生物[7]、机械加工[8]、农业[9]等领域也具有广泛的应用。

    浊度检测方法主要有透射法和散射法两种[10]。透射法从朗伯-比尔定律出发,当一束光透过待测液体时,液体中的悬浮微粒对光线吸收造成的衰减量来计算浊度的大小[10];而散射法适用于低浊度的检测[10],可以分为90°散射(米散射理论)和30°散射(瑞利散射理论)测量法,前者测量范围在0NTU~2000NTU且散射光强与浊度成正比,后者测量范围在320NTU~1760NTU且散射光强与浊度成反比[2]。许多国内外的研究者已利用这两种原理开发研制了多种高精度的在线浊度仪器。GILLETT等人研发了一种连续浊度监测器,成本仅为64美元,在0NTU~100NTU监测范围内具有1NTU的精度,并进行了38d的连续浊度监测试验[11]。YEOH等人开发了一种低成本的光纤浊度传感器,通过一对多模光纤采集30°~60°的散射光在0NTU~1000NTU的动态范围内进行了现场水质检测[12]。HU等人提出了一种灵敏度高且功耗低的原位浊度传感器,实现了0FTU~25FTU范围内的现场检测,灵敏度为0.0076FTU,工作电流仅为10mA[13]。然而,基于透射法或散射法进行浊度测量中,浊度测量值是建立在入射光和出射光的相对强度的关系上的,光源波动、环境光等因素都将引起相对强度的变化,因此其测量的精度将受到一定的质疑。为了降低光源波动及环境光的影响,QI等人提出了比率法进行浊度测量的方法,在0NTU~1000NTU范围内能将测量精度保持在±1%全量程(full scale,FS)内[14]。课题组在前期中药水分频谱分析的基础上[15],扩展了比率浊度测量方法,在0NTU~300NTU范围内的精度为3NTU[16]。由于精油的浊度是中药提取、浓缩及干燥工艺过程中关键性指标参量,其浊度测量范围0NTU~1000NTU,因此作者在前期基础上,基于嵌入式单片机,采用透射光和散射光信号的比率的频谱特征与浊度之间的联系,对当归精油浊度进行了实际测量。

1.   算法
  • 采用频率为100Hz、占空比为50%的方波信号对近红外发光二极管(light-emitting diode,LED)进行脉冲宽度调制(pulse width modulation,PWM),调制后的光强信号与样品相互作用后,携带浊度大小信息的透射光信号和90°方向的散射光信号被光电探测器接收并将其转换为电信号,再经电路放大滤波后进行频谱分析。

    根据朗伯-比尔定律,透射光强和浊度的关系可以表示为:

    式中,I1为透射光强,I0为入射光强,l为光穿过样品的长度,τ1为朗伯-比尔定律下的样品浊度系数。经过光电转换和电路的放大处理后得到的电信号为:

    式中, K1为电路增益系数。

    散射光信号遵循米散射理论,同样经过光电转换和电信号放大得到与浊度的关系式为:

    式中,K2为电路增益系数,I2为散射光强,M为米散射系数,τ2为米散射理论下的样品浊度系数。

    传感器利用比值法,将散射光强和透射光强取对数之后的值相比:

    式中,kb为常系数,τ为比值后样品浊度系数。由(4)式可知:比值与浊度具有线性关系。利用比值法可以消除样品颜色和环境光等的干扰,从而提高传感器的测量精度。

  • 频谱分析是将脉冲调制后的透射光和散射光的时域信号通过快速傅里叶变换(fast Fourier transformation,FFT)转换到频域进行分析和处理的一种方法,在频域中可以得到相对于时域更加丰富的特征量[15]

    频率为1/T、占空比为50%的方波信号,其时域表达式为:

    式中,t为时间,A为幅值。根据傅里叶级数,方波的傅里叶级数的偶次谐波分量均为0,因此方波可以表示为一系列奇次谐波分量的叠加:

    式中,ω为谐波频率。进行n点FFT,变换后的每个点可以用复数表示为:α+βi。

    根据FFT原理[17],变换后第n点对应时域中一定频率的正弦信号:

    式中,An, Fn, φn分别为n点信号的幅值、频率和相位角。

    经电路放大滤波后的时域调制信号,再由模数转换为数字信号,在单片机内部利用FFT变换进行频谱分析,将调制信号在频域的奇次谐波分量提取出来,得到和浊度相关性强的谐波分量(基频、三次谐波和五次谐波)。

    由于时域中透射光强和散射光强的变化对应频域中其各次谐波分量幅值的变化,因此,可以在频域中构建谐波幅值与浊度的数学模型,同(4)式。

2.   硬件系统
  • 传感器的系统结构如图 1a所示。其中,采用高性能的单片机STM32F405作为微控制器(micro control unit, MCU),用程序设置使单片机内部通过PWM输出方波信号来驱动近红外LED发出。光电探测器1与LED光源在一条直线上,光电探测器2与LED光源呈90°放置,分别接收透射光信号和散射光信号。光电探测器将光信号转换为电流信号,分别进行跨阻放大和滤波处理,再经外部模数(analog-to-digital,A/D)转换器转换为数字信号,信号最终通过串行外设接口(serial peripheral interface, SPI)SPI 1和SPI 3传送至单片机内部,通过嵌入式软件算法进行数字信号处理和浊度反演。测量结果可以通过通用同步异步收发机(universal synchronous/asynchronous receiver/transmitter,USART)将数据发送到个人电脑(personal computer,PC),同时也实时显示到液晶显示屏(liquid crystal display,LCD)。采用光路嵌入电路的集成一体化设计,不仅提高了传感器的便携性,而且有效抑制了环境光的干扰,实物图如图 1b所示。

    Figure 1.  a—structure diagram of TCM turbidity sensor b—printed circuit board photograph of TCM turbidity sensor

    比色皿(样品)夹持器采用黑色聚乳酸材料通过3-D打印而成,大小为:30.5mm×28.5mm×30mm。比色皿尺寸为12.5mm×12.5mm×45mm,通光孔直径为6mm,LED光源和两个探测器的光学中心位于同一高度的水平面上,且保证透射光和散射光的光程相同。

  • 光源采用日本滨松L12756近红外LED,其中心波长为860nm,出射功率为23mW,带宽为90nm,相比400nm~600nm的卤素钨更能消除中药色度对测量的影响[18]。光源的驱动电路如图 2所示。LED采用恒流源驱动,保证其出射功率一致性[19]。OPA188是一种低噪声单运放芯片,第1级运放为电压跟随器,减小输入信号的损耗,第2级用于驱动三极管PZTA29,通过利用反馈电阻不断改变其基极电压使电流保持恒定。在电路输出端反接一个肖特基二极管SS54用于保护LED光源。

    Figure 2.  Constant-current source circuit of illuminant source

  • 光电探测器采用Thorlabs的FDS100硅光电二极管,响应度为0.65A/W,具有高灵敏度、低噪声的优点。将接收到的光信号转换为微弱的电流信号,易受到噪声的影响,通过两路相同的信号预处理通道分别对透射光和散射光信号进行放大滤波。AD8066为高性能的双路集成运放,包含AD8066(1)和AD8066(2),分别设置为跨阻放大器和低通滤波器,如图 3所示。携带浊度信息的微弱电流信号先通过跨阻放大器放大为一定比例的电压信号[20],再经低通滤波器滤除电路中的高频噪声。模数转换器采用模拟公司的ADS8864,其分辨率为16位、转换速率为400×103sample/s。两个ADS8864的SPI接口分别与单片机的SPI 1和SPI 3相连,实现了数据的高速传输。

    Figure 3.  The preprocessing circuit of the signal

3.   嵌入式分析软件开发
  • 将FFT算法移植到STM32嵌入式平台,实现了噪声滤除和浊度的快速反演。传感器采用基于Cortex-M4内核的高性能单片机STM32F405VGT6作为嵌入式平台,该单片机具有168MHz的高工作频率,集成硬件浮点运算单元(floating point unit,FPU),支持数字信号处理(digital signal processing,DSP)指令。FFT算法的嵌入式移植基于STMicroelectronics官方的ARMDSP库,选用DSP库中运算速度较快的基4浮点FFT算法,FFT点数为4n图 4为FFT嵌入式开发的流程图[21]。首先从ST官方下载DSP库,将arm_cortexM4lf_math.lib (浮点Cortex-M4小端模式)添加到Keil MDK项目工程,开启浮点运算单元,添加与基四浮点FFT相关的C文件,arm_common_tables.c(提供相关参量表),arm_cmplx_mag_f32.c(取模值),arm_cfft_radix4_init_f32.c(FFT初始化),arm_cfft_radix4_f32.c(包含FFT运算的函数)。在系统初始化之前先启动FPU,再调用FFT的初始化函数:arm_cfft_radix4_init_f32(arm_cfft_radix4_instance_f32 * S, uint16_t fftLen, uint8_t ifftFlag, uint8_t bitReverseFlag);其中,*S是FFT初始化参量结构体变量指针,fftLen变量决定FFT的点数,设置为1024点。FFT运算调用FFT变换函数和取模函数:arm_cfft_radix4_f32(const arm_cfft_radix4_instance_f32 * S, float32_t * pSrc);arm_cmplx_mag_f32(float32_t * pSrc, float32_t * pDst, uint32_t numSamples);*pSrc指针指向FFT输入/输出数据数组,将输入数组的数据进行FFT变换再以复数的形式存入此数组,经取模函数得到最终变换结果。

    Figure 4.  Flow chart of embedded software design

    将A/D转换后的透射和散射的时域数据通过单片机的SPI 1和SPI 3分别接收到两个输入数组,并调用两次FFT变换函数和取模函数,在此过程中通过设置TIM2定时器的预分频系数和周期控制FFT的采样率为25kHz。在实际标定中结合测量原理得到标定公式,写入程序中计算出浊度值。

4.   传感器标定
  • 根据ISO7027国际标准[22],采用福尔马肼标准浊度液进行传感器的标定。根据稀释定律:

    式中, N2为稀释后的浊度,V2为稀释后的体积,N1为原液浊度,V1为所需原液量。用0NTU的双蒸水将1000NTU的标准浊液梯度稀释得到16种不同浊度的样液,如表 1所示。分别将这16组样液逐次加入到传感器的比色皿中,用示波器同时采集放大滤波后的透射和散射电压信号,将数据上传到计算机中,以便进行分析。图 5为各个浊度下透射和散射的原始时域信号图。透射信号的幅值随样品浊度的增加而衰减,散射信号的幅值随浊度的增加而增大。为提高信号的信噪比,通过db4的小波滤波算法滤除噪声[16]图 6为滤波后的时域响应信号。

    sample number turbidity/NTU sample number turbidity/NTU
    1 0 9 300
    2 10 10 400
    3 20 11 500
    4 30 12 600
    5 40 13 700
    6 50 14 800
    7 100 15 900
    8 200 16 1000

    Table 1.  Samples of different turbidity

    Figure 5.  The original time-domain signal for different turbidities

    Figure 6.  The filtered time-domain signal for different turbidities

    利用FFT变换将滤波后的信号进行频谱转换,得到不同浊度下对应的幅频关系图,如图 7所示。频域信号的一次谐波、三次谐波和五次谐波的幅值随浊度增加的变化最为明显,如课题组前期工作[15-16]。将透射信号一次谐波、三次谐波、五次谐波的幅值取对数,与对应频率下散射信号的幅值进行比值,得到浊度与比值的散点图,如图 8所示。其中,图 8a为100Hz比值与浊度关系图,可以看出其不成线性关系; 图 8b为300Hz和500Hz的拟合结果。浊度和比值呈线性相关,拟合关系式为(9)式和(10)式,相关系数R分别为0.9883和0.9946,在500Hz下具有更好的线性度。

    Figure 7.  The filtered frequency-domain signal for different turbidities

    Figure 8.  Scatter diagram of turbidity-ratio and fitting line

  • 将500Hz下的线性拟合关系式移植到嵌入式平台实现最终的浊度值计算。为验证标定结果的可靠性,重新配置了8种不同浊度的标准浊度液进行验证性测量,结果如表 2所示。其中平均相对误差如下:在70NTU时,最小测量误差为0.471%;在540NTU时,最大测量误差为3.768%。

    sample number sample turbidity/NTU mean of measurement/NTU average error/%
    1 0 0.93
    2 70 70.33 0.471
    3 140 141.08 0.771
    4 280 289.36 3.343
    5 360 363.18 0.883
    6 460 465.62 1.222
    7 540 560.345 3.768
    8 640 660.045 3.132
    9 740 764.415 3.299
    10 840 860.19 2.404
    11 1000 1015.39 1.539

    Table 2.  Measurement results of standard turbidity liquid

5.   当归精油浊度的线性度测试
  • 将标定好的传感器用于当归精油浊度的实验室测量。取0.05g当归提取精油,加入2%的吐温乳化剂,再加入50mL的双蒸水定容,得到质量浓度为1mg/mL的当归精油溶液,根据稀释定律将此溶液梯度稀释为0.1mg/mL~0.9mg/mL。将待测的10组当归精油溶液充分摇匀后,用注射器注入传感器的比色皿中进行实际测量,将测量到的浊度值与质量浓度作线性拟合,结果如图 9所示。其中R2=0.99176,达到了精油提取、浓缩及干燥的实时在线测量需求,在中药的制造加工和质量监测中具有一定的应用价值。

    Figure 9.  A linear analysis of turbidity and mass concentration of angelica essential oil

6.   结论
  • 提出了一种以STM32F405单片机作为主控核心的低成本中药浊度在线传感器,利用透射光和散射光的比值进行频谱分析,采用500Hz的频率成分实现了高精度的浊度测量。传感器采用了光路和电路集成一体化的设计,提高了便携性,降低了成本。采用福尔马肼标准浊度液对传感器进行了标定,结果表明,拟合相关系数各为0.9883和0.9946;验证实验表明,其最大误差为3.768%,最小误差为0.471%。用传感器进行了当归精油的实际浊度测量,其R2=0.99176。设计的传感器达到了精油提取、浓缩及干燥的实时在线测量需求,在中药的制造加工和质量监测中具有一定的应用价值。

Reference (22)

Catalog

    /

    DownLoad:  Full-Size Img  PowerPoint
    Return
    Return