Document Sample
					  International Journal of Advanced Research in
                                                 OF ADVANCED (IJARET), ISSN 0976 –
  6480(Print), ISSN 0976 – 6499(Online) Volume 4, Issue 2, March – April (2013), © IAEME
ISSN 0976 - 6480 (Print)
ISSN 0976 - 6499 (Online)
Volume 4, Issue 2 March – April 2013, pp. 17-26
Journal Impact Factor (2013): 5.8376 (Calculated by GISI)                ©IAEME


         Bhagyajyothi, Immanuel J., P. Bhaskar*, L.S. Sudheer and Parvathi C. S.
          Department of Instrumentation Technology, Gulbarga University P.G. Centre,
                               RAICHUR-584133, KA, INDIA


         Lock-in amplifier (LIA) is the most important and essential instrument in signal
  recovery in the presence of large amount of noise. In this paper an indigenously designed
  microcontroller based advanced lock-in amplifier is proposed. The lock-in detection is done
  by quadrature sampling method. It is designed to work for the frequency range of 10Hz to
  100kHz. The microcontroller based lock-in amplifier recovers signal of very small amplitude
  buried in large noise very efficiently. The designed lock-in amplifier is applied for a
  photoacoustic spectrometer (PAS) to detect the phase transitions in liquid crystal. In the
  present study N-(p-n-pentyloxybenzylidene)-p-n-hexylaniline (5O.6) liquid crystal
  compound is used as sample. The phase transitions of 5O.6 liquid crystal are detected by the
  system. The secondary transitions which are not observed in differential scanning calorimeter
  (DSC) are also observed in the proposed system. The amplitude and phase variations of the
  sample during the temperature scanning are measured and displayed on LCD module. The
  temperature scanning rate is kept at 0.3oC/min. The measured amplitude, phase and
  temperature information is sent to the PC, via serial port, for further data processing/analysis.

  Keywords: Lock-in amplifier, C8051F060 microcontroller, Phase, Amplitude, PAS.


          In many scientific and industrial applications, a situation exists where it is necessary
  to measure the signal of much smaller amplitude than noise components present in the
  environment. In such cases, the lock-in amplifier is very essential. There are various types of
  lock-in amplifiers reported in the literature. Gabal et al [1] reported the application of analog
  lock-in amplifier to recover sensor signals buried in noise for embedded applications. Juh

International Journal of Advanced Research in Engineering and Technology (IJARET), ISSN 0976 –
6480(Print), ISSN 0976 – 6499(Online) Volume 4, Issue 2, March – April (2013), © IAEME

Tzeng Lue [2] reported the junction impedance measurements of diodes by a simplified lock-
in amplifier, which operated at frequencies from 20Hz to 100kHz, has a noise rejection ratio
of 40dB. G. Busse et al [3] reported the lock-in vibrothermal inspection of polymer
composites.The magnitude and phase of the temperature modulation generated by modulated
stress were analyzed and investigations are made on various polymer and their composites
were revealed. Adrian A. Dorrington et al [4] in their paper presented a small and simple
digital lock-in amplifier that uses a 20-bit current integrating analog to digital converter
interfaced to a microcontroller. Adrian successfully developed a simple, high sensitivity,
small, and low-cost digital amplifier for the detection of low level optical signals, which has
a dynamic range of 103dB and is capable of recovering input signals in the pico-ampere
range. The sample rate is set to twice the reference frequency placing the sampled lock-in
signal at the Nyquist frequency allowing the lock-in procedure to be performed with one
simple algorithm. This algorithm consists of a spectral inversion technique integrated into a
highly optimized low-pass filter. He demonstrated a system with dynamic range of 103dB
recovering signals up to 85dB below the interference. Maximiliano O. Sonnaillon et al [5]
proposed and validated experimentally a high frequency digital lock-in amplifier that uses
non-uniform sampling. They reported that, by using a random sampling strategy, it is
possible to process periodic signals of frequencies several times greater than Nyquist
frequency which is given by the sampling theorem. They implemented prototype of the LIA
based on 32-bit floating point DSP. The unknown system is excited by a reference signal
generated by a direct digital synthesizer. The signal obtained at the unknown system output is
amplified by a similar stage which presents high impedance at the input in order to avoid
disturbing the measured system. Results show that application of random sampling strategy
reduces significantly the speed requirements of the ADC and DSP. After elaborate literature
survey we came to know that most of the lock-in amplifiers are designed using DSP’s and
some are designed using microcontroller. In both the cases separate ADC and DAC are
employed and the signal is multiplied with reference and passed through the low-pass filters
to find the amplitude and phase of the signals. To design such advanced lock-in amplifiers
definitely requires help of microcontroller for front panel control. This motivated the authors
to design and develop C8051F060 microcontroller based advanced lock-in amplifier, where
it contains all the features including on-chip ADC and DACs to handle the signal processing
and front panel control.


       The lock-in amplifier contains single-chip mixed-signal processor C8051F060 from
