A sensitive and compact optical detector based on lock-in amplification

We report a sensitive, fixed-wavelength, lock-in-based optical detector built from a light-emitting diode, two colour filters, a photodetector, a small number of discrete analogue components, and a low-cost microcontroller development board. We describe the construction, operating principle, use and performance of the optical detector, which may be used for both absorption- and fluorescence- measurements in either a 10-mm pathlength cuvette or a low-volume (< 100 μl) flow-cell. For illustrative purposes the detector is applied here to a cholesterol assay based on the enzyme-mediated conversion of (non-emissive) Amplex Red into the fluorescent dye resorufin, providing a detection limit of ~200 nM – some four orders of magnitude lower than the typical concentration of cholesterol in human serum. (The resorufin molecule itself is detectable down to concentrations of ~20 nM). The system may be readily adapted to other biomolecules through a simple change of enzyme.


Fig. S2 Complete circuit diagram for optical detector.
The circuit comprises an LED driver (D1), analogue circuitry (AC1) for signal acquisition and conditioning, and a Teesny 4.0 microcontroller development board (MDB1). AC1 comprises an OPT101 amplified photodiode with a non-inverting integrator (I1) included in its feedback path for DC compensation, a summing amplifier S1 that adds a +1.6 V DC offset to the (DC-compensated) input signal, and a 94 kHz low-pass filter (LP1) that suppresses noise and high-frequency components above the 100-kHz Nyquist frequency of the signal. MDB1 is used for analogue-to-digital conversion, digital signal processing, and to generate a 3.3 V square-wave signal LED that controls the LED driver via the base terminal of the BC547B transistor.

Fig. S3
Block diagram illustrating the lock-in procedure for an incoming signal of equal frequency to the reference signals. An input signal S of frequency 0 , phase s and amplitude is passed into two separate channels. In the first channel S is multiplied by a reference signal 0 of the form 0 = 2 ( 0 + 0 ) and passed through a low-pass filter (LPF), yielding an output 2 = ( S − 0 ); in the second channel S is multiplied by a reference signal of the form 0 = 2 ( 0 + 0 ) and passed through a second low-pass filter, yielding an output 2 = ( S − 0 ). 2 and 2 are vectorially combined to yield a final output 2 = √ 2 2 + 2 2 that is equal to the amplitude of the input signal S .
For an arbitrary periodic input signal, 2 is equal to the amplitude of the first harmonic of the input signal (and hence is proportional to the amplitude of the input signal). If required, the phase of the input signal relative to the reference signals may also be calculated from 2 = atan( 2 / 2 ). Contributions from input signals at frequencies away from 0 are heavily attenuated by the low pass filter and do not significantly affect 2 or 2 .

Appendix S1 -Brief explanation of analogue conditioning circuit
The first stage of the conditioning circuit (see Fig. S2) is a feedback-based compensation stage that removes any DC offset in the output voltage 1 of the OPT101 due to ambient light or non-ideality of A0 [S1]. The inclusion of the compensation stage allows the OPT101 to operate under conditions of high ambient illumination without saturating A0, A2, A3 or ADC0. DC compensation is achieved by passing 1 into an op-amp based non-inverting integrator I1 that integrates signals close to DC, while attenuating high frequency signals. For a typical scenario in which the photodiode is incompletely shielded from stray light, the photocurrent ph exhibits a negative DC offset Δ due to ambient illumination, and (since the OPT101 is configured as an inverting amplifier) 1 therefore initially exhibits a positive DC offset Δ . This positive offset may be very much larger than the amplitude of the target signal and, unless corrected for, would make signal recovery difficult. Owing to the positive sign of Δ , the integrator generates a steadily increasing positive output voltage int that in turn drives a steadily increasing positive correction current int = int / 1 into the summing junction of A0 (pin 2 of the OPT101). int partially cancels Δ and so causes Δ to decrease, while leaving the high frequency components of 1 unchanged. int and int continue to rise in magnitude until the DC component of ph is fully compensated and Δ is therefore zero.
The op-amp A1 in integrator I1 can output a maximum voltage of 12 V; as R1 has a value of 100 kΩ, the compensation circuit can supply up to 120 A of correction current, which is approximately 40 times larger than the photocurrent (3.3 A) needed to saturate ADC0. The compensation circuit therefore allows the lock-in amplifier to operate under high DC light levels that would otherwise saturate ADC0 and prevent signal recovery. The circuit can only be used with modulation frequencies that are substantially higher than the integrator's 16-Hz cut-off frequency (since lower frequencies are fed-back to the summing terminal of A0). However, this is not a significant limitation since high modulation frequencies are usually preferred to reduce "flicker noise" [S2] and improve sensitivity. For the work reported here, we use a modulation frequency of ~410 Hz.
Following DC compensation 1 is a bipolar signal with a mean value of zero, whereas ADC0 on the Teensy microcontroller can only accept positive input voltages in the range 0 to 3.3 V. Hence to bring the signal into a range that can be measured by ADC0, we add a fixed offset of 1.6 V to 1 by means of another op-amp A2, which is configured as a unity-gain non-inverting summing amplifier (S1). The resulting output signal 2 is passed to a third op-amp A3, which is configured as a unity gain low-pass filter (LP1) with a cut-off frequency of 94 kHz, i.e. slightly less than half the 200-kHz sampling frequency used by ADC0. The low-pass filter suppresses noise and interferences above the 100-kHz Nyquist frequency and therefore acts as an anti-aliasing filter that prevents sampling artefacts.

