We perform phase-sensitive detection with an inexpensive microcontroller, the Teensy 3.5. The programming and pricing of this microcontroller is similar to that of commonly used Arduino microcontrollers, but the Teensy 3.5 offers superior hardware performance. Our Teensy-based phase-sensitive detector can operate either with an external reference signal or by internally generating a reference signal. Additionally, we have developed an open-source graphical user interface for controlling the instrument. We demonstrate that our phase-sensitive detector exhibits good linearity in amplitude and phase, even with 25 mV signals dominated by larger-amplitude noise. We also use our phase-sensitive detector in a simple laboratory measurement: determining the distance dependence of the intensity of a light-emitting diode (LED) with the room lights on. Our instrument is a useful tool for teaching students about phase-sensitive detection and can be a viable low-cost alternative to commercial lock-in amplifiers.

1.
K. G.
Libbrecht
,
E. D.
Black
, and
C. M.
Hirata
, “
A basic lock-in amplifier experiment for the undergraduate laboratory
,”
Am. J. Phys.
71
,
1208
1213
(
2003
).
2.
R.
Wolfson
, “
The lock-in amplifier: A student experiment
,”
Am. J. Phys.
59
,
569
572
(
1991
).
3.
D. A.
van Baak
and
G.
Herold
, “
Response of a lock-in amplifier to noise
,”
Am. J. Phys.
82
,
785
797
(
2014
).
4.
S.
DeVore
,
A.
Gauthier
,
J.
Levy
, and
C.
Singh
, “
Improving student understanding of lock-in amplifiers
,”
Am. J. Phys.
84
,
52
56
(
2016
).
5.
X.
Xu
,
Y.
Suganuma
, and
A.-A.
Dhirani
, “
Low-cost, high-performance lock-in amplifier for pedagogical and practical applications
,”
J. Chem. Educ.
97
,
1167
1171
(
2020
).
6.
M. A. K.
Nooruddin
and
S.
Roy
, “
A simple digital phase-sensitive detector using AVR microcontroller
,”
Am. J. Phys.
88
,
153
158
(
2020
).
7.
G. A.
Stimpson
,
M. S.
Skilbeck
,
R. L.
Patel
,
B. L.
Green
, and
G. W.
Morley
, “
An open-source high-frequency lock-in amplifier
,”
Rev. Sci. Inst.
90
,
094701
(
2019
).
8.
The Red Pitaya STEMLab 125-14 used by Stimpson et al. currently retails for $363.
9.
K. D.
Schultz
, “
Phase-sensitive detection in the undergraduate lab using a low-cost microcontroller
,”
Am. J. Phys.
84
,
557
561
(
2016
).
10.
C.
Galeriu
,
C.
Letson
, and
G.
Esper
, “
An Arduino investigation of the RC circuit
,”
Phys. Teach.
53
,
285
288
(
2015
).
11.
F.
Önder
,
E. B.
Önder
, and
M.
Oğur
, “
Determination of diode characteristics by using Arduino
,”
Phys. Teach.
57
,
244
245
(
2019
).
12.
J.-F.
Hsu
,
S.
Dhingra
, and
B.
D'Urso
, “
Design and construction of a cost-efficient Arduino-based mirror galvanometer system for scanning optical microscopy
,”
Am. J. Phys.
85
,
68
75
(
2017
).
13.
C. M.
Lavelle
, “
Gamma ray spectroscopy with Arduino Uno
,”
Am. J. Phys.
86
,
384
394
(
2018
).
14.
F.
Bouquet
,
J.
Bobroff
,
M.
Fuchs-Gallezot
, and
L.
Maurines
, “
Project-based physics labs using low-cost open-source hardware
,”
Am. J. Phys.
85
,
216
222
(
2017
).
15.
D.
Doucette
,
B.
D'Urso
, and
C.
Singh
, “
Lessons from transforming second-year honors physics lab
,”
Am. J. Phys.
88
,
838
844
(
2020
).
16.
The Teensy 3.5 can be purchased from https://www.pjrc.com/teensy/ and retails for US$24.25. At the time of submission, it is out of stock due to semiconductor supply chain problems but is expected to be available again in
2023
.
17.
When the input signal is not purely sinusoidal, a phase-sensitive detector extracts the Fourier component of the input signal at the reference frequency.
18.
J.
Fung
and
C. L.
Weil
, <https://github.com/jeromefung/teensy_lockin>.
19.
tkinter—Python interface to Tcl/Tk—Python 3.10.6 documentation
, <https://docs.python.org/3/library/tkinter.html>.
20.
C.
Liechti
, “
pyserial: Python serial port extension
,” <https://github.com/pyserial/pyserial>.
21.
FreqCount Library, for Measuring Frequencies in the 1 kHz to 5 MHz Range
, <https://www.pjrc.com/teensy/td_libs_FreqCount.html>.
22.
P.
Villanueva
, “
Teensy ADC library
,” <https://github.com/pedvide/ADC>.
24.
S. W.
Smith
,
The Scientist & Engineer's Guide to Digital Signal Processing
, 1st ed. (
California Technical Pub
,
San Diego, CA
,
1997
).
25.
Commercial lock-in amplifiers often refer to the filter time constant τ instead of the corner frequency f c; for a one-stage filter, f c = 1 / ( 2 π τ ).
26.
Matplotlib — Visualization with Python
, <https://matplotlib.org/>.
27.
Paul
Horowitz
and
Winfred
Hill
,
The Art of Electronics
(
Cambridge U. P
.,
Cambridge
,
2015
).
28.
See supplementary material at https://www.scitation.org/doi/suppl/10.1119/5.0126691 for further details about the hardware and recursive lowpass filtering as well as additional test data.

Supplementary Material

AAPT members receive access to the American Journal of Physics and The Physics Teacher as a member benefit. To learn more about this member benefit and becoming an AAPT member, visit the Joining AAPT page.