Close
0%
0%

ADA2200 Lock-In Amplifier

This project will attempt to explore and explain the use of the Analog Devices ADA2200 to build Lock-in Amplifiers.

Similar projects worth following
A Lock In Amplifier using the ADA2200 is a key part of my Spectrophotometer Project. While it seemed to work satisfactorily, I didn't ever feel like I really mastered it. There have been a few questions about the Lock In Amp that have inspired me to investigate it further and try to really understand it. This project will focus on the use of the ADA2200 specifically and will explore its operation using some support circuitry and trying some classic Lock In Amp experiments.

In general, here is how I expect this project to go. Details will be added here as they develop. As each step happens, I'll add a Project Log.

Step 1: Required reading - data sheet and Eval board description.  A Teensy 3.X will be used to do the configuration, clocking, and the sampling. The design used in the Spectrophotometer will be copied for the output; the input side will be new.
Design question: Should inputs be single ended or differential?
Design question: How should the RCLK output be conditioned to use as a signal source?

Step 2: Introductory Experiments that I want to try on the first design. What features should the board have for these? This step also yields the test signals / noise source that will be used.

Step 3: Initial design. How to partition the design? Are pre-amp and filters separate boards? Design board(s) and order parts.

Step 4: Build and Test! What works and what doesn't? What can I learn about using quadrature?

Step 5: Let's build a milliohm meter! Seems like a worthy goal.

Step 6: Let's measure an LED's response (classic experiment)! Another worthy goal.

Step 7: Evaluate results and redesign as needed.

Update 7/6/18, more or less at Step 5. Hope you're reading the Project Logs! Obviously, I'm not finished yet, but it seems worth making a couple of observations.

What is the ADA2200 really?

The ADA2200 is a module that can be the heart of a full-featured lock in amplifier. The heart is not useful by itself, but needs a proper analog signal chain around it to condition the signals to make a useful instrument. With the proper analog modules, a general-purpose lock in amplifier can be built. With a more specialized and limited signal chain, more limited, but still very useful, instruments can be created that need the capabilities of a lock in amp at their heart. Examples could include a milliohm meter, a low-level light meter, and numerous biomedical instruments. And, yes, even the spectrophotometer that started this investigation into the ADA2200.

Future work

Understanding the ADA2200 was my goal for this project. I feel I’ve learned a lot and can continue to learn a lot more. But more than that, I have tried to provide modules and a process for others to use for their own investigations and lock-in based projects. Hopefully, this work will be shared on HAD!

Update 7/28/19

The designs for the ADA2200, the two noise sources, and the opamp breakout are now shared on OSHPark. Look under "doctek". Enjoy! And the schematics, etc. are shared in the Files section here.

LockIn_Control.ino

Arduino code for the Teensy 3.1/3.2 to configure and control the ADA2200.

ino - 9.36 kB - 07/07/2018 at 23:15

Download

LI_Support.pdf

Scematics of the op amp circuits for the experimental signal path. These were built on a solderless breadboard.

Adobe Portable Document Format - 53.57 kB - 06/11/2018 at 22:14

Preview
Download

lab1_intro_phase_shifter.pdf

Describes the all pass filter design.

Adobe Portable Document Format - 91.10 kB - 05/30/2018 at 00:50

Preview
Download

OpAmp_Schem.pdf

Single Supply Opamp break-out for breadboarding.

Adobe Portable Document Format - 16.18 kB - 12/23/2017 at 05:27

Preview
Download

LINoise2_Schem.pdf

White noise source from EDN.

Adobe Portable Document Format - 22.48 kB - 12/23/2017 at 05:27

Preview
Download

View all 13 files

  • Software and Teensy Setup

    doctek07/07/2018 at 23:14 0 comments

    It just hit me that I have not uploaded or described the Arduino software that handles clocking, configuration, and sampling of the ADA2200. Sure, you could grab the program from the Spectrophotometer Project, but it’s got extra stuff in it that is really just confusing for this project. So the file Lockin_Control.ino in the files section is the program specific to this project. I am running Arduino 1.8.2; the Board is the Teensy 3.1/3.2. The Serial port is the USB link of Teensy, not a traditional serial (RS-232) link.

    Software for the
    ADA2200 must perform three tasks. First, the SPI port must be
    manipulated to configure the ADA2200. Having an interface to change
    the configuration on the fly is also useful. Most Arduino
    configurations (including Teensy 3.1/3.2) have a SPI communication
    package. If your are using more than one device, be sure to read the
    info at pjrc.com on SPI. Several commands can be sent via the Arduino
    Serial Monitor to change configuration.

    Second, we use the
    software to configure the master clock to the ADA2200 so no
    additional crystal or oscillator is needed. The FrequencyTimer2
    package can be used for this. Additional details at pjrc.com.

    Third, one channel of the analog-to-digital converter (ADC) is used to sample data from the ADA2200. Timing for the sampling is provided by the Synchronization signal from the part; Syn on our board. This signal is connected to an Arduino digital pin and generates an interrupt whenever it occurs. This interrupt starts the sampling by the ADC. The ADC will cause an interrupt each time a sample is ready. These samples can be saved and averaged. They can also be displayed on the Arduino Serial Monitor, or uploaded by another program running on a PC.

    Here’s the connections from the Teensy 3.1/3.2 to the ADA2200 board or the breadboard:

    GND to GND on the breadboard

    D5 is CLK to the ADA2200 Board

    D11 is MOSI for the SPI Bus, to MOSI on ADA2200

    D10 is /CS for the SPI Bus, to CS on ADA2200

    D14 is SCK for the SPI Bus, to Sck on ADA2200

    D17 (really A3, analog input to the A/D), can be connected to either OPs or ONs as desired

    D20 is the sample clock input from Syn of the ADA2200

    USB5V goes to a 3.3V linear regulator to supply 3.3V to the breadboard

    The MISO signal is shared with RCK, so RCK is the signal I choose. I used MISO briefly when I was trying to verify that the part was communicating but it is no longer useful. RCK is very useful!

    Time to open Lockin_Control.ino! This is best done in the Arduino environment so you can upload the code to the Teensy.

    Look at the
    #includes to start things off. I’m using the SPI, FrequencyTimer2,
    and ADC packages from pjrc.com for the Teensy3.1/3.2. These may
    already be part of your Arduino environment, but check to be sure.

    Next I declare some useful variables, pins, and modes; then instantiate an object or two. The SPI Settings are used below and the ADC is configured further and used below.

    The Setup() function is pretty obvious. Objects are configured, the Serial port is opened, ADC sampling is started, an opening message is sent, and the master clock is started. The configuration of the ADC is from the Spectrophotometer Project; lots of experimentation could still be done. Since the sampling is pretty slow, the slow settings seem appropriate for now. The alternate SPI clock pin is selected to avoid the pin that is connected to the LED.

    More global variables are declared before the Loop() function. These are used for data collection and averaging; explained below.

    The Loop() function waits for commands over the Serial (USB) port. If a character is available, the switch statement processes it. (In looking at this code, I notice it is lacking a default case clause. It should probably have one in case of errant input, but it reminds me to emphasize an important point. This parser is written simply to help the user interact with the ADA2200. It assumes the user...

    Read more »

  • Experiments & Investigations

    doctek06/13/2018 at 04:51 0 comments

    The previous log discussed the modules I've built so far and the blocks in the signal chain I've created on the breadboard. Time now to have a look at the results of the experiments using that signal chain. Let's see what we can learn about the ADA2200 with some simple, yet interesting, experiments.


    Preliminaries

    The following description of tests and test results should be useful to anyone trying to understand the ADA2200 and wanting to work with it. These tests start at the basic level and proceed to more complete functional tests. These tests are by no means exhaustive, but they helped me figure out the part. Please note that the order I suggest here is not the order in which I originally did these tests. I thrashed about a fair amount discovering what made sense, what could be done better, and what should have been done sooner. I spare you this stumbling about in the interests of making a more coherent and logical path for you to follow. However, this is by no means optimum and you’ll think of many ways to improve what I’ve done. Your results may well differ in detail from mine.

    For the first tests, use the signal chain described in the schematic, but leave the noise source powered down. I simply left the +/-9V power disconnected.

    I used a 3.3V regulator on USB 5V for the 3.3V supply; the 3.3V from the Teensy3.1 was not used. The goal was to be sure that a stable 3.3V was applied. With this supply, Vocm from the ADA2200 was quite steady at 1.61 to 1.62 volts. Voltage values from the ADA2200 are relative to Vocm. That is, Vactual = +/-Vmeasured -/+ Vocm. The sign is chosen based on the voltage measured. If it is greater than Vocm, subtract Vocm from it; if it is less than Vocm, subtract it from Vocm. The Vocm value of the input signal doesn’t affect the Vocm out of the ADA2200, but should be around 1.62V for best dynamic range. This is discussed more below.

    ADA2200 Signal Processing

    To make sense of the voltages shown on the output I had to calculate the RMS value of the input. Since RCK was filtered by a 4 stage Butterworth filter, the input signal was a pretty good sine wave. For a sine wave, Vrms = Vpk-pk * SQRT(2)/4. Adding or subtracting Vrms to or from Vocm gave the voltage I measured at the outputs or with the averaging routine in the Teensy (explained above). Use commands “8g”, “a” to get a measurement from Teensy via the Arduino serial monitor window. The Arduino configures the ADA2200 via the SPI bus. The low pass filtered versions of the OPs or ONs signals are on the ADA2200 module pins labeled OPv and ONv. These give values nearly identical to those given by the Teensy averaging routine connected to OPs or ONs. OPv and ONv are the same signal mirrored about Vocm. So if OPv is giving values below Vocm and you want to work with values above Vocm, then just take the output from ONv. OPs and ONs work the same way. Changing the input connection from InP to InN while connecting InP to Vocm, produces a similar effect.

    Although my earliest experiments suggested that a final inversion of the sine wave input to InP was needed, this added a 180 degree phase shift with respect to RCK. This is point 5 in the signal chain. The scope pictures in the previous project log were taken with this as the input to the ADA2200. I found it more intuitive to take the InP signal from point 4; the phase shift between the sine wave and RCK is due only to that set with the Phase Adjust Block. Using the cursors on my scope made it easy to adjust the delay.

    ADA2200 Sample Timing

    Figure 5 of the data sheet shows the expected timing of the signal samples. Naturally, I wanted to verify that things were working as they were supposed to. I also wanted to know how the sine wave, would be sampled. Sample timing is specified with respect to the rising edge of RCK. The delay from that edge to the zero crossing of the sine wave derived from RCK (via the signal chain) is ¼ of a cycle, or 90 degrees....

    Read more »

  • Modules and Experimental Signal Chain

    doctek05/29/2018 at 00:58 0 comments

    W--a--y too long a delay here! A software project soaked up much more time than I expected it to, but now I'm back onto the Lock-In Amp. Time to check out the modules that got built back in January and do some experimenting.

    ADA2200 Module:

    Since this module was a copy of the Spectrophotometer design, I expected it to work fine and it did not disappoint. Using the Teensy 3.1 to provide the 10KHz clock in signal, the SCK was at 1250Hz and the RCK was at 156Hz as expected. These values were used for all experiments. Note that the SPI commands must be working in order for the external clock to control the operation and produce the correct SCK and RCK outputs.

    NBS Noise Module:

    This module seemed to be most interetsing since it could output both white noise and pink (1/f) noise. It also only needs +/-5V. Initial tests showed it worked correctly, but sadly I reversed the power supply connections and popped the op amp. I want to replace the op amp and experiment with it some more.

    EDN Noise Module:

    While this module needs +/-9V, it's still easy to use. Works fine, but the output level must be boosted to be useful in my tests. The amplifier will be discussed below when we look at the experimental signal path.

    Op Amp Module:

    The purpose of this little board is to break out new, single-supply, low-voltage op amps. While the board works fine, I haven't had to use these hot new op amps yet. I will use them in coming experiments. Stay tuned!

    Signal Chain:

    With these key modules assembled and working, I wanted to test the operation of the ADA2200 and learn more about the Lock In Amplifier. Looking at the figures in the ADA2200 Data Sheet led me to think that an ideal test input would be a sine wave with the same frequency as the RCK, having a variable amplitude and phase which could be varied with respect to RCK. The input should be 3V amplitude (maybe less) and centered at 1.65V.  I wanted to be able to mix in varying amounts of noise as well. So I designed a signal chain which I built on a breadboard and which produced the desired signal.

    The key blocks I use are the buffer, invert, gain, summing, filter (low-pass Butterworth) , and a phase adjust (all-pass filter) used to shift the phase the RCK signal after it is filtered. The schematic showing each of these blocks is included as LI-Support.pdf. The blocks are built on a breadboard and are described below.

    It would be nice if circuit modules could be built that could handle a range of frequencies of RCK. Sadly, filter cut off frequencies are determined by resistor values. So the simplest scheme I could think of was to build the circuits on the breadboard. The designs I use for the modules are provided as schematics with the values I use. Please look at the file LI_Support.pdf. The numbers shown will be referenced below as the signal path is explained. Much of the challenge in designing a general-purpose Lock In Amplifier goes into building flexible modules for signal conditioning. I want to be sure I understand the Lock In part (ADA2200) itself first. So I’m happy to have a signal path for a single frequency.

    Here is how the bread board looks.

    The Teensy3.1 and the ADA2200 module:

    Block Descriptions:

    Buffer Block: The signal chain for the sine wave signal begins with a buffer. The RCK signal is buffered using ½ of a TLC1078 with a supply voltage of 5 volts. Following this block with a pot to ground provides amplitude adjustment. The points on the schematic are 10, 11, 12. Here is the result shown at 12.

    It's simply the square wave output of RCK at 156Hz with amplitude adjustment. Without the buffer, the RCK signal from the ADA2200 won't drive the filter that comes next.

    Filter Block: The filter is a four stage, low pass, Butterworth design implemented as a VCVS active filter. A TI TL032 dual op amp is used. The design is detailed in The Art of Electronics by Horowitz and Hill, 2nd Edition, pages 273-275....

    Read more »

  • First Module Designs

    doctek12/23/2017 at 04:52 2 comments

    The designs for the first modules just shipped to OSH Park and parts are on order from Digikey!

    The more I thought about these modules, the simpler they got - at least these first versions. The ADA2200 break out just has that device, a few decoupling caps, and an output filter. Modules were designed for the two noise sources - basically just copying the designs given in the articles. The final module is just a break-out for a dual, single-supply opamp. There are several suitable opamps that could be used including TS922, LMV772, OPA2376, and ADA4528-2. Spend as much or as little as you like! Using this break-out, it should be possible to build filters, summers, and level shifters as needed on a breadboard.

    Another module that I'm eager to create is a programmable gain amplifier. I have some circuits to look at that will provide guidance, but I wanted to get these first modules built so experimentation can begin. PDFs of the schematics are in the Files section (or soon will be). KiCAD files are available if anyone wants them.

  • Circuit Planning

    doctek11/26/2017 at 17:16 0 comments

    Eager to start designing a first version of the Lock In Amp Experiment Board (TM), I examined the sections that I wanted to include (noise source, clock filter, signal source, etc.) and realized that some level shifting and dual to single supply conversion would be required. No problem, I thought, that's what opamps are for, and I've used them before. But, as always, God lives in the details, and I hadn't worked closely with opamps for a while. So I dug out Horowitz and Hill, found my old opamp stash, grabbed the Heathkit ET-3100 Electronic Design Experimenter,googled relevant Apps Notes, and went at it. Building a few amplifiers, buffers, filters, and summers in both dual and single supply versions proved so instructive that I think I will change my approach to building an Experiment Board.

    The new plan is to create some modules that will plug into a breadboard and connect in a flexible and easily changed manner. The ADA2200 will be one of these modules - it will mostly copy the design from the spectrophotometer and will expect to get the clock from a Teensy3.X and send signals to it. It should be easy to interface a different controller if desired. Two noise source modules are also planned. Their descriptions are included in the Files section. A filter to create a sine wave from the RCLK will be another module, as will a summing module and modules to create suitable input signals for the ADA2200. Other modules will be created as needed to support experiments. Obviously, these modules will be explained as they are created. The descriptions of the noise sources are in the Files section.


  • Getting Started with the Lock In Amp

    doctek10/24/2017 at 01:03 0 comments

    Time to get started! The ADA2200 Data Sheet and the ADA2200SDP-EVALZ-UG-787 explain the part I plan to use and show an evaluation board design that I will use for guidance. In addition, the design in https://hackaday.io/project/12491-spectrophotometer will be used especially for the output connection to the Teensy. The Teensy is not required. Other control schemes could easily be used.

    To aid understanding, the Data Sheet has a good explanation of the operation of a Lock In Amplifier. The Orozco article (lock_in_amplifier.pdf) has another good explanation. Together, they should provide a basic understanding. There are many other papers that offer more academic and mathematical explanations, but these can be read later.

View all 6 project logs

Enjoy this project?

Share

Discussions

agent1 wrote 04/22/2019 at 02:09 point

Hello, I also am interested in purchasing your ADA2200 lock-in amplifier board, can I purchase this board directly from you?

Kind regards

  Are you sure? yes | no

chandrasekhar wrote 11/05/2018 at 05:43 point

Hi, thanks for your prompt replay. will refer the schematics and try to design my own board with ADA2200 to develop lock-in amplifier 

  Are you sure? yes | no

doctek wrote 11/03/2018 at 21:31 point

As you can quickly tell by reading this project, there is no module as such. My interest is in learning how the ADA2200 works, not in developing a product.

All of the schematics for my circuits are in the Files section and are discussed in the Project Logs. I am very willing to share the KiCAD files for the ADA2200 module with you if you would like to order the boards. Keep in mind you will also need a Teensy3.2 or a similar microprocessor board to control and configure it, as well as analog signal conditioning circuitry. As a post grad in Electronics, I'm sure you understand all that.

You might also look into the Analog Devices ADA2200 demo boards that are available. They might serve your purposes.

  Are you sure? yes | no

chandrasekhar wrote 11/03/2018 at 13:22 point

Hi i need this ADA2200 Lock-In Amplifier. Can you please let me know from which source i can buy this module directly ? thanks in advance 

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates