Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork6
A fully fledged lock-in amplifier running at 25 kHz sampling rate @ 12-bit on an Adafruit M4 microprocessor board with an extensive Python graphical user interface showing real-time signals, interactive filter design and real-time power spectra.
License
Dennis-van-Gils/DvG_Arduino_lock-in_amp
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A fully fledged lock-in amplifier running at a 25 kHz sampling rate at 12-bitanalog resolution with an extensive graphical user interface showingreal-time signals, interactive filter design and real-time power spectra.
The project is part of the lab assignments 'Small Signals & Detection' of theUniversity of Twente, Enschede, The Netherlands. Auser manualwith detailed installation instructions and troubleshooting is provided. Thislock-in amplifier can very well be used for scientific research in the lab.
It consists of a PC/laptop running Python for the graphical user interface andsignal post-processing in combination with a microcontroller board for thephase-locked signal generation and acquisition. The preffered microcontroller isan Atmel SAMD51 microprocessor (e.g. an Adafruit M4 Express board like theFeather or ItsyBitsy), but support for the slower Atmel SAMD21 microprocessor isalso provided (e.g. an Arduino M0 Pro).
Seehere for more screenshots.
The microcontroller will generate the reference signalREF_X*
andsubsequently acquires the input signalSIG_I
. This data is sent over USB toa PC running the graphical user interface in Python. The interface shows thewaveform graphs of the signals in real-time, performs the heterodyne mixing andfiltering of the signals (i.e. the lock-in technique), and provides logging todisk.
Microcontroller:
- Support for Atmel SAMD21 or SAMD51 chipsets
- The ADC & DAC are locked in phase and operate at sampling rates of 20 kHz and above
- True analog-out waveform generator (
REF_X*
between 0 to 3.3 V) - Two modes available for the analog-in data acquisition. Determined bya flag set in the firmware:
- Single-ended (
SIG_I
between 0 to 3.3 V), default - Differential (
SIG_I
between -3.3 to 3.3 V)
- Single-ended (
- Optimized data transmission over USB (double-buffered binary-data stream)
Python program:
- Graphical user interface
- Separate threads for communication with the Arduino, signalprocessing and graphing
- Accelerated mathematical operations based onpyFFTW,Numba andSciPy
- OpenGL hardware-accelerated graphing
- Zero-phase distortion FIR filters
- Automatically connects to the Arduino by scanning over all ports
- Tested under Windows 10 and Ubuntu 18.04.2 (Linux)
Installation instructions in Anaconda Prompt:
conda update -n base -c defaults condaconda create -n lia -c conda-forge --force -y python=3.8.10conda activate liapip install -r requirements.txt
Now you can run the graphical user interface of the lock-in amplifier.In Anaconda prompt:
conda activate liaipython DvG_Arduino_lockin_amp.py
I provide several precompiled firmware that can be flashed straight ontothe microcontroller board of your choice. This eliminates the need tocompile the code for yourself. They can be found in themcu_firmwarefolder. See the table below for suggested firmware to use best. Forother boards you'll have to compile the code yourself.
Board | Firmware folder: \mcu_firmware | Sampling rate |
---|---|---|
Arduino M0 Pro | \v1.0.0_VSCODE\mzeropro__10kHz | 10 kHz |
Arduino M0 Pro | \v1.0.0_MICROCHIPSTUDIO\mzeropro__20kHz | 20 kHz |
Adafruit Feather M4Express (preferred) | \v1.0.0_VSCODE\adafruit_feather_m4__25kHz | 25 kHz |
Flashing firmware onto the Adafruit M4 board is super easy. Simply copyover the fileCURRENT.UF2to the FEATHERBOOT mount drive.
For the case of an Adafruit Feather M4 Express board, see below. Otherboards have a similar pin-out.
The provided precompiled firmware defaults to single-ended ADC, meaningsig_I
is measured with respect toGND
. You can adjust the flagADC_DIFFERENTIAL
in themain.cpp
source code and recompile toswitch to differential mode.
`ADC_DIFFERENTIAL = 0`, default------------------------------------------- A1: analog in, 0 to 3.3 V, sig_I with respect to GND- A2: not used`ADC_DIFFERENTIAL = 1`------------------------------------------- A1: analog in, -3.3 to 3.3 V, sig_I(+)- A2: analog in, -3.3 to 3.3 V, sig_I(-)
Dennis van Gils, 03-02-2022
About
A fully fledged lock-in amplifier running at 25 kHz sampling rate @ 12-bit on an Adafruit M4 microprocessor board with an extensive Python graphical user interface showing real-time signals, interactive filter design and real-time power spectra.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.