Cygnal Integrated Products Inc. This microcontroller has advanced features which are useful
to design an single instrument. Fig. 1 shows the block diagram of single chip lock-in
amplifier. A pre-amplifier with high input impedance, high gain, and low noise is required to
amplify very low amplitude signals buried in noise. A pre-amplifier is designed using low
noise op-amp (LM308). The pre-amplifier is designed with two stages to improve the gain-
bandwidth product of the amplifier. The pre-amplifier has a gain of 10 at first stage and 100
at second stage with an effective gain of 1000. The proposed lock-in amplifier is designed
using C8051F060TB microcontroller board from Cygnal Integrated Products, Inc., Austin,
USA. The on-chip peripherals of microcontroller will facilitate to design a single chip lock-in
amplifier. Except PCA module, rest of the features of microcontroller has been used in the
design of lock-in amplifier. The microcontroller has the following features [6].

International Journal of Advanced Research in Engineering and Technology (IJARET), ISSN 0976 –
6480(Print), ISSN 0976 – 6499(Online) Volume 4, Issue 2, March – April (2013), © IAEME

  •   High-speed pipelined 8051-compatible CIP-51 microcontroller core (up to 25 MIPS)
  •   Two 16-bit, 1 MSPS ADCs (ADC0 & ADC1) with a direct memory access controller
  •   Two 12-bit, DACs (DAC0 & DAC1) with programmable update scheduling
  •   64KB of in-system programmable flash memory
  •   4352 (4096 + 256) bytes of on-chip RAM
  •   External Data Memory Interface with 64KB direct address space
  •   SPI, SM Bus/I2C, and two UART serial interfaces implemented in hardware
  •   Five general purpose 16-bit Timers
  •   Programmable Counter/Timer Array (PCA) with six capture/compare modules
  •   On-chip Watchdog Timer, VDD Monitor, and Temperature Sensor

         In most of the digital lock-in amplifiers, the processing is done in digital domain using
software and dedicated digital signal processor (DSP). The system still features a pre-amplifier
and band-pass filter to remove any signal component higher than half of the sampling frequency
of ADC. The lock-in amplifier requires a reference signal to perform the phase sensitive
detection. The reference signal is generated internally or derived from sampling an external
signal. In case of internally generated signal, the individual sample points of the reference signal
can be calculated to a high degree of accuracy, and therefore do not suffer from the typical errors
found in analog lock-in amplifier. The reference signal is also phase-shifted by 90° by either
look-up table or simple mathematical operations. Here, the reference signal is derived internally
by look-up table with 256 sine codes, Timer3 module used for scheduled update, and DAC0
module of the C8051F060. Since, it is essential for this routine to be never interrupted or
delayed; it is assigned a high priority level. A simple circular buffer counter moves through a
table of values that are output to DAC0 for every 10µSec. This will produce a sine wave with
maximum amplitude of 2.4Vand frequency of 352Hz.
         The signal is acquired with on-chip ADC0 module with 16-bit resolution. The ADC0 can
