Magnetometer construction and applications for

Magnetometer construction and applications for introductory physics
William H. Bairda兲
Department of Chemistry and Physics, Armstrong Atlantic State University, Savannah, Georgia 31419
共Received 20 July 2007; accepted 14 April 2008兲
Student-constructed magnetometers and commonly available software illustrate the use of
autocorrelation functions to extract low-amplitude signals from background noise. The
magnetometers are later used to measure forces at sampling rates over 50 Hz, providing data for an
introduction to numerical integration. © 2008 American Association of Physics Teachers.
关DOI: 10.1119/1.2919741兴
III. AUTOCORRELATION FUNCTIONS
I. INTRODUCTION
The availability of low-cost Hall-effect sensors greatly
simplifies the study of magnetic fields, allowing measurements such as the distance dependence of fields produced by
permanent magnets as well as those arising from an electric
current.1–10 Students in the second semester of our calculusbased general physics course spend one to two laboratory
periods constructing and calibrating magnetometers that are
used for multiple purposes in later laboratories. The magnetometers are built inside electrical switch boxes 共fitted with a
household light switch and telephone jack兲 and connected
via telephone wire to back to back Hall chips 共typically the
Allegro 132111兲. The devices are durable, portable, and cost
less than $20.12
II. MAGNETOMETER CONSTRUCTION
The basic components of the magnetometer are few; essentially, all that is needed is a DC power source, a Halleffect sensor, and a voltmeter 共Fig. 1兲. Because the linear
Hall-effect chips we use are ratiometric, their output in the
absence of an external magnetic field is equal to one half of
the voltage of the DC source 共VCC / 2兲. A south pole near the
marked side of the A1321 increases the output voltage by
5 mV/ G, and a south pole on the opposite side reduces it by
the same factor. By gluing two of these chips back to back
and monitoring the voltage between the two output pins
rather than between each pin and ground, we can effectively
double the sensitivity while removing the zero-field voltage
offset. In the absence of an external field, small deviations
from the 共ideally兲 zero voltage reading using back to back
sensors will be more noticeable than similarly sized changes
in voltage VCC / 2 with a single sensor.
Power comes from a 9 V battery connected to a 7805 5 V
voltage regulator. Refinements to the design include an on/
off switch and a light emitting diode power indicator. Construction details available in Ref. 12 are chiefly concerned
with the mechanics of providing a more robust package for
the components and the process of soldering the pair of Hall
chips to telephone wires. A household telephone jack provides the interface between larger contacts suitable for the
hands of a beginner and the small wires and leads of the
telephone cord and Hall chips. An electrical junction box
holds both the telephone jack and, for power control, a light
switch 共easy to work with and inexpensive兲.
807
Am. J. Phys. 76 共9兲, September 2008
http://aapt.org/ajp
In one experiment we employ a standard computer sound
card as a recording device with the goal of using autocorrelation functions to detect low-frequency power line oscillations 共as others have done with photodiodes.13兲 The students
are led to the idea of an autocorrelation function by drawing
several cycles of a sine wave and learning that points which
are very close to one another on the x axis are also very close
to one another on the y axis because the function is continuous. As we compare points that are increasingly more distant
from one another on the x axis, their y coordinates change
from being almost equal to opposite and back to almost
equal in a cyclical fashion. This behavior is first illustrated in
a spreadsheet using a simple program written in Visual Basic, which is part of Excel.14 The Sine Wave button fills a
column with 5000 numbers calculated from a sinusoid of
unit amplitude added to a pseudorandom number from −5 to
+5. The resulting column is graphed and the underlying signal well obscured.
The Correlations button computes the sum of the product
of each data point and the data point j points away from it.
For comparison, the sum is calculated for j = 0 共that is, the
sum of the squares of each of the 5000 numbers兲 providing a
result that represents perfect correlation. The autocorrelation
function is defined as in Eq. 共1兲. This ratio is plotted as a
function of j, yielding an obvious sinusoid with an easily
determinable period.
Following Ref. 13, we note that the total signal detected
f共t兲 is composed of the signal of interest s共t兲 added to some
noise n共t兲. The autocorrelation function C f f 共t兲 consists of the
autocorrelation functions of s共t兲 and n共t兲 as well as their
Fig. 1. A minimal circuit to power dual A1321 Hall-effect chips and monitor
their output via a voltmeter.
© 2008 American Association of Physics Teachers
807
Fig. 2. The voltage amplitude data collected from the magnetometer while
in contact with the cord of a 15 W soldering iron drawing a root-mean
square current of approximately 0.12 A.
cross-correlation functions. Because the noise should not be
correlated with either itself or s共t兲, we can approximate
Css共t兲 共the function of interest兲 by C f f 共t兲 共calculated via the
spreadsheet兲. We denote the normalized autocorrelation function as C̃ f f 共t兲 and calculate it as
N−j
C̃ f f 共j⌬t兲 =
s共i⌬t兲s共i⌬t + j⌬t兲
兺
i=1
N
⬇ C̃ss共j⌬t兲.
共1兲
s共i⌬t兲s共i⌬t兲
兺
i=1
For comparison, the Random button generates 5000 pseudorandom numbers from −0.5 to +0.5. The autocorrelation
function shows no evidence of a pattern, as expected.
After completing this problem, data are collected by connecting the magnetometer probe to a sound card. The Sound
Recorder program included as part of Windows is used to
gather data. A capture rate of 8 kHz at a resolution of 16 bits
per sample is adequate for this purpose. The sound card is
shielded from excessive voltage by attaching the microphone
input wires to the smaller resistor in a voltage divider consisting of a 10 k⍀ resistor in series with a 1 k⍀ resistor. The
exact scaling factor from the true voltage output of the magnetometer to the endpoint of the analog to digital conversion
is not calculated for the graphs of Fig. 2 and Fig. 4.
Fig. 3. The autocorrelation function generated from the data in Fig. 2. The
sinusoidal nature of the autocorrelation function is more apparent than that
of the original data in Fig. 2.
808
Am. J. Phys., Vol. 76, No. 9, September 2008
Fig. 4. Amplified voltage data collected from a magnetometer probe in
proximity to a fluorescent light bulb.
A separate spreadsheet15 provides a plot of the data extracted from the WAV file 共Fig. 2兲, which does not show a
clear oscillatory signal. A plot of the autocorrelation function
is shown in Fig. 3. Three cycles are completed in the time
interval from 0 to 400⫾ 8 time units. These units are the
reciprocal of the sampling frequency 共8000 Hz兲, or 125 ␮s.
Three cycles therefore take 共1 / 20兲 s, which is as expected
for 60 Hz line oscillations.
A fluorescent light bulb drawing 0.27 A was also studied
with the magnetometer 共see Fig. 4兲. The magnetometer outputs were connected to the inputs of an operational amplifier
similar to one constructed by students in a later laboratory.
The amplifier makes the presence of the signal in the raw
data obvious, but the autocorrelation function serves to clean
up the shape significantly 共see Fig. 5兲. Three cycles take
200⫾ 2 time units, corresponding to a frequency of 120 Hz,
as would be expected for a fluorescent light.
In a related experiment, an extension cord 共split so that the
two wires can be separated from one another兲 is connected to
a high-current appliance and the magnetometer probe is
placed at successively longer distances from one of the
wires. The sound card is again employed to record WAV
files, which are all trimmed to the same time duration. The
files are analyzed using a program that implements the fast
Fourier transform 共FFT兲 described in Ref. 16. The amplitude
versus frequency plot made by the FFT program reveals the
higher harmonics caused by the presence of nonohmic devices such as the switching power supplies used in nearby
computers and the fluorescent lights in the room.17 The am-
Fig. 5. The autocorrelation function produced from the voltage data displayed in Fig. 4. The frequency of oscillation is seen to be about 120 Hz in
this case, in contrast to the 60 Hz signal of Fig. 3.
William H. Baird
808
Fig. 6. Log-log plot of the amplitude of the 60 Hz component of the Fourier
transform of magnetometer data as a function of the separation between the
magnetometer probe and a current-carrying wire. The amplitude of the
60 Hz component is proportional to the amplitude of the magnetic field
surrounding the wire.
plitude of the 60 Hz frequency component for each file is
plotted as a function of distance. A log-log plot of the data
共Fig. 6兲 admits best fit lines with slopes from about −0.5 near
the wire to approximately −1.5 far from it. Although the
magnetic field near a straight infinite wire is inversely proportional to the distance from that wire, the actual circuit
must consist of two wires 共separated by a distance d
= 32 cm in the middle of the cord decreasing to d ⬍ 1 cm at
the ends兲 of finite length carrying oppositely directed currents. The presence of two opposite currents leads us to expect the field to drop off faster than 1 / r at larger distances as
the condition r d no longer holds.
IV. MODEL ROCKET ENGINE THRUST CURVE
The magnetometers constructed by second-semester students are also used by students in the first-semester laboratory. Although there are many ways to measure the thrust
output of a model rocket engine,18–22 our students use the
magnetometers in conjunction with two opposing
neodymium-iron-boron 共NdFeB兲 magnets.
The magnets 共2.54 cm in diameter by 1.91 cm in length兲
are placed inside a PVC pipe so that the upper magnet floats
stably above the lower magnet 共see Figs. 7 and 8兲. A dowel
rod with a diameter slightly smaller than the PVC pipe rests
Fig. 8. Photograph of the completed force-measuring apparatus.
Fig. 7. A device for measuring the thrust of a rocket engine. The applied
force is determined by measuring the magnetic field at a point between two
oppositely oriented magnets.
809
Am. J. Phys., Vol. 76, No. 9, September 2008
on the upper magnet and protrudes from the PVC pipe to
provide a point of attachment for the engine holder. The
engine holder is made from a PVC male adapter and flange
connected back to back with a cast-iron flange and a short
William H. Baird
809
Table I. Engine performance data from the magnetic scale and from the
testing facility at the National Association of Rocketry 共NAR兲.
Magnetic scale
NAR data
7.7 N s
12.4 N
1.83 s
4.2 N
8.82 N s
14.09 N
1.86 s
4.74 N
Impulse
Peak thrust
Firing time
Average thrust
V. OTHER APPLICATIONS
Fig. 9. Thrust curve for an Estes C-6 model rocket engine as determined
using the magnetic scale in Fig. 7.
section of iron pipe. The PVC male adapter sits on the dowel
rod and multiple holes are drilled in the pipe, allowing air to
escape as the magnets are compressed and providing an access point to insert the magnetometer probe near the top of
the lower magnet.
The entire apparatus is placed on top of an inexpensive
postal scale for calibration purposes. Both the scale reading
and the voltage output of the magnetometer are recorded as
different masses are placed on the engine holder. After a
calibration curve has been generated, the rocket engine is
weighed separately and inserted 共open end up兲 into the engine holder. The magnetometer’s voltage outputs are connected to an analog voltage sensor on a data acquisition
board 共Phidget 8/8/8 interface kit兲 capable of recording approximately 50 data points per second. The engine is fired
共either outdoors or inside a fume hood兲 and the time/voltage
data collected is transformed into time/force data.
The thrust curve produced in this manner 共see Fig. 9兲 compares favorably with that produced by the National Association of Rocketry’s testing facility 共see Fig. 10兲. An exception
is the presence of a rebound in our curve after the initial
large impulse as the upper magnet briefly “bounces” above
its new equilibrium position. The magnets could be housed
inside a copper pipe to provide a damping force, but its presence would significantly complicate the data analysis because the full duration of the engine burn is short, and the
upper magnet is therefore required to move quickly. The data
produced by numerical integration is compared to that from
the National Association of Rocketry in Table I.
A project is underway to put the magnetometers and associated equipment into a small number of middle- and highschool classrooms. Coupling the magnetometer with an amplifier and data acquisition board allows for longer-term
monitoring of ambient magnetic field changes in the 100 nT
range. This recording magnetometer is expected to log the
electromagnetic activity produced in thunderstorms as well
as the effect of solar storms on the Earth’s magnetic field as
the Sun moves out of its current minimum in its sunspot
cycle.
The magnetometers built by our students have also played
small roles in a variety of other experiments. We have investigated the period of a physical pendulum by attaching a
small magnet to the end of the pendulum and placing the
magnetometer probe at the lowest point of its arc and recording the voltage via a sound card. A similar experiment using
a fluxgate magnetometer was described in Ref. 23. Another
laboratory uses small computer fans to demonstrate the duality of motors and generators. Part of that process involves
finding the rotational speed of the fans for several applied
voltages. Students tape a very small piece of sheet steel to
one of the fan blades and place the magnetometer probe and
a magnet on opposite sides of the fan. The distortion in the
field as the steel passes between probe and magnet is clearly
shown on an oscilloscope. In summary, we have found these
devices to be useful whenever we need to accurately measure
the position or velocity of an object on short time scales.
ACKNOWLEDGMENTS
The author thanks the referees for useful comments, as
well as the suggestion to measure the distance dependence of
the magnetic field produced by a current-carrying wire.
a兲
Electronic mail: [email protected]
P. A. Bender, “Measuring magnetic fields with an IC chip in the introductory lab,” Am. J. Phys. 54共1兲, 89–90 共1986兲.
2
A. J. Kromminga and D. A. Van Baak, “Solid-state magnetic-field transducers and Ampere’s law,” Am. J. Phys. 56共7兲, 622–627 共1988兲.
3
L. B. Golden, J. R. Klein, and L. Tongson, “An introductory low-cost
magnetic field experiment,” Am. J. Phys. 56共9兲, 846–848 共1988兲.
4
M. Leclerc, “Hall effect probe and Ampere’s law,” Am. J. Phys. 56共10兲,
954–955 共1988兲.
5
J. Priest, “Verifying Ampere’s law,” Am. J. Phys. 58共6兲, 600–601 共1990兲.
6
C. G. Deacon and H. C. Clarke, “Use of a linear offset Hall effect transducer in student laboratory experiments to measure magnetic fields,” Am.
J. Phys. 61共10兲, 947–948 共1993兲.
7
M. R. Molnar and A. J. Martin, “Ideas for a magnetic field experiment,”
Phys. Teach. 37, 443–444 共1999兲.
8
M. Connors, “Measurement and analysis of the field of disk magnets,”
Phys. Teach. 40, 308–311 共2002兲.
9
P. A. Tompkins and G. Pingen, “Real-time experimentation across the
internet,” Phys. Teach. 40, 408–410 共2002兲.
1
Fig. 10. Thrust curve for an Estes C-6 model rocket engine produced by the
National Association of Rocketry 共see Ref. 24兲 reprinted with permission.
810
Am. J. Phys., Vol. 76, No. 9, September 2008
William H. Baird
810
10
The original idea for magnetometer construction first came to the author’s
attention from 具my.execpc.com/~rhoadley/magmeter.htm典.
11
Data
sheet
available
at
具www.allegromicro.com/en/Products/
PartNumbers/1321/1321.pdf典. This project uses the UA package, which
has the approximate dimensions of a standard TO-92 transistor. Surfacemount SOT-23 packages are also available, but would be useless to most
introductory students.
12
Detailed information about the construction process is available at
具www.physics.armstrong.edu/projects/magnetometer典.
13
G.-H. Tang and J.-C. Wang, “Correlation detection of fluorescent lamp
flicker using a sound card,” Am. J. Phys. 73共12兲, 1189–1191 共2005兲.
14
Available for download at 具www.physics.armstrong.edu/faculty/
baird/correl.xls典.
15
Available for download at 具www.physics.armstrong.edu/faculty/
baird/wav.file.correl.xls典.
16
W. H. Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery, Numerical Recipes in Fortran 77: The Art of Scientific Computing 共Cam-
bridge U.P., Cambridge, 1992兲, 2nd ed., Vol. 1, p. 507.
See
the
presentation
at
具www.ccd.cornell.edu/docs/2006/
Power%20Quality%20presentation.ppt典 for more information.
18
M. Brubaker, “Measuring the thrust of a model rocket,” Phys. Teach. 12,
488–491 共1974兲.
19
R. A. Nelson and M. E. Wilson, “Mathematical analysis of a model
rocket trajectory – Part I: The powered phase,” Phys. Teach. 14, 150–161
共1976兲.
20
H. A. Taitt and C. E. Miller, Jr., “Impulse recorder for model rocket
engines,” Phys. Teach. 18, 315–317 共1980兲.
21
R. A. Jenkins, “Measuring model rocket acceleration,” Phys. Teach. 31,
10–15 共1993兲.
22
D. L. Hitt and M. L. Lowe, “Motion analysis of a rocket-propelled truck,”
Phys. Teach. 34, 164–168 共1996兲.
23
T. Araki, “Measurement of simple pendulum motion using flux-gate magnetometer,” Am. J. Phys. 62共6兲, 569–571 共1994兲.
24
See 具www.nar.org/SandT/pdf/Estes/C6.pdf典.
17
Magnetic Model of the Earth. In an 1831 paper the British physicist Peter Barlow considered whether the earth’s
magnetic field might be due to a “transient state of magnetic induction,” i.e., the field produced by suitable arrangements of electric currents. To test out his idea that electric currents were responsible for the magnetic field of the earth,
Barlow constructed a hollow wooden globe 16 inches in diameter on which the wire was wound. The apparatus in the
figure is in the Moosenick Medical and Science Museum at Transylvania University in Lexington, Kentucky. A very
similar one at the Irish National University, Galway was made by Elliot Brothers of London and can be reliably dated
to 1858–1861. The globe is made of plaster, and is about 22 cm in diameter. The small brackets in the corner are
intended to support compass needles to test the direction of the magnetic field produced by the model earth. 共Photograph and Notes by Thomas B. Greenslade, Jr., Kenyon College兲
811
Am. J. Phys., Vol. 76, No. 9, September 2008
William H. Baird
811