1 Introduction

Lock-in amplifiers demodulate a signal, with a proper carrier that can be in a very different frequency range, from an extremely noisy environment. At ENEA C.R. Frascati Laboratories, measurement instrumentation not available on the market, based on lock-in amplifier architecture in medium–high frequency range, was developed, such as interferometers [1], reflectometers [2], optical radars [3] and bolometers [4]. In high-frequency carrier applications, like optical radar demodulation, quadrature demodulation, based on a well-tested algorithm [3], Field Programmable Gate Array (FPGA) hardware was mandatory. On the contrary, in linear optical spectroscopy measurements, used in many applications and scientific investigations, the carrier frequency can be very low. In this case, considering the carrier frequency (i.e. ~ 200 Hz), the sampling frequency of 1ksps (1 k sample per second) is below the Nyquist Frequency.

In this paper, we describe a new family of fully-digital lock-in amplifiers, based on microcontrollers, developed for photoluminescence (PL) measurements at ENEA C.R. Frascati, with the aim of making instrumentation with the following characteristics: easy to use, cheap, reduced size and weight, accurate, reprogrammable and/or reconfigurable, with graphical user interface and digital data transmission to a Host PC without loss of precision. In order to check the validity of the present scheme and to enable comparison with other previous implementations, experimental tests were first carried out with synthetic electrical signals and white noise at different values of signal-to-noise ratio (SNR). This allowed us to carefully estimate the dynamic reserve and noise figure of our system. Then, the lock-in amplifier was applied to real electrical signals coming from photoluminescence measurements.

2 System description

2.1 Lock-in hardware

The measurement system is based on a custom DSP Box containing a Microcontroller board and a simple. Signal conditioning mezzanine.

The microcontroller board is the low-cost Arduino Mega 2S60, based on the 8bit Atmel ATmega2S60 microcontroller, having 16 MHz crystal-oscillator, 16 analog inputs, and a USB port [5].

The conditioning board consists of two anti-aliasing low-pass filters for both CH1_R and CH2_S channels. Moreover, the CH2_S channel has a DC-block and a DC offset circuit, necessary to pull up the input in case of negative signals, such as in the case of PMT (Photomultiplier tube).

Figure 1 shows the DSP Box layout and the test-bench for its electrical characterization, as explained in par 3.1.

Fig. 1
figure 1

DSP box layout and electric characterization test bench

2.2 Microcontroller firmware

The firmware for the microcontroller board (see Figs. 2 and 3) has been developed in C language and performs several functions:

  1. 1.

    Communication with Host PC

  2. 2.

    Oscilloscope feature

  3. 3.

    Lock-in feature and setup see Fig. 2

Fig. 2
figure 2

Microcontroller firmware function

Fig. 3
figure 3

Firmware detail

Details on the functions listed above are given below:

  1. 1.

    Communication with Host PC

  2. 2.

    The microcontroller board communicates setup and starts oscilloscope and lock-in with the Host PC via USB port in serial protocol (19,200 baud). General-purpose serial monitor software or the custom software described in Sect. 2.3 must be installed on the Host PC.

  3. 3.

    Oscilloscope feature

  4. 4.

    The oscilloscope firmware acquires the CH1 and CH2 signals at 1ksps. Due to the low throughput of the USB port, it is necessary for the microcontroller to acquire and store the CH1 and CH2 signals in arrays. When the array is full, the microcontroller stops the acquisition and sends the data to the host PC.

  5. 5.

    Lock-in feature and setup

  6. 6.

    The microcontroller implements the quadrature demodulation in real-time with a fully digital signal processing, sending the record containing the timestamp and the demodulated components to the Host PC.

Considering a sampling frequency of 1ksps, the chopper frequency (~ 200 Hz) is lower than the Nyquist Frequency, so it is possible to sample both channels (CH1_R (reference) and CH2_S (signal)) and perform quadrature demodulation with the digitalized signal using Digital Signal Processing.

The digital demodulation algorithm [3] needs a synthetized digital local oscillator, the Local Oscillator signals and the sampled signals are connected to a complex product generating low and high frequency components. The high frequency ones are removed by a first Low Pass Decimator FIR (Finite Response Filter). The complex low-frequency components, relative to Signal and Reference, are multiplied after a conjugation operation [3]. In such a way, even if the Local Oscillator is not perfectly synchronous to the Chopper frequency, the low-frequency components related to the sinusoidal and cosinusoidal part of the Photodetector Signal with respect to the Chopper Reference are obtained.

The time required for the dispatch of the records containing the lock-in measures up to 1sps, allows to process the signals CH1, CH2 without loss. If the chopper frequency is not known, it is possible to measure it by using the oscilloscope function (see. Figure 4); the position of the peaks in the FFT spectra provides the fundamental frequencies of the signals. We set the parameters of the two Decimation FIRs (decimation factor and FIR response) as a function of the desired output measurement frequency and the chopper jitter.

Fig. 4
figure 4

GUI: Tab for oscilloscope function

2.3 Host software and graphical user interface

The Host PC is connected to the microcontroller board via USB port in serial protocol (see Fig. 1 and Fig. 2). The microcontroller receives command strings such as start_oscilloscope and answers sending to the Host PC the oscilloscope data, the lock-in data or acknowledgement signal for the setup operations. The command strings can be sent to the Microcontroller in command-line interface mode, using generic software. For simplicity, an easy-to-use Graphical User Interface (GUI) has been developed in LabVIEW environment. Figure 4 and Fig. 5 show the Graphic User Interface for the Oscilloscope and Lock-In functions.

Fig. 5
figure 5

GUI: tab for lock in function

Figure 4 shows the acquisition of two sinusoidal signals having different amplitudes and frequencies (4 Vpp at 80 Hz and 0.4 Vpp at 180 Hz, red and blue signals, respectively).

Figure 5 shows the GUI for the lock-in function. The input signals are two sinusoidal signals slightly shifted in frequency (180.00 and 179.95 Hz). Signal at −20 dB compared to the full range and reference at Low Level of 100–200 mV.

It is possible to appreciate the great phase linearity, and the small standard deviation of the amplitude (0.6 compared to the average 172.45 [a.u.]) even with an input level 20 dB below the maximum range.

3 System test

3.1 Lock-in electrical characterization

In order to characterize the lock-in, a test bench containing a dual channel synthetic generator (Tektronix AFG 3252) has been set up (see Fig. 1). The used generator can supply sinusoidal signals with very small frequency shifts; in this way, while the amplitude of the signals detected by the lock-in is fixed, the phase must have a sawtooth trend.

A manual rotary stepper attenuator allows to obtain signals at different amplitudes, while generator output sets were used to vary the amplitude of the reference. In Fig. 6 the Measured_Amplitude changes linearly with the reference amplitude, being proportional to Reference_Amplitude × Signal_Amplitude. If necessary, the components contained in the Lock-In amplifier record allow the evaluation of the Reference_Amplitude and the Signal_Amplitude separately.

Fig. 6
figure 6

Measured_amplitude vs. signal attenuation with high and low reference input levels

Figure 6 shows the high linearity of the Measured_Amplitude and Measured_Phase, but also the presence of a cross-talk effect between the CH1_R and CH2_S channels, which makes it more convenient to use reference signals with not excessive levels.

All the results shown below were obtained with the following test setup:

  • Measurement rate 1sps;

  • 2Vpp 179.9 Hz sinusoidal signal (100–2100 mV) attenuated at different levels with the rotary attenuator (0 – 60 dB);

  • Sinusoidal reference at frequency 180 Hz with four different levels:

  • High level (100–2100 mV)

  • Medium levels I (100–1100 mV)

  • Medium levels II (100–600 mV)

  • Low level (100–200 mV).

Figure 6 shows that the Measured_Amplitude has high linearity as a function of the signal attenuation.

Figure 7 shows the Measured_Amplitude Standard Deviation for the high and low reference levels; it is possible to verify that, due to the cross-talk effect, the standard deviation cannot be lower than 30 (a.u.) in the case of High Reference Level, while in the case of Low Reference Level the standard deviation is less than 10 (a.u.) with a signal attenuation up to 60 dB.

Fig. 7
figure 7

Standard deviation of the measured_amplitude vs the signal amplitude attenuation

The percent standard deviation of the Measured_Amplitude shows an almost linear dependence with the Measured_Amplitude in logarithmic scale, but in the case of High Level Reference (100–2100 mV), due to the presence of cross talk, the standard deviation is higher (see Fig. 8).

Fig. 8
figure 8

Percent standard deviation vs signal amplitude at two reference input levels

By using Low Level Reference (100–200 mV) the standard deviation is less than 1%, for signal attenuated up to 42 dB (see Fig. 8 and Fig. 9). This is a good result, considering the low cost of the instrumentation.

Fig. 9
figure 9

Standard deviation of the measured_amplitude calculated in percent vs signal attenuation at different reference input levels

Figure 10 shows the time behaviour of the Measured_Phase in the case of input at two different frequencies (180.0 and 179.9 Hz) measured at three different reference levels and with the signal attenuated of 60 dB.

Fig. 10
figure 10

Measured_phase during the test with signal and reference at 180.0 Hz and 179.9 Hz, respectively at three different reference levels

Being 1sps the measurement rate, the entire phase interval between ± π is linearly scanned in ten samples.

We can observe the presence of non-linearity, if the reference has high level, due to the cross-talk between channels. Likewise, the amplitude is not constant over time for the same reason (see Fig. 11).

Fig. 11
figure 11

Cross talk effect: measured_amplitude at different reference level in the case of low signal level 60 dB attenuation

The cross-talk effect can be seen more easily by plotting the components of the quadrature demodulation in polar coordinates (see Fig. 12).

Fig. 12
figure 12

Quadrature demodulation components vs. time

3.1.1 Dynamic reserve and noise reduction performances

A figure of merit of the present implementation can be provided by the Dynamic Reserve, which is the ratio of the largest tolerable noise signal to the full-scale signal that is allowed before saturation occurs.

Conservatively, we have calculated the dynamic reserve using the maximum noise level obtained during all the measurements, and the signal measured before saturation, obtaining a value of 43 dB. This value, although lower than that of digital or analogic Commercial On The Shelf (COTS) lock-in amplifiers (typically 60–70 dB), is adequate for a wide range of applications.

In addition, the lock-in noise reduction efficiency has been tested by implementing a test setup including a dual channel synthetic generator (Siglent SDG6052X) and a noise generator (Agilent 33220A) (see Fig. 13). The Noise Figure (NF) was thus estimated as the ratio of the output SNR (SNRo) to the input SNR (SNRi) expressed in dB.

Fig. 13
figure 13

Noise figure estimation layout

SNRi was simply evaluated as the ratio of signal power to the noise power on the CH2_S channel. On the other hand, since our lock-in directly provides a numerical output, SNRo was estimated as the square of the ratio of the mean of the Measured_Amplitude (recorded over a 60 s time period with a sampling rate of 1 measurement/s) to its standard deviation, thus considering the fluctuations of the digital output as the lock-in output noise.

Table 1 summarizes the NF obtained in the case of Reference at 200mVpp and signal frequency of 180 Hz, approximately.

Table 1 Noise figure recorded at different values of the input signal and added noise

The reason for the decrease of the NF with reducing noise lies in the presence of self-generated noise inside the lock-in amplifier, which becomes relevant as the external noise decreases.

3.1.2 Lock-in amplifier performance comparison

Unfortunately, most of the literature [6,7,8,9,10,11] does not report the quantitative determination of the noise figures. In the Table 2, we compare the Dynamic Reserve and cost of some prototypes together with a typical COTS instrument.

Table 2 Comparison with other implementations and COTS instrument

It should be pointed out that the obtained Dynamic Reserve of the present system, although lower than that of COTS lock-in amplifiers, is adequate for a wide range of applications and is achieved at very low cost (less than 50 €) which makes the DSP Box also suitable in disposable systems.

3.2 Experimental test in photoluminescence measurements of F 2 color centers in lithium fluoride crystals

As mentioned in Introduction, the present lock-in was especially designed for application to photoluminescence (PL) measurements, where low-cost and compactness can fit the needs of both portable systems and versatile laboratory setups [12]. As a specific example, here we report the experimental test of the lock-in amplifier within a compact system for measuring the PL of passive solid-state dosimeters based on the PL of F2 color centers (CCs) in lithium fluoride (LiF) crystals.

Such CCs were created in LiF by irradiation with 26 MeV protons, produced by the TOP-IMPLART linear accelerator at ENEA Frascati, in the (0.5–48) Gy dose range [13]. When F2 CCs are optically pumped with blue light, they absorb it and emit light in the red spectral range [14]. The PL intensity, due to the total amount of CCs created in the crystals by the ionizing radiation, is proportional to the deposited dose at constant blue light excitation intensity.

The PL measurement system (see Fig. 14) consisted of a 10 mW and 1.7 mm beam diameter continuous wave 445 nm Cobolt laser, modulated with a Thorlabs MC2000 chopper at 180 Hz. The emitted PL was focused by a convex lens into a phototube Hamamatsu H7422 with C7319 preamplifier unit, after an interference filter allowed PL to be transmitted only in a 50 nm-wide band centered at 670 nm, corresponding to the F2 CCs maximum emission wavelength range. The acquired data, shown in Fig. 15, confirm that the 50 nm spectrally-integrated PL intensity response is linear with dose, as obtained in ref. [13] from the PL spectra of the same colored LiF crystals, measured with a more sophisticated system. Each plotted point is the average of a 60 s long signal acquisition.

Fig. 14
figure 14

Photoluminescence measurement layout

Fig. 15
figure 15

Linear dependence of F2 CCs PL with dose in LiF crystals

4 Conclusions

For low frequency application, a very low-cost lock-in has been developed in ENEA Frascati laboratories. The lock-in is based on a microcontroller board (Arduino Mega) and has been electrically characterized through experimental tests with synthetic electrical signals and white noise, which have demonstrated a dynamic reserve of 43 dB and a noise figure in the range 25–50 dB. These values, although lower than those of digital or analogic COTS lock-in amplifiers, are adequate for a wide range of applications. As an example of real application, our system was used in laboratory with good results for PL measurements.

Future activities include upgrading the lock-in with a more performing microcontroller board and its application to photoacoustic spectroscopy measurements [15].