A make-shift data acquisition system

Recently, I was in urgent need for a data logger with a relatively fast sampling rate of at least 10Khz. As usually the need appeared late on Friday and system had to be functional over the weekend so ordering something was not an option.

The signal needing measurement was a short dip of a few hundred millivolts on a 3V line, that repeated periodically. If I  could discern its relative amplitude and timing and could store many days worth of that I would be all set. I started poking around what was in front of me. An audio input on my laptop was the first candidate, seeing how it has plenty of resolution and fairly high sampling rates. I divided the signal down and fed it in, then used Audacity recording software to create a “log” at various bit rates:

Simple divider fed into the microphone input

Simple divider fed into the microphone input

Mic input recorded at 8ksps

Mic input recorded at 8ksps

Mic input sampled at 16ksps

Mic input sampled at 16ksps

And for the good measure at 44ksps:Mic input at 44ksps

That worked out pretty well and I was able to zoom in and measure timing down to 100uS. Next challenge was to expand the system to handle more than one channel, ideally at least 8. I also had to minimize parasitic load on the system I was measuring and make sure the output impedance of the circuit is low enough not to be loaded by the audio input.

Meet the big guns-  Motu 828mk3 audio interface, normally used for audio recording. With 10 line inputs, 16 or 24 bit resolution  and sampling rates of 44 to 192ksps on all channels simultaneously, it sounded like a good choice. And it was readily available:

OLYMPUS DIGITAL CAMERA

MOTU audio interface

Now I just needed something to condition the signals with proper input and output characteristics so that it looks like the 1V RMS audio signal (Or at least the positive half of that). Being a weekend, my source of parts was essentially RadioShack with their “vast” selection. To their credit they did have TI’s LM324s in stock.

Umm, is that an ESD protected  package?!

Umm, is that an ESD protected package?!

Handy pinout on the back

After a bit of tinkering, the plan emerged- we’ll simply feed the signal into inverting opamp with a small gain, while shifting it so that only the window of interest is looked at. The audio input is AC coupled already, so there is no need to do it twice and affect frequency response any more than we have to.

Single channel conditioning

Single channel conditioning

There were the whole 2 bags of LM324s in stock and I did not feel like driving around looking for more, so  I set out to build an eight channel “data logger” .

Next time I'll spin a board instead. The module with LED is my LM317 voltage regulator board, set to 5V

Lots of point to point wiring.  The module with LED is my LM317 voltage regulator board, set to 5V.The potentiometer in the middle sets the “bottom” of the sampling window.

The board worked pretty well and produced the signals that kept the audio box happy.

Input and output channels. Input is AC coupled on the scope for convenience

Input and output channels. Input is AC coupled on the scope for convenience

As an added bonus since the pulse frequency was sub 10Hz, I could visually see them on the VAU meter of the MOTU box:

MOTU 828mk3 aka DAQ

MOTU 828mk3 aka DAQ

With the hardware in place, I needed something to actually record the “log”. Audacity proved to be only capable of working with two channels at a time, and I needed more. Enter Reaper, an audio recording program that can perform multichannel recording. I only needed a week or so of logging, so their evaluation version fit the bill perfectly. Being a relatively high end audio box, Motu’s lowest sampling rate is 44ksps, so recording to compressed files quickly became critical, as i was generating gigabytes of data an hour when first using regular wave format. Once properly setup, and configured to record in compressed Ogg Vorbis files instead, I started getting reasonably sized daily “logs”.that could then be opened in Audacity as audio files and analyzed as needed.

Several channels can be opened and analysed at once in Audacity, once recorded by the Reaper

Several channels can be opened and analysed at once in Audacity, once recorded by the Reaper

Conclusion:

in this particular application, where detailed waveform and timing were more important than accurate amplitude measurements, the audio interface approach proved to be a pretty handy tool.

 

One thought on “A make-shift data acquisition system

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.