Appendix S2 -Brief overview of lock-in detection
When a signal is masked by noise and other interferences, it is helpful to modulate the light-source at a fixed angular frequency mod so as to impose a matching frequency on the fluorescence signal. Band-pass filtering of the electrical signal generated by the photodiode can then be used to reject interferences at frequencies away from mod , enabling recovery of the target signal. The narrower the bandwidth of the filter -i.e. the smaller the range of frequencies the filter passes -the more completely interferences away from mod are rejected, and hence the more easily the target signal can be detected.
A band-pass filter may be characterised in terms of its Quality factor = c /Δ where c is its centre frequency and Δ is its bandwidth, with higher values of implying better rejection of unwanted signals at frequencies close to (but not equal to) c . High filters typically exhibit poor stability, [S3] and in practice it is difficult to design band-pass filters with values much greater than 100, which limits how effectively noise and other interferences can be rejected by band-pass filtering. However, a related device known as a lock-in amplifier (LIA) [S4] can deliver effective values that are much higher than this (up to a million or more), resulting in better rejection of noise and interferences.
An LIA tuned to an angular frequency 0 transforms an AC input signal of frequency 0 into a DC output signal that is proportional in size to the amplitude of the input signal. Note, this behaviour differs from a band-pass filter, which converts an AC input signal at its centre frequency into an AC output signal of matching frequency (but possibly different amplitude and phase depending on the specific design) [S5].
For simplicity, we begin by assuming the incoming signal s is a pure cosinusoid of frequency s , phase s and amplitude : s = cos( s + s ).
In the first stage of lock-in amplification, the input signal s is multiplied by the two reference signals, generating two intermediate signals, 1 and 1 . In the case of the 0 reference signal, for instance, we obtain an intermediate output voltage which may be rewritten in the form 1 = ν[cos(( s − 0 ) + ( s − 0 )) + cos(( s + 0 ) + ( s + 0 ))].
For the typical case ω s ≠ 0 , we obtain two cosinusoidal components at the sum and difference frequencies of ω s and 0 . In the second stage of lock-in amplification we pass the intermediate output signal 1 through a low-pass filter with a cut-off frequency * that is much smaller than | − 0 |.
The filter heavily attenuates both frequency components of 1 , generating an output signal 2 that is close to zero.
Only when the frequency of the incoming signal is closely matched to the frequency of the reference signal (|ω s − 0 | ≪ * ) do we obtain a non-zero output. For the special case = 0 (see Fig. S3), the output of the multiplier is given by: where the first term in the square bracket is a constant. After DC filtering, we therefore obtain 2 = νcos( − 0 ), (S6) which is proportional to both the amplitude ν of the incoming signal and the cosine of the phase difference between s and 0 .
Carrying out an equivalent analysis with the second reference signal 0 , we obtain 2 = νsin( − 0 ).
(S7) By solving Eqs. (S6) and (S7) simultaneously we obtain expressions for the amplitude and phase of the input signal s in terms of 2 and 2 : 2 = √ 2 2 + 2 2 = (S8) and 2 = atan ( 2 2 ) = − 0 (S9) From the above analysis it is evident that a lock-in amplifier set to a reference frequency 0 is 'blind' to all signals that differ from 0 by substantially more than the low-pass filter cut-off frequency * . Hence, if 0 is set to the fundamental frequency s of an incoming periodic signal (which need not be sinusoidal), the output 2 from the lock-in amplifier will equal the amplitude of the first harmonic component of that signal. Signals at frequencies away from s -whether due to higher harmonics of the incoming signal, noise or other interferences -are heavily attenuated by the long-pass filter and do not significantly affect the value of 2 .
The effective bandwidth of a lock-in amplifier is equal to twice the cut-off frequency of the low-pass filter (since signal frequencies just above and just below 0 are transformed to near-DC intermediate signals that partially survive the filtering step). For our specific LIA implementation the cut-off frequency is fixed at 0.25 Hz, while the modulation frequency is fixed at ~410 Hz. The effective bandwidth of the LIA is therefore 0.5 Hz (= 2 × 0.25 Hz) compared to ~4.1 Hz (= 410 Hz/100) for a very narrow ~100 band-pass filter such as Linear Technology's 'ultraselective' 8th-order elliptic bandpass filter LTC1164-8. [S6] The LIA as configured here therefore provides substantially better noise rejection than high-end band-pass filters. Moreover, if required, the LIA's noise rejection may be further improved without the need for any hardware changes by simply reducing the cut-off frequency of the long-pass filter (at the expense of a longer settling time).
Finally, we note that in the above analysis we assumed the reference signals and the incoming signal had constant (time-invariant) phases, implying a fixed phase difference between them. In practice many real signals are susceptible to jitter and drift which, left uncorrected, introduce noise and error into the lock-in measurement. To avoid these problems, the reference signals and incoming signal should be synchronised so that jitter or drift in the incoming signal is perfectly mirrored in the reference signals, resulting in a constant phase difference between them. This may be achieved by means of a phase-locked-loop [S7] that causes the reference signals to 'follow' the incoming signal or -more simply -by using one of the two internally generated reference signals to modulate the incoming signal. The latter approach is used in our LIA implementation, with the microcontroller generating a square-wave output voltage that is phase-locked to the x-channel reference signal (Eq. S1a). The square-wave voltage toggles the light-source on and off, and so modulates the fluorescence signal at the reference frequency 0 .