Liquid Sensing: Visible light absorption spectroscopy and colorimetry are two fundamental tools used in chemical analysis. Most of these light-based systems use photodiodes as the light sensor, and require similar high input impedance signal chains. This session examines the different components of a photodiode amplifier signal chain, including a programmable gain transimpedance amplifier, a hardware lock-in amplifier, and a Σ-Δ ADC that can measure a sample and reference channel to greatly reduce any measurement error due to variations in intensity of the light source.
Gas Sensing: Many industrial processes involve toxic compounds, and it is important to know when dangerous concentrations exist. Electrochemical sensors offer several advantages for instruments that detect or measure the concentration of toxic gases. This session will describe a portable toxic gas detector using an electrochemical sensor. The system presented here includes a potentiostat circuit to drive the sensor, as well as a transimpedance amplifier to take the very small output current from the sensor and translate it to a voltage that can take advantage of the full-scale input of an ADC.
Unblocking The Main Thread Solving ANRs and Frozen Frames
Instrumentation: Liquid and Gas Sensing - VE2013
1. Instrumentation: Liquid and Gas
Sensing
Reference Designs and System Applications
Walt Kester, Applications Engineer, Greensboro, NC, US
2. Today's Agenda
Understand challenges of precision high impedance sensing
applications
Electrochemical gas detection (CN0234)
Spectroscopy application using transimpedance amplifiers for
photodiode preamplifiers (CN0312)
Design problems
Low current measurement
Noise
Maintaining required bandwidth
Applications selected to illustrate important design principles
applicable to a variety of high impedance sensor conditioning
circuits
See tested and verified Circuits from the Lab® signal chain solutions
chosen to illustrate design principles
Low cost evaluation hardware and software available
Complete documentation packages:
Schematics, BOM, layout, Gerber files, assemblies
3
3. Circuits from the Lab
Circuits from the Lab® reference circuits are engineered and tested
for quick and easy system integration to help solve today’s analog,
mixed-signal, and RF design challenges.
4
Complete Design Files on
CD and Downloadable
■ Windows Evaluation Software
■ Schematic
■ Bill of Material
■ PADs Layout
■ Gerber Files
■ Assembly Drawing
■ Product Device Drivers
Evaluation Board Hardware
4. System Demonstration Platform (SDP-B, SDP-S)
The SDP (System Demonstration Platform) boards provides intelligent USB
communications between many Analog Devices Evaluation Boards and
Circuits from the Lab boards and PCs running the evaluation software.
5
EVALUATION
BOARD
SDP-B
USB
POWER
USB
SDP-S
EVALUATION
BOARD
POWER
SDP-S (USB to serial engine based)
One 120-pin small footprint connector.
Supported peripherals:
I2C
SPI
GPIO
SDP-B (ADSP-BF527 Blackfin® based)
Two 120-pin small footprint connectors
Supported peripherals:
I2C
SPI
SPORT
Asynchronous Parallel Port
PPI (Parallel Pixel Interface)
Timers
5. Gas Detectors
Commonly used for industrial safety
Area monitors permanently mounted near potential
gas sources
Portable detectors worn on worker’s clothing
Capable of detecting sub-ppm levels of toxic gases
Use infrared light, electrochemical sensors, heat, or a combination
Multiple-gas detectors will typically have one sensor per target gas
6
6. Gas Detection Using Electrochemical Sensors
Typically used as toxic gas detectors
Carbon monoxide, chlorine, hydrogen sulfide and other nasty industrial
chemicals
Can detect down to sub-ppm levels of gas concentration
Could have VERY long settling times (10s or minutes)
A potentiostat circuit is used to keep the reference electrode and
working electrode at the same voltage by controlling the voltage at
the counter electrode
A transimpedance amplifier converts the current in/out of the
working electrode into a voltage
7
+
−
…To make the
voltage between
RE and WE 0V…
...and this current is
proportional to gas
concentration…
200µA FS typical
Inject current
here…
7. CN0234: Single Supply, Micropower Toxic Gas
Detector Using an Electrochemical Sensor
Circuit Features
Low power gas detection
110 µA total current
Buck-boost regulator for high
efficiency
Circuit Benefits
Detects dangerous levels of gas
Low power, battery operated
8
Target Applications Key Parts Used Interface/Connectivity
Industrial
Medical
Consumer
ADA4505-2
ADR291
ADP2503
AD7798
SPI (AD7798)
SDP(EVAL-CN0234-SDPZ)
USB (EVAL-SDP-CB1Z)
EVAL-CN0234-SDPZ
ADAPTER BOARD
TO EVAL-SDP-CB1Z
Industry-Standard
Footprint
8. 5V, AVCC 3.3V
AIN1(+)
AIN1(−)
AVDD
VIN VOUT
REFIN(+) DVDD
REFIN(−)GND
DOUT/RDY
DIN
SCLK
CS
AD7798
TO
SDP
2.5V
4
6
5
C6
10µF
C11
0.1µF
C13
2.2µF
C12
0.1µFC10
22µF
R5
100kΩ
R8
11.5kΩ
R7
330kΩ
R6
36.5kΩ
R4
33Ω
AVCC
R3
1MΩ
R2
11kΩ
R1
11kΩ
R6
1kΩ
G
D
Q1
MMBFJ177
S
G
D
Q2
NTR2101PT1GOSCT
S
C5
0.02µF
C9
22µF
4
5
8
7
SW1
PVIN
VIN
EN AGND
SYNC/
MODE
SW2
VOUT
FB
PGND
2
1
10
3
6 9
C4
0.02µF
C3
0.02µF
C2
0.1µF
C1
0.1µF
2.5V
GND
VREF
L1
1.5µH
ADP2503ACPZ
1
1
CE
RE
WE
2
3
U3
CO-AX
2
AGND
U2-B
ADA4505-2U2-A
ADA4505-2
U1
ADR291GR AVCC
832 6
4
J2-1
J2-2
DGND 1
2
B2
1
2
B1
2
1
AVCC
2.5V TO 5.5V
EXTERNAL
INPUT
L2
1k AT 100MHz
+
+
5V
VCC
5V
AVCC
CN0234: Single Supply, Micropower Toxic Gas
Detector Using an Electrochemical Sensor
9
Total current consumption is 110 μA
for normal operation (not including
ADC).
P-Channel JFET keeps
RE and WE shorted when
circuit is powered off.
ADP2503 buck-boost
regulates battery input
or external power to 5 V
ADR291 generates 2.5 V
to offset circuit for single
supply operation
Efficient reverse
voltage protection
ADA4505-2 has 2 pA max
Input bias current and 10 μA
quiescent current per amp
AD7798 16-bit sigma-delta
ADC provides differential
input, and allows full
evaluation of front end
circuit.
Can be in power down
mode most of time @ 1 µA
0.16Hz BW
9. Gas Detection Using Electrochemical Sensors
Most instruments are portable, battery powered.
Low power consumption is absolute highest priority.
Impractical to power down analog circuitry due to long sensor settling times.
Bandwidth is less than 1 Hz, so micropower op amps are a good fit.
Typical accuracy of 1% to 5% is required.
10
10. CN0234 Features and Hints
Provides a convenient platform to experiment with electrochemical
sensors
Sensor can measure up to 2000 ppm of carbon monoxide
2000 ppm of carbon monoxide will kill you, so test with less than 100 ppm
unless using a fume hood.
Electrochemical sensors’ offset is very sensitive to temperature and
humidity
Best practice is to calibrate with a known gas concentration periodically.
On-board 16-bit ADC allows evaluation of entire sensor circuit
Using a 16-bit ADC results in high dynamic range without the need for
programmable gains.
10-pin header allows easy access to ADC’s serial port
Easy to interface to your own microcontroller or Analog Devices' SDP board
using adapter board.
11
11. CN0234 Circuit Evaluation Board
EVAL-CN0234-SDPZ
12
SDP CONNECTOR
10-PIN FEMALE
CONNECTOR
10-PIN MALE CONNECTOR ON BOTTOM OF PCBSOFTWARE DISPLAY
Complete Design Files
■ Schematic
■ Bill of Material
■ PADs Layout
■ Gerber Files
■ Assembly Drawing
EVAL-CN0234-SDPZ
ADAPTER BOARD
TO EVAL-SDP-CB1Z
Industry-Standard
Footprint
12. Spectroscopy and Colorimetry
13
Fundamentals of Spectroscopy
Signal Conditioning
Synchronous Detection
Photodiode Fundamentals
Photodiode Preamp Design Challenges and Solutions
■ Bias Current
■ Stability
■ Noise
Programmable Gain Transimpedance Amplifiers (PGTIA)
CN0312 Dual Channel Spectroscopy/Colorimetry Demo
Board Illustrates a System Solution
13. Quick Intro to Spectroscopy
Spectroscopy is the study of the interaction of matter and radiated
energy.
Matter = liquids and gases
Radiated energy = light
14
We can use spectroscopy techniques to
answer two questions about an unknown
sample:
■ What is it?
■ How much is there?
Light after passing
through a prism
14. What Is It? (Absorption Spectra)
All atoms and molecules have unique and well known spectra
By measuring a material’s spectra, we can determine the chemical composition,
concentration, etc.
No need to look at the entire spectrum—measuring a subset of wavelengths
may be sufficient
Absorption spectrum
A sample absorbs light at specific wavelengths according to the compounds or
molecules present in it
After obtaining the absorption spectrum of a sample, we can refer to libraries
containing thousands of spectrums for known substances
15
Absorption Spectra for Hydrogen
15. How Much Is There? (Beer-Lambert Law)
Measure the Concentration
“ The [light] absorbed is directly proportional to the path length
through the medium and the concentration of the absorbing
species.”
This works for gases or liquids.
c = Concentration
l = Path length
ε = Molar absorptivity
(Known constant for a given
compound)
16
16. Beer-Lambert Law in the Real World …
In real life, whatever we are measuring needs to be in a container of
some sort.
The container walls will cause reflections, extra absorption, and light scattering,
making it impossible to apply the simple Beer-Lambert Equation.
To compensate for the effects of the container, we can compare the
absorption between two containers.
One container holds the sample, while the other container holds a known
substance (such as water, air, or whatever solvent was used to prepare the
sample)
Instead of looking at the difference between transmitted and
received light, we look at the ratio of light received through the
sample cell, and light received through the reference cell.
17
17. So Where Is This Stuff Used Anyway?
18
Chromatography
Gas
Liquid
Spectroscopy
Ultraviolet (UV)
Visible (VIS)
Near infrared (IR)
Fourier Transform IR (FT-IR)
Raman
Fluorescence
Atomic Absorption
Particle Analysis
Nondispersive Infrared (NDIR)
Gas Detection
Colorimetry
Water Quality
Flame Detection
18. UV-VIS Spectroscope Sensor Signal Chain
19
Programmable gain
transimpedance amp
AC coupling
buffering
Synchronous
detector (full-
wave rectifier)
24-bit
sigma-delta
ADC
Signal bandwidths tend to be < 5 kHz, but
front-end op amp may have very high gain.
Liquid
19. Synchronous Detection in the Frequency
Domain (Similar to RF Demodulation or Full-
Wave Rectification)
It is equivalent to having a band-pass filter around the modulation
frequency
Unlike a discrete component band-pass filter, it can easily be made very narrow
at the expense of response time.
Using a square wave makes modulation very simple
Noise at harmonics of the fundamental does not get rejected, so select
modulation frequency carefully!
20
20. Ultraviolet-Visible (UV-VIS) Sensor: “Large Area”
Silicon Photodiode
Modeled as a light-dependent current source
Cj can be 50 pF to 5000pF depending on the size of the diode
Rsh can be from 500 MΩ to 5 GΩ at 25°C for different diodes
Rs is typically a few ohms and can be ignored for most calculations
Dark current is the amount of current generated when no light hits
the photodiode
Should ideally be zero, but increases with reverse bias voltage
21
CjRsh
Id
Rs
21. Photodiode Transfer Function
Operating the photodiode with zero reverse bias results in the
lowest dark current (photovoltaic mode)
Manufacturers typically spec dark current at Vr = 10 mV
22
(a) (b)
PHOTODIODE
CURRENT
DARK
CURRENT
PHOTODIODE
VOLTAGE
SHORT CIRCUIT
CURRENT
SHORT
CIRCUIT
VOLTAGE
LIGHT
INTENSITY
idark
10mV
22. Measuring Photodiode Output
Photodiode voltage is very nonlinear with light input
Photodiode current is linear with light input
Need to convert photodiode current to an output voltage
Transimpedance amplifier
Current-to-voltage converter
Transimpedance "gain" = Rf
In dB: 20log(Rf/1Ω)
23
23. Transimpedance Amplifier
Looks like a short to the photodiode
Photodiode current flows through the
feedback resistor and is converted
to a voltage
Ideally, ALL of the photodiode current goes through Rf
In reality, all op amps have input bias current that introduces error to the output
Op amp offset voltage causes offset due to itself and to increased
dark current
Op amps with pA-class Ib and low input offset voltages are typically
preferred (usually FET inputs)
AD8605 (1 pA Ib, 300 μV Vos), AD8615 (1 pA, 60 μV Vos),
ADA4817 (20 pA Ib, 2 mV Vos)
AD549 (0.06 pA Ib, 500 μV Vos)
24
24. Transimpedance Amplifier Stability
Example Photodiode:
Cs = 150 pF, Rsh = 600 MΩ
Op Amp: AD8615
Ib = 1 pA max (200 fA typical!), Cin = 9.2 pF, 24 MHz unity gain frequency
Assume Rf = 1 MΩ so 5 V out when Id = 5 μA
Rf and Cin form a pole in the open-loop transfer function
25
Don’t forget op amp’s
differential and
common-mode input
capacitance!
Ci = CDIFF + CCM
1MΩ
150pF
9.2pF
25. Transimpedance Amplifier Stability
The amplifier has no phase margin
It’s an oscillator, not an amplifier
The phase must be ‘a healthy
distance’ away from 180° when
the unity gain crosses 0 dB
To guarantee stability, design for
45° of phase margin
Unless you KNOW you need less
phase margin, consider this a minimum
60° or more makes it easier to sleep
at night.
26
120dB
80dB
60dB
40dB
20dB
0dB
100dB
100Hz 1kHz 10kHz 100kHz
0°
180°
90°
p1f p2f
cf
26. Transimpedance Amplifier Stability
Adding a capacitor in parallel with Rf introduces a zero to the open-
loop transfer function and stabilizes the amplifier
We want to guarantee at least 45°
of phase margin
Using a larger Cf results in more
phase margin
But also lowers the signal bandwidth.
For now, select Cf = 4.7 pF
• Could go as low as 1 pF, but parasitic
capacitances start to dominate
27
31. Transimpedance Amplifier Op Amp Current
Noise
Op Amp Current Noise
Appears on the output as a voltage
Multiplied by Rf
33
1MΩ
4.7pF
AD8615
50fA/√Hz
32. Transimpedance Amplifier Voltage Noise-2
Op Amp Voltage Noise
Modeled as a voltage source on the + input
Vout = Input Noise × Noise Gain
In a ‘DC’ circuit, the noise gain is equal to the
noninverting gain.
…actually, the noise gain is still simply
the noninverting gain, it’s just that
the noninverting gain is a function of
frequency!
35
1MΩ
4.7pF
AD8615
33. Noise Gain vs. Signal Gain
Unlike other amplifier configurations, the noise gain is very different
from the signal gain.
The op amp’s noise appears
at the output multiplied by
this gain (~35× at the peak)
36
1MΩ
4.7pF
150pF+
9.2pF
AD8615
7nV/√Hz,
24MHz GBW
24MHz
34. Op Amp Output Noise
To get the output noise in V rms, integrate the square of the noise
density over frequency and take the square root.
Or take a shortcut!
Approximation: 254 µV rms
Using Integration: 266 µV rms (I dare you to do it by hand!)
37
38MHz
35. By the Way… Are FET Input Op Amps Always
the Best Choice?
AD8615
FET
AD8671
Bipolar
38
In=50fA/√Hz
In=300fA/√Hz
LESS DRIFT
LOWER 1/F NOISE
LOWER VOLTAGE NOISE
HIGHER CURRENT NOISE
7nV/√Hz
2.5nV/√hz
INPUT VOLTAGE NOISE INPUT BIAS CURRENT
INPUTBIASCURRENT(pA)
INPUTBIASCURRENT(nA)
36. TIA Output Noise
The three main noise contributors are all Gaussian and independent
of each other, so we can RSS them together
This is just transimpedance amplifier noise
Johnson noise of photodiode shunt resistor, Rsh, is integrated over the signal
noise bandwidth: 1.57 × (1/2πRfCf). Negligible if Rsh >> Rf
Shot noise of photodiode is negligible
39
Contributor Output Noise
Feedback Resistor 30 µV rms
Op amp Current Noise 12 µV rms
Op amp Voltage Noise 254 µV rms
37. Add Filter after Amplifier to Reduce Noise
Op Amp noise over large noise gain
bandwidth dominates…
But the signal bandwidth is much lower
Signal Bandwidth = 34 kHz
What if we simply add an RC low pass
filter after the amplifier?
Cut-off frequency similar to the signal
bandwidth
Reduce RMS noise from 256 µV rms to
49 µV rms with simple 34 kHz RC filter
For the cost of about US$0.03 (assuming you
use expensive C0G caps!)
If the output is going to an ADC, you may
also need to buffer it.
40
34kHz BW
1MΩ
4.7pF
38. The Need for Programmable Gain
The same equipment may need to
test samples with very different
light absorption.
Almost-clear liquids like water or
alcohol-based solutions
Very opaque liquids like petroleum-
based compounds
Sometimes simultaneously
Concentration ratios
Programmable gain amplifiers help
increase the system’s dynamic
range
41
VS.
39. System Output Noise
A good PGA will contribute very little noise when G = 1
When G = 10, the TIA noise is also amplified 10×
Limit the PGA bandwidth to reduce noise
42
40. Two Alternatives: TIA + PGA vs. PGTIA
TIA + PGA
Traditional Photodiode Amplifier
Programmable Gain Amp
Possibly Followed by ADC Driver
PGTIA
Programmable Gain Transimpedance
Amplifier
Lower Noise
43
41. An Alternative Architecture: PGTIA
For G = 1 MΩ and the same bandwidth, the noise remains the same
For G = 10 MΩ and the same bandwidth, the noise goes up about 3×
(not 10×)
Cf = 0.47 pF
Further noise reduction by adding a low-pass filter at the output
Attenuate everything beyond the signal bandwidth
Do not have to consider additional errors due to a second amplifier
44
42. So, How Do You Build a PGTIA?
The basic idea:
Gain and frequency response depends on switch on and off
impedance
Changes with temperature, supply voltage, and signal voltage
45
C
lp
R
lp
Rf
Cf
Rf
Cf
−
+
43. Improved PGTIA
Kelvin switching
Twice as many switches, but switch resistance does not matter very much.
Looks like an op amp output with slightly higher output resistance
46
Rf2
Cf2
Rf1
Cf1
-
+
CpCp
44. PGTIA: Frequency Domain Effects-1
Cp is typically less than 1 pF
In our G = 10 MΩ example, Cf is only 0.47 pF
Even Cp = 0.5 pF can make a big difference!
47
Rf2
Cf2
Rf1
Cf1
-
+
CpCp
45. PGTIA: Frequency Domain Effects-2
Cp is typically less than 1 pF
In our G = 10 MΩ example, Cf is only 0.47 pF
Even Cp = 0.5 pF can make a big difference!
48
Rf2
Cf2
Rf1
Cf1
-
+
2*Cp
Total Feedback
Capacitance
2*CpCf1
2*Cp+ Cf1
Cf2 +=
46. PGTIA: Adding More Switches-1
Adding a set of switches in series reduces Cp by half
Better, but what if you need more?
49
48. CN0312: Dual-Channel Colorimeter with
Programmable Gain Transimpedance
Amplifiers and Synchronous Detectors
Circuit Features
Three modulated LED drivers
Two photodiode receive channels
Programmable gain
Circuit Benefits
Ease of use
Self contained solution
Dual channel, 16-bit ADC for data
analysis
53
Target Applications Key Parts Used Interface/Connectivity
Industrial
Medical
Consumer
AD8615/AD8618
AD8271
ADG633, ADG733
ADR4525
AD7798
SPI (AD7798)
SDP (EVAL-CN0312-SDPZ)
USB (EVAL-SDP-CB1Z)
EVAL-SDP-CB1Z
EVAL-CN0312-SDPZ
50. CN0312 Addresses Challenges of Precision
Photometry
Convenient platform for exploring programmable gain TIAs
Features
Three square-wave modulated LEDs
Two photodiode channels with selectable gain
Hardware lock-in amplifiers
AD7798 16-bit sigma-delta ADCs
55
J2 -
J2 +
1
2
0
P
IN
SD
P LEDs
Beam-
splitter
Reference
Container
Sample
Container
D2
D3
Photodiodes
(Notice correct
orientation of
anode tab)
External
6-12VDC
1
2
0
P
IN
SD
P
EVAL-SDP-CB1Z
CON A
OR
CONB
EVAL-CN0312-SDPZ
USB
PC
USB
EVAL-SDP-CB1Z
EVAL-CN0312-SDPZ
51. Summary
Many chemical analyzer applications are based on light and
photodiodes.
Designing with photodiodes presents unique challenges:
Photodiode’s large shunt capacitance makes the amplifier unstable, requiring
compensation
Compensation reduces the signal bandwidth
Reduced signal bandwidth may not be so bad (if you don’t need it!), since it
also implies lower noise gain
Signal bandwidth is dominated by Rf and Cf
Noise gain bandwidth can be much higher than the signal bandwidth, and
its magnitude is mainly determined by the ratio of the diode’s shunt capacitance
to Cf.
ADI’s amplifier portfolio allows you to customize a solution for very
low input bias currents, low noise, and/or low drift, depending on
each specific application!
56
52. Tweet it out! @ADI_News #ADIDC13
What We Covered
Gas Detection Using Electrochemical Sensors (CN0234)
Gas detection fundamentals
Electrical equivalent circuit
Conditioning circuits
Spectroscopy and Colorimetry (CN0312)
Fundamentals of spectroscopy
Modulated laser light sources
Photodiode receivers
Synchronous demodulation
Transimpedance amplifiers
Gain
Stability
Noise
Programmable gain transimpedance amplifiers
57
53. Tweet it out! @ADI_News #ADIDC13
Visit the Single Supply, Micropower Gas
Detector Demo in the Exhibition Room
58
SDP CONNECTOR
10-PIN FEMALE
CONNECTOR
10-PIN MALE CONNECTOR ON BOTTOM OF PCBSOFTWARE DISPLAY
Complete Design Files
■ Schematic
■ Bill of Material
■ PADs Layout
■ Gerber Files
■ Assembly Drawing
EVAL-CN0234-SDPZ
ADAPTER BOARD TO
EVAL-SDP-CB1Z
Industry-Standard
Footprint
This demo board is available for purchase:
www.analog.com/DC13-hardware
54. Tweet it out! @ADI_News #ADIDC13
Visit the Dual Channel Spectroscopy/Colorimetry
Demo Board in the Exhibition Room
59
Circuit Features
Three modulated LED drivers
Two photodiode receive channels
Programmable gain
Circuit Benefits
Ease of use
Self contained solution
Dual channel 16-bit ADC for data
analysis
Complete Design Files
■ Schematic
■ Bill of Material
■ PADs Layout
■ Gerber Files
■ Assembly Drawing
EVAL-SDP-CB1Z
EVAL-CN0312-SDPZ
This demo board is available for purchase:
www.analog.com/DC13-hardware