AN4451 Application note Signal conditioning for a UV sensor Nicolas Aupetit Introduction This application note describes the analog conditioning circuit used for a high impedance sensor that acts like a current sensor. It explains how to condition a signal coming from the sensor - in this case an ultraviolet (UV) sensor - and how to improve performance. While sunlight is important for our health, overexposure to it carries significant health risks. For example, sunburn is caused by the UV radiation contained in sunlight. Measurement of UV is important from a medical point of view, but for various other reasons too. The detection of UV rays is important in the industrial domain, particularly to detect flame in a blue flame oil burner or in some fire detectors. Knowing the right levels of UV for plant growth is also important. Low levels of UV light have a positive effect on plant growth and seed germination but, higher levels can be harmful and even toxic. UV is part of our life and if it is not well controlled it can cause damage. Consequently, UV sensors are very important. March 2014 DocID025985 Rev 1 1/15 www.st.com Contents AN4451 Contents 1 How does the UV sensor work ....................................................... 3 1.1 Signal conditioning of the UV sensor ................................................ 3 1.2 Application example .......................................................................... 4 1.3 Input offset voltage (Vio) ................................................................... 4 1.4 Feedback resistance ......................................................................... 4 1.5 Input bias current (Iib) ....................................................................... 5 1.6 UV sensor equivalent circuit .............................................................. 5 1.7 Resistors Rs and Rj .......................................................................... 5 1.8 Capacitors Cj, Cin, and Cf ................................................................. 6 2 3 Stability of the UV sensor ............................................................... 8 Noise reduction ............................................................................. 11 4 Output voltage limitation .............................................................. 12 5 Conclusion ..................................................................................... 13 6 Revision history ............................................................................ 14 2/15 DocID025985 Rev 1 AN4451 1 How does the UV sensor work How does the UV sensor work A UV sensor works as a photodiode. When a UV source irradiates the sensor, UV radiation is converted into a small current proportional to the UV radiation. Obviously, the delivered current depends on the UV sensor used. Formula (1) shows a rough estimation of the photocurrent (Ip) given for a particular active chip area (AChip). where: Achip is the active chip area in m 2 Schip is the chip’s spectral sensitivity in AW -1 Eλ is the spectral irradiance of the UV light source which can be measured in mWcm nm -2 1.1 -1 Signal conditioning of the UV sensor The UV sensor generates a small current, generally a few nA, which is proportional to the UV insulation. Figure 1 exhibits a transimpedance amplifier configuration that is used to convert this current into an adequate voltage that can be read by the ADC of the microcontroller. Figure 1: Transimpedance amplifier Cf Rf Uv sensor STM32 microcontroller Vcc I_Uv Vout + Rn ADC Cn The op-amp converts the current generated by the sensor into a voltage thanks to the Rf resistor. The output voltage sensed by the ADC is theoretically given in formula (2): DocID025985 Rev 1 3/15 How does the UV sensor work 1.2 AN4451 Application example The UV sensor under consideration in this application note is the GUVA-C22SD from the Genuv Company (see Figure 2). Figure 2: UV sensor application 10pF 8.2MΩ UV radiation Index 4 Vcc 104nA - Uv sensor GUVA-C22SD OA1MPA Vout + The GUVA-C22SD sensor delivers a current of 26 nA/UV index. Rf is set @ 8.2 MΩ. Consequently, this sensor receives UV radiation with an index of 4 (Vout = 26 nA * 4 * 8.2 MΩ = 852.8 mV). 1.3 Input offset voltage (Vio) As the ideal op-amp does not exist, it must be accepted that the op-amp itself has an impact. For example, an op-amp adds a DC offset on the output which is directly linked to the input voltage offset (see formula (3)). Consequently, it is better to choose an op-amp with a low input voltage offset (Vio). The OA1MPA is a good op-amp in this respect as it offers a maximum Vio of 200 µV. By taking the Vio into account, the Vout becomes: Vout = 26 nA * 4 * 8.2 MΩ ± 200 µV. Thus, Vout is in the range [852.6 mV:853 mV] which is an error of 234 ppm! 1.4 Feedback resistance As the current generated by the UV sensor is extremely small, it is advised to use the largest feedback resistor possible to benefit from the ADC performance. Even though it may seem paradoxical, a large feedback resistor also helps to improve the SNR. Effectively, resistance noise is thermal noise which is defined as: en_Rf = √4*K*T*Rf, -23 where K is the Boltzmann’s constant (1.38x10 J/K) and T is Temperature ºK (T ºC + 273.15). The SNR is expressed in formula (4). By using a large feedback resistor, the SNR is improved by √Rf. 4/15 DocID025985 Rev 1 AN4451 1.5 How does the UV sensor work Input bias current (Iib) By choosing a large feedback resistor while simultaneously trying to achieve a high gain, the input bias current of the op-amp causes another DC offset: Iib * Rf. Consequently, a low bias current op-amp is needed to obtain the highest sensitivity. To achieve this, it is extremely important to choose a CMOS op-amp such as the OA1MPA which offers a very low Iib (10 pA @25 °C). The total output voltage must also be considered (see formula (5)). If we consider the UV sensor application described in this document (see Figure 2) and if we use the OA1MPA as the transimpedance amplifier, the total Vout is: Vout = 26 nA * 4 * 8.2 M Ω ±200 µV ±10 pA * 8.2 MΩ. Consequently, Vout is in the range [852.5 mV:853.1 mV]. This represents an error of 330 ppm compared to the theoretical value. 1.6 UV sensor equivalent circuit Figure 3 exhibits the equivalent circuit of the photodiode, where Cj and Rj represent respectively the junction capacitor and the shunt resistor of the diode junction. Figure 3: Equivalent circuit of UV sensor Rs Serial res Ip photocurrent 1.7 Cj Rj Resistors Rs and Rj The resistance of the output source, Rs, is generally negligible. On the contrary, the diode shunt resistance, Rj, should be as high as possible. For example, regarding the UV sensor GUVA-C22SD, Rj is in the range 100 GΩ. Effectively, without any current in the photodiode, an output of 0 V is theoretically expected. However, in reality Vout is as shown in formula (6). Clearly, it is extremely important to have a low Vio and an UV sensor with a high Rj to limit the offset error on the output. DocID025985 Rev 1 5/15 How does the UV sensor work 1.8 AN4451 Capacitors Cj, Cin, and Cf In general, transimpedance amplifiers are prone to oscillate. To understand the stability of this kind of architecture, it is important to take into consideration all components of the amplifier, even parasitic components, as shown in Figure 4. Figure 4: Components that need to be considered in a transimpedance amplifier Cf Rf Vcc Rs Ip photocurrent Cj -OA1MPA + Cin Rj Vout The noise gain of the above configuration determines the stability of the circuit. Generally, Rf is high to provide enough gain to convert the current of the UV sensor into a measureable voltage. However, Rf combined with Cin and Cj creates a pole which ensures instability of the circuit. In Figure 5, we can see that for a high value of Rf (8.2 MΩ) and no feedback capacitor (Cf), the output of the OA1MPA is unstable. Figure 5: OA1MPA output response to a small current signal without feedback capacitance, Rf = 8.2 MΩ 3 1.E-07 2.5 1.E-07 8.E-08 2 6.E-08 1.5 4.E-08 1 Vout (V) I_UV (A) Current from the UV sensor Vout of the OA1MPA 2.E-08 0.5 0.E+00 0 0.01 0.02 0.03 Time (s) 0.04 0.05 0 0.06 By adding a small capacitor (Cf) across Rf, oscillations or gain peakings are suppressed and the output is stabilized (see Figure 6). 6/15 DocID025985 Rev 1 AN4451 How does the UV sensor work Figure 6: OA1MPA output response to a small current signal with feedback capacitance, Cf = 10 pF and Rf = 8.2 MΩ 3 1.E-07 2.5 Current form the UV sensor 8.E-08 2 6.E-08 1.5 4.E-08 1 Vout (V) I_UV (A) 1.E-07 Vout of the OA1MPA 0.5 2.E-08 0.E+00 0 0.01 0.02 0.03 Time (s) DocID025985 Rev 1 0.04 0.05 0 0.06 7/15 Stability of the UV sensor 2 AN4451 Stability of the UV sensor UV sensors are generally very capacitive. For example, the GUVA-C22SD UV sensor has an internal capacitance of 100 pF and the OA1MPA adds an additional input capacitance of 3 pF. Such capacitance has a direct impact on the stability of the system. This section describes how to calculate the minimum value of the Cf capacitor (see Figure 7). Cf is a feedback capacitor which is added in parallel with the transimpedance resistor. Its function is to stabilize the system. As Cf limits the bandwidth, it therefore minimizes noise. In the formulas below, Cin and Cj are considered as a unique capacitor, Cg, (see Figure 7). The serial resistor, Rs, which has a resistance of about 100 Ω is neglected. Figure 7: Simplified equivalent circuit Cf Rf 8.2MΩ Vcc GUVA-C22SD Cg 103pF OA1MPA + Rg 100GΩ Vout The open loop transfer function of the system is given in formula (7). ∗ ∗ where: A is the open loop transfer function of the op-amp. However, by using formula (7), a pole appears and must be considered, as shown in formula (8). 1 8/15 ∗ DocID025985 Rev 1 AN4451 Stability of the UV sensor A zero also appears and must be considered, as shown in formula (9). 1 In addition, the low-frequency pole of the op-amp's open loop transfer function must be considered, as shown in formula (10). Therefore, the bode diagram of this system can be plotted as shown in Figure 8. Figure 8: Bode diagram of the open loop transfer function of an application using a UV sensor We can consider that Rg (100 GΩ) >> Rf (10 MΩ), so fz > fp. With these considerations, 1 To guaranty stability of the system, the bode diagram must cross the X-axis with a slope of -20 dB/decade. So, considering Figure 8, and to ensure stability, the gain at frequency fz must be greater than 1. Consequently, formula (11) is inferred. DocID025985 Rev 1 9/15 Stability of the UV sensor AN4451 A second order equation can be deduced as shown in formula (12). So, we can deduce the minimum feedback capacitance of Cf to guaranty stability of the OA1MPA, is shown in formula (13). In this application, GBP = 120 kHz, Cg = 103 pF, and Rf = 8.2 MΩ. Using formula (13), we can calculate that the minimum feedback capacitance of Cf is 4.2 pF. 10/15 DocID025985 Rev 1 AN4451 3 Noise reduction Noise reduction The Cf capacitor added in parallel with the Rf resistor helps to stabilize the transimpedance of the application. It also lowers the bandwidth of the system. The cut off frequency is given by formula (14). 1 If we consider a feedback capacitance of Cf = 10 pF, the bandwidth is limited to 1.9 kHz and noise is also reduced on the output. A simple RC filter may also be added on the output of the OA1MPA to obtain an overall second filter Rn, Cn as shown in Figure1 and as described in formula (15). 1 If the bandwidth is a critical requirement, choose an op-amp with a higher bandwidth like the TSV731 (GBP = 900 kHz). In addition, try to reduce the transimpedance gain (Rf) and add a second stage of voltage gain. The drawback is higher noise on the output. DocID025985 Rev 1 11/15 Output voltage limitation 4 AN4451 Output voltage limitation To improve the sensitivity of the UV sensor, use it in photovoltaic mode i.e. with a zero bias operation. In this case, the dark current offset is generated by the photodiode leakage. If the op-amp is used in single supply from GND to Vcc (as shown in Figure1), the Vol output saturation of the OA1MPA might be a limitation for treating low UV radiation levels. Despite the fact that the OA1MPA is an output rail-to-rail op-amp, it has a Vol output saturation voltage of 40 mV @ 25 °C. When it is important to know precisely the current delivered by a sensor with a low UV intensity, add a reference to avoid Vol limitation as shown in Figure 9. Figure 9: How to avoid Vol limitation 10pF 8.2MΩ Vcc Uv sensor OA1MPA STM32microcontroller Microcontroller STM32 Vout + Rn ADC Cn Vref=100mV In the above case, there is an offset of 100 mV at Vout. It is important to connect Vref to the ADC to obtain a precise calculation. 12/15 DocID025985 Rev 1 AN4451 5 Conclusion Conclusion UV sensors provide an extremely small current depending of the level of UV radiation. To convert this current to an adequate voltage, a transimpedance amplifier is used. Then, an ADC can convert the signal into the digital domain. For this kind of application, it is important to choose a CMOS rail-to-rail amplifier with a low Vio to avoid inducing big errors on the output. The OA1MPA is a good option for such a UV sensor application. However, stability must be also taken into account and the right components must be chosen, particularly the feedback capacitor Cf which helps to stabilize the system, limit bandwidth, and reduce noise. Benefit from a wide portfolio of analog switches, voltage references, temperature sensors, pressure sensors, or microcontrollers to develop your application, by making STMicroelectronics your one-stop shop as illustrated in Figure 10. Figure 10: UV sensor evaluation board DocID025985 Rev 1 13/15 Revision history 6 AN4451 Revision history Table 1: Document revision history 14/15 Date Revision 18-Mar-2014 1 DocID025985 Rev 1 Changes Initial release. AN4451 Please Read Carefully Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ("ST") reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST’s terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. ST PRODUCTS ARE NOT DESIGNED OR AUTHORIZED FOR USE IN: (A) SAFETY CRITICAL APPLICATIONS SUCH AS LIFE SUPPORTING, ACTIVE IMPLANTED DEVICES OR SYSTEMS WITH PRODUCT FUNCTIONAL SAFETY REQUIREMENTS; (B) AERONAUTIC APPLICATIONS; (C) AUTOMOTIVE APPLICATIONS OR ENVIRONMENTS, AND/OR (D) AEROSPACE APPLICATIONS OR ENVIRONMENTS. WHERE ST PRODUCTS ARE NOT DESIGNED FOR SUCH USE, THE PURCHASER SHALL USE PRODUCTS AT PURCHASER’S SOLE RISK, EVEN IF ST HAS BEEN INFORMED IN WRITING OF SUCH USAGE, UNLESS A PRODUCT IS EXPRESSLY DESIGNATED BY ST AS BEING INTENDED FOR "AUTOMOTIVE, AUTOMOTIVE SAFETY OR MEDICAL" INDUSTRY DOMAINS ACCORDING TO ST PRODUCT DESIGN SPECIFICATIONS. PRODUCTS FORMALLY ESCC, QML OR JAN QUALIFIED ARE DEEMED SUITABLE FOR USE IN AEROSPACE BY THE CORRESPONDING GOVERNMENTAL AGENCY. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners. © 2014 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com DocID025985 Rev 1 15/15