Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

NotificationsYou must be signed in to change notification settings

Dennis-van-Gils/DvG_Arduino_lock-in_amp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest releaseLast commitCode style: BlackMIT License

DvG Arduino lock-in amplifier

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).

Screenshot Seehere for more screenshots.

Specifications

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)
  • 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)

Prerequisites

Python 3.8+
Preferred distribution: Anaconda full or Miniconda

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

Precompiled firmware

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.

BoardFirmware folder: \mcu_firmwareSampling rate
Arduino M0 Pro\v1.0.0_VSCODE\mzeropro__10kHz10 kHz
Arduino M0 Pro\v1.0.0_MICROCHIPSTUDIO\mzeropro__20kHz20 kHz
Adafruit Feather M4Express (preferred)\v1.0.0_VSCODE\adafruit_feather_m4__25kHz25 kHz

Flashing firmware onto the Adafruit M4 board is super easy. Simply copyover the fileCURRENT.UF2to the FEATHERBOOT mount drive.

Pin-out

For the case of an Adafruit Feather M4 Express board, see below. Otherboards have a similar pin-out.pinout

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

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp