Audio board use for magnetometer


New member
I am working with a local professor to make an opensource proton precession magnetometer and will try to use the audio board.

A proton precession magnetometer is a small NMR. It is used to measure the earths magnetic field. A magnetic field polarizes the spin of protons in water and when it relaxes the proton spin is measured by a coil. The signal is in the micrvolt range. We have a functioning amplifier and filter.

I tried using some SPI ADCs for digitzing and lost patience. I then realized that 44kz/16 bit was way more than the minimum frequency/data depth needed so "take the easy road" and use existing proven existing hardware and software.

I will post code and updates later. Comments welcome favourable and otherwise.

tom schmitt
Atlanta, Georgia
Keep in mind that the A/D's used in all audio devices are not suitable for generalized digitization of data for measuring anything. You should be using Successive Approximation A/D's for all your instrumentation work.
I am sure Mark T. will chime in with more details anytime soon.

Thank you very much! This is very much a stop gap measure. I am operating with a "optimize later" philosophy.

I agree with you re that the eventual digitization should be with a dedicated chip. I have quite a few ADS8866s around. They are 16 bit SARs with 100ksps max. We anticipate 2 seconds of data sampled at 10 to 15kHz. We are using a Teensey 4.1 with extra memory so 30kBytes will not tax it band and we have the memory to try higher data rates and longer sampling intervals.

The signals we will be measuring are audio. This is a geological tool to measure the strength of the local magnetic field. Here in Georgia the proton precesion frequency is around 2kHz. It is the accuracy of the frequency measurement not the amplitude that is critical.

When we move on to a better ADC chip the Audio board will become a toy. A very nice toy.

Perhaps I will work with the ADS8866 tomorrow. I had been using the Teensey 3.6. I I could not get a SCLK signal. I am sure it was user error. With the 4.1 I can reassign SCLK to one of the other SCLK pins. Taht will avoid the problem rather than solve it but I suspect that will work.

More later

In my personal experience, I have used audio interfaces very successfully as data acquisition devices. The key is to be aware of the limitations:

* Your signals must be AC...most audio interfaces are not DC coupled

* Audio interfaces aren't calibrated, so you don't know the absolute amplitude of your signal (in volts or whatever). You can easily calibrate it yourself, but the audio interface isn't really designed to be super stable over time. At any given moment in time, however, the relative amplitude values (ie, linearity) is usually excellent.

* your signal's frequency content must fit within the passband of the audio interface

* Your measurements can accept the non ideal phase response towards either end of the passband

There are many situations where these limitations are ok. If all you're doing is watching the frequency of a signal change, audio interfaces are great. Or, if you're measuring a modulation of an audio-like signal, that's another good application for an audio interface. They're also naturally good at signals that are sorta like sound, like seismic signals recorded by geophones. Great fun!

Yes, most audio interfaces use sigma-delta A/D, which is different than successive approximation. But again, if you can fit within the passband associated with the sigma-delta decimation filter (and its phase response as you get close to Nyquist), I've have no problem with sigma-delta in actual practice. In fact, their natural ability to do their own anti-aliasing (up to their MHz-class 1-bit sample rate) results in a much smoother antialias performance than many people's home-brewed analog filters required in front of old-style SAR A/D (not that anyone really home-brews them anymore). In short, I like sigma-delta.

So, yeah, if you can fit within the limitations, give it a try. Have fun! Learn cool things!


As an aside: while I think that the Teensy Audio board is amazing for the money, its performance is modest (ex: relatively high noise, limited sample rate). There are other Teensy compatible audio interfaces out there that perform better. Shameless plug: see the open source hardware from Tympan, which I'm part of. It offers better audio performance, but at a higher price.

As another aside: be aware that the Teensy audio library is written using fixed point processing, which provides maximum computational efficiency with older Teensies. All the newer Teensies natively support floating point operations, so the exclusive use of fixed point operations is not needed. Floating point processing (as in Matlab or Numpy) is much easier for new people to understand and modify. If you're going to write custom audio processing blocks, you'll want to consider simplifying your life and using floats. Shameless plug: Tympan also offers an open source floating point library for Teensy.
Last edited:

Thanks for the info. Conviniently, in this application, processing of the data is post collection. I think that will help. These signals are "tame" audio of realtively constatn magnitude. Frequency varies over a known relatively tight range (1 to 4 kHz). Thus it meets the criteria you mentioned

Seismic is tempting . Seismic monitors are now solid state! When I started we used paper recording and clunkey but quite beautiful sensors. . The audio board might be fun for that but the "serious" seismic stuff is 24 or 32 bit. One could cheat and take "stero" data - one channel with modest amplification and one with high magnification, Anyway we have a magnetometer to fix, a gravimiter to fix and the dragon after taht is seismic.

One ot he professors wants to do the data analysis with Maxum Entropy techniques. The Teensy 4,1 is nearly uniqe in its capabilities for that. With the added memory (PSRM) one can be sloppy with the code. The 600 MHz makes it possible to do the calculatios and the IDE makes it easy for students. Thanks Paul!

more later time to work

I apologize for the appearance of being nit-picky. I come from an Aerospace background were our measuring circuitry had to be at least 1000 times better (in every way) than that which we were measuring. My best friend and mentor Paul designed the electronics package on the Voyagers which are still working after 40 some odd years, with a designed lifetime of 7 years. This is an example of why in my world all these small details were so important to us.
Another good friend and colleague designed and built his own backyard Seismometer which worked very well, if I remember correctly he used lasers to measure the movement of the pendulum hanging in the hole he dug.
I remember from my time in grade school going to the Museum of Natural History and seeing the Seismometer embedded in the hill which was part of the Museum, it was a gigantic arm sunk in concrete horizontally in the hill hooked up to a moving paper graph.
Ah memories.....

Go ahead and be picky. I appreciate it. I used to work at the Nucular Regulatory Commision on seismic saftey of reactors. . Now that was pickey.

I like the seismometer with laser sensors. That is a class act!

I do not know how the more sesitive seismic networks work now. The field units are spectacular. The seismology group at Georgia Tech was a few dozen seismometers that have solid state accelerometers. They are about the size of a salt box. I believe they are 32 bit but I may be wrong. One burrys them in a hole made with a post hole digger and comes back in a few months to replace the SD card. They use Machine learning to read the seismic signals. They can mobalize a team and be monitoring quakes with a dense array in the morning and finish by dinner..

The magnetometer is to be a teaching tool. My friend and collegue Mengis Teklay is a professor at a "perimeter" college opf Georgia State University. He is dedicated to gettinng students in the field using techniques to learn to "see" abstractly (Geophysics). We want it open source and cheap! So far the only thing close to expensive in it is the Teensey. Second is a fourth order activeband pass filter designed using Analog Devices Software. The filtr is pretty solid. I will re desgn it this week end and eventually have one after the pre amp, followed by a second amp and filter pair and the ADC.

The pre amp uses dumb OP AMPs. I intend to change to sliglty less dumb OP Amps that has a +/- 40 Volt above/below the rails input range. Even a grad student will struggle to damage thast one.

By the way It sort of works now. I use a digital scope for digatizing. That is less than ideal.

More later

go ahead and be pickey