be initiated from various sources such as AD0BUSY bit, Timer2 overflow, Timer3 overflow, and
external trigger. In the present design, it is important that all the clocks for sampling, and signal
generation need to be synchronized because of a possible change in phase relationship of the
signal with the change in timings. For this reason, the ADC0 conversion is also derived from
Timer3 overflow and it is set to produce the start-of-conversion signal for every 10µSec (at a
sampling frequency of 100 kHz) so that the signal generation and acquisition will be done at the
same time. This feature makes the system to lock the signal frequency to the reference frequency.
The ADC0 acquires this signal every 10µsec and stores the sampled data directly on data RAM
through DMA controller. 64KB of data-RAM is available on C8051F060TB board. Hence, about
100 cycles (284 data samples for each cycle of 350 Hz signal) at the sampling rate of 100 kHz
will be stored. If the sampling is performed with 16-bit resolution at 100 kHz rate, then an anti-
aliasing filter needs to be set at 50 kHz to attenuate any signals above 50 kHz. As the on-chip
ADC0 conversion time is 1µSec, it can be extended up to 1MHz. After collecting these samples,
the results of any subsequent data points are ignored until the current data has been processed.
The data collected will be processed by using quadrature sampling to find amplitude and phase of
the signal and are displayed on LCD. In this method the reference and phase shifted reference
values are multiplied directly to generate the intermediate X’ and Y’ signals. These X’ and Y’ of
100 waves are averaged to eliminate random noise of the signal and to get X and Y. These X
and Y values are used to calculate amplitude and phase by using the relations
 Amplitude = X 2 + Y 2 , Phase = tan −1 (Y X ) .Since, on-chip ADC of microcontroller is unipolar, the
microcontroller board is provided with a circuit to convert input bipolar wave to unipolar wave. A
2-line, 16-characters LCD module is interfaced to microcontroller. The amplitude and phase are
displayed on the LCD. A temperature controller has been employed to study the phase transitions

International Journal of Advanced Research in Engineering and Technology (IJARET), ISSN 0976 –
6480(Print), ISSN 0976 – 6499(Online) Volume 4, Issue 2, March – April (2013), © IAEME

as a function of temperature. The scanning temperature is also displayed on LCD module. The
temperature, amplitude, and phase values are transmitted to the PC through serial port. The data
are stored and further used to plot the graph. The photograph of indigenously designed lock-in
amplifier system is shown in Fig. 2.
                                                                  C8051F060TB Microcontroller

                Signal                                                              Address
                             Pre-      Band Pass                       DMA            Data
                           Amplifier     Filter                       Controller

                                                                      Quadrature              XRAM (64KB)
                                                                     Sampling and             On-chip/Off-chip
               Reference                                             X     Y
                                        Reference sine                Calculate
                             DAC0        wave codes                                       Serial
                                                                     Amplitude &                         PC
                                       (Look-up Table)                                    Port

                                                                     LCD Module

                                Fig. 1. Microcontroller based lock-in amplifier

                           Fig. 2. Photograph of lock-in amplifier instrument


         An embedded ‘C’ program has been developed for lock-in detection. The flowchart of the
program is shown in Fig. 3. The code is developed using Silicon Laboratories IDE and Keil full-
version embedded ‘C’ cross compiler. The program first initializes the on-chip peripherals such
as, ADC0, DAC0, DMA, UART0, Oscillator, and LCD module interfaced externally. After
initialization the program generates sine wave with help of on-chip DAC0 and Timer-3 modules.
The sine codes are placed in the look-up table. These sine codes are scheduled updated to DAC0
using Timer-3. The Timer-3 is programmed to generate an interrupt every 10µSec. When
interrupt occurs, the program reads the sine code from table by calculating the step through phase
accumulator algorithm and sends to DAC0. By varying the step size, the frequency of sine wave,
thus generated, can be varied. Next, the program reads signal through ADC0 and calculates
amplitude and phase of the signal by averaging 100 waves, to eliminate random noise, and
displays on LCD. Finally, it enters the serial communication subroutine to send the measured
amplitude and phase to PC through UART0. The above procedure is repeated continuously.

International Journal of Advanced Research in Engineering and Technology (IJARET), ISSN 0976 –
6480(Print), ISSN 0976 – 6499(Online) Volume 4, Issue 2, March – April (2013), © IAEME


        The proposed microcontroller based lock-in amplifier is applied for photoacoustic
spectrometer to measure amplitude and phase of the PA signal to study the phase transitions. Nibu A
George et al [7] presented analog lock-in amplifier to detect the PA signal amplitude variations
during the temperature scanning. They proposed laser induced photoacoustic technique for the
detection of phase transitions in liquid crystals. The liquid crystals such as 7OCB and 8OCB are
studied and phase transitions of the same are presented. They reported the detection of first order and
second order phase transitions in these liquid crystals using PAS. The detected phase transitions are
compared with the standard DSC results of the same liquid crystals.


                                 Initialize on-chip peripherals viz., ADC0, DAC0,
                                  DMA0, Timer3, UART0, & Oscillator and LCD

                               Generate reference from microcontroller for chopping
                                                     laser light

                              Acquire generated acoustic wave from microphone and
                                  store on to XRAM through DMA Controller

                               Perform quadrature sampling on data points i.e., read
                              first point (X´) and 72nd data point (Y´), out of 284 data
                                                   points in a wave

                                           Calculate X and Y for 100 waves
                                                X = X+X´, Y = Y+Y´

                                     Average X = ( X 100) , Y = (Y 100 )
                                           (To eliminate random noise)

                                Amplitude =      X 2 +Y 2
                                                                Phase = tan −1 (Y X )

                                        Display amplitude & phase on LCD

                              Get temperature from PAS and send amplitude, phase
                                and temperature values to PC through serial port.

                              Fig. 3. Flowchart of the lock-in algorithm

International Journal of Advanced Research in Engineering and Technology (IJARET), ISSN 0976 –
6480(Print), ISSN 0976 – 6499(Online) Volume 4, Issue 2, March – April (2013), © IAEME

       The Fig. 4 shows block diagram of application of LIA to PAS [8]. It consists of 10mW IR
laser (830nm) source, PA cell, microphone, pre-amplifier, band-pass filter, and microcontroller
(lock–in amplifier). In PAS, the sample is irradiated by modulated laser beam; as a result, the
absorption of light energy by the sample generates excited internal energy levels. All or part of
the absorbed light energy is then transferred into heat through non-radiative relaxation process in
the sample. Since, radiation incident on the sample is intensity modulated, the internal heating of
the sample is also modulated at the same frequency. The air at the sample surface undergoes
compression and rarefactions by this internal heating of the sample, which in turn produces
acoustic signal of same frequency as that of the modulating signal. The acoustic signal generated
from the PA cell is converted into electrical signal by a microphone. Since, the PA effect is based
on the absorption of light energy by a sample resulting in the production of electric signal of a
very low amplitude, it is amplified by a high input impedance, high gain, and low noise amplifier
designed using LM308 operational amplifier. The signal to noise ratio is further improved by
passing through a band-pass filter. The band-pass filter is designed using op-amps LM308 for
Q=10, G=10, and fc=350Hz. Finally, the filter output is given to on-chip ADC0 of C8051F060
microcontroller. The data from the ADC0 are stored on to the XRAM. The indigenously
designed lock-in amplifier performs lock in detection from stored values to recover PA signal
and calculates amplitude and phase. The Phase transition of the samples is studied by varying the
temperature of the sample. The C8051F350 microcontroller based temperature controller has
been employed to vary the temperature. The amplitude and phase of PA signal are measured
during the temperature scanning. The scanning rate is of 0.30C/Min.
         In this application, the lock-in amplifier is used to study the phase transition of 5O.6
compound. The structure of 5O.6 compound is shown in Fig 6. The 5O.6 N-(p-n-

                                                                                           LCD Module

                         Laser                                                           MICROCONTROLLER
                        Source                         Comparator &

                                                          Driver         Buffer


                                 Microphone                                                   DMA
       PA Cell

                                                  Pre-Amplifier       Band Pass



                   LCD Module

                    Fig. 4. Application of lock-in amplifier for photoacoustic spectrometer

pentyloxybenzylidene)-p-n-hexylaniline compound is unique in nO.m series as it exhibits
maximum phase variantions viz., nematic, smectic-A, smectic-C, smectic-B, smectic-F, smectic-
G (NACBFG). The variations include both first and second order transitions. Both amplitude and
phase variations studied through the PAS technique, developed by the authors, facilitate to
identify all the phase transitions. On comparison with DSC thermogram, it is interesting to note

International Journal of Advanced Research in Engineering and Technology (IJARET), ISSN 0976 –
6480(Print), ISSN 0976 – 6499(Online) Volume 4, Issue 2, March – April (2013), © IAEME

that the PAS studies could resolve the second order smectic-A to smectic-C and smectic-G to
smectic-F transitions. While these transition could not be observed from DSC thermograms[9].
The photograph of complete system is shown in Fig. 6. The detailed flow chart of application of
LIA to photoacoustic spectrometer is shown in Fig. 7.

           H11C5O                           CH = N                            C6H13

                              Fig. 5. Structure of 5O.6 Compound

      Temperature Controller

                                                       PA Cell

     Fig. 6. Photograph of complete lock-in amplifier application to photoacoustic spectrometer

        From the experimental results it is found that the C8051F060 microcontroller based lock-
in amplifier system recovers the very small amplitude PA signal under external disturbances. The
system measures PA signal amplitude variations during the heating of the liquid crystal 5O.6
starting from crystalline phase to isotropic phase. Fig. 8 shows the amplitude variations during
heating of 5O.6 with a temperature scanning rate of 0.3oC/min. Fig. 9 shows the magnified view
of fig 8, which shows the remarkable phase transitions of 5O.6. The results, provide a evidence
of the sensitivity and significance of PAS technique in detecting the weak first order and second
order phase transition over other techniques viz. the DSC and TM. From the graph it is observed
that there is a remarkable phase transition at 34oC and 37.16oC. These transitions were not
observed in DSC [9]. The results of the present PAS, TM and DSC studies on 5O.6 compound
are consolidated in Table 1.

International Journal of Advanced Research in Engineering and Technology (IJARET), ISSN 0976 –
6480(Print), ISSN 0976 – 6499(Online) Volume 4, Issue 2, March – April (2013), © IAEME


                           Initialize on-chip peripherals viz., ADC0,
                          DAC0, DMA0, Timer3, UART0, & Oscillator
                                        and LCD module

                          Set the desired temperature(set point) and rate
                            of increase of temperature in temperature
                               control system for the sample under

                            Recover the photoacoustic signal though
                            Microcontroller based Lock-in amplifier.

                           Temperature of the PA cell is varied by using
                              C8051F0350 Microcontroller based
                                  temperature control system

                           Calculate Amplitude & phase and display
                                      on LCD module

                            Get current temperature of PA cell and
                                   display on LCD module

                          Send Amplitude, Phase and temperature to
                                computer through serial port.

                                No          Is stipulated


              Fig. 7. Flowchart of the photoacoustic spectrometer application

International Journal of Advanced Research in Engineering and Technology (IJARET), ISSN 0976 –
6480(Print), ISSN 0976 – 6499(Online) Volume 4, Issue 2, March – April (2013), © IAEME










                                                            Crys    G F       B+C      A         N              Iso
                                                       20    30         40        50        60        70         80        90    100
                                                                    Temperature(Degree Centi)----->
           Fig 8. Amplitude variations of PA signal of 5O.6 during temperature scanning







                                                            32     34        36     38      40       42    44         46    48   50
                                                                        Temperature(Degree Centi)----->

    Fig 9. Magnified view of Amplitude variations of PA signal of 5O.6 emperature scanning

                  Table1. Comparative study of phase transitions in TM, DSC, & PAS
Compound     Phase Variant    Instruments             Phase Transition Temperatures 0C
                                               I      N       A      C     B      F    G
                            TM[9]              72.9 61.7 53.3 51.8         44.4   40.6 35.0
                            DSC[9]             72.0 60.0       -     49.0     -     -    -
  5O.6       NACBFG
                            PAS                74.0 59.5 53.5 44.49 42.55 40.36 35.83
                            (Present Study)

International Journal of Advanced Research in Engineering and Technology (IJARET), ISSN 0976 –
6480(Print), ISSN 0976 – 6499(Online) Volume 4, Issue 2, March – April (2013), © IAEME


        The present work focuses on the design and development of C8051F060
microcontroller based Lock-in amplifier. Also the designed lock-in amplifier is used in
photoacoustic spectrometer to recover the PA signal and to study the phase transition of the
solid samples. This lock-in amplifier is very effective in recovering the signal of very small
amplitude. On-chip peripherals of microcontroller facilitate the generation and acquisition
simultaneously. The designed lock-in amplifier is applied to study 5O.6 liquid crystal
sample. Phase transitions are effectively detected with indigenously designed single chip
lock-in amplifier. The system is compact and reliable for studying the phase transitions of
various liquid crystal samples. Also the system is facilitated with serial interface to PC to
store the data for processing/analysis. The results obtained by the designed instrument are
compared with that of other methods like TM and DSC. They found to be in good agreement.


        Authors are thankful to the University Grants Commission, New Delhi, India
providing financial assistance to carry out this project successfully. Also the authors are
thankful to     Prof. V.G.K.M. Pisipati, Director, Centre for Liquid Crystal Research and
Education, Nagarjuna University, Guntur for providing the liquid crystal samples to carry out
the present work.


[1]     M Gabal., N. Medrano, B. Calvo, P. A. Martinez, S. Celma, M.R. Valero,A complete
low voltage analog lock-in amplifier to recover sensor signals buried in noise for embedded
applications, Proc. Eurosensors XXIV, Sept. 5-8, 2010, Linz, Austria.
[2]     Juh Tzeng Lue., Junction Impedance Measurement of Diodes by simplified lock in
amplifier, IEEE, Trans. On Instrumentation and Measurement, vol.IM.26, No. 4. Dec, 1977
[3]     G. Busse, M. Bauer, W. Rippel and D. Wu, Lockin vibrothermla inspection of
polymer compositesQIRT 92- Eurotherm Series 27 EETI ed., Paris 1992.
[4]     Adrian A. Dorrington and Rainer Kunnemeyer, A simple microcontroller based
digital lock-in amplifier for the detection of low level optical signals, Proc. of IEEE, Inter.
Workshop on Electronic Design, Test and Applications, 2002.
[5]     Maximiliano O.Sonnaillon., Raul Urteaga and Fabian., Jose Bonetto and Martin
Ordonez., Implementation of A High frequency digital lock in amplifier, CCECE/ CCGEL,
Saskatoon, May, 2005.
[6]     C8051F350 Data Manual, Cygnal Integrated Products, Inc, Austin, USA.
[7]     Nibu A. George et al, Laser induced photoacoustic technique for the detection of
phase transitions in liquid crystals, Nondestructive Testing and Evaluation, vol. 17, pp. 315-
324, 2001.
[8]     P. Bhaskar, Immanuel J., and Bhagyajyoti, Design and development of
microcontroller based photoacoustic spectrometer, Sensors & Transducers, vol. 141, issue 6,
pp-26-34, 2012.
[9]     P. Bhaskar, Design and development of computer based instrumentation system for
photoacoustic studies, doctoral diss., Sri. Krishnadevaraya University, Anatpur, August 2000.


Shared By: