Electronic – How to condition the signal from an accelerometer for a microphone input

accelerometermicrophone

I'm looking to measure vibrations using a 3-axis analogue accelerometer connected the the microphone input on a PC. Ideally I want to combine the 3 axis into one signal as I don't really care about the x,y and z components, just the amplitude and the frequencies of the vibration.

I was looking at the Freescale MMA7361L, but I imagine anything similar will suffice.

I did an Electronics degree, but after many years of only using the digital, embedded and software side, my analogue knowledge is pretty rusty.

  • Can I combine the signals using appropriately selected capacitors or should I buffer them first?
  • I'm guess I'm going to have to do some level adjustment and impedance matching for the signal to be suitable for a microphone input?
  • Can I use a simple passive filter to remove frequencies over 20kHz? Do I need to do this?
  • What other considerations are there if I want to sample signals between 20Hz and 20kHz?

Best Answer

The only way I can think of doing that is to modulate the three signals using three different, audio-frequency carriers, probably using AM (since it's the easiest and cheapest to implement). You'll probably be able to find an IC that just does AM modulation, but I don't know any off the top of my head.

Essentially, you'll be taking each signal and multiplying it by a different carrier frequency, which will produce a carrier frequency that varies in amplitude as the accelerometer's signal changes. Since it's going to be a low-noise signal, you can demodulate it using a bandpass filter (to select from the three signals you want) and then use a peak detector to find the average value of the signal.

You'll do this for each signal simultaneously.

For example:

Let's say you assign the X-axis to 1 kHz, the Y-axis to 10 kHz and the z-Axis to 20 kHz. You'll start by multiplying the X-axis output with a 1 kHz signal, the Y-axis output with a 10 kHz signal, and the Z-axis output with a 20 kHz signal. You'll then combine these signals using an Op-Amp Adder (make sure to use an op-amp with a high enough bandwidth!). This will produce a single signal that overlays the three signals on top of each other. If you looked at the spectrum analysis of the output, you'd see three spikes -- one at each frequency. The height of each peak would be the value of each associated axis.

Extracting the signal

Once it's in the computer, you'll have to use DSP techniques to bandpass each frequency, and detect its average amplitude (after throwing away negative data, otherwise the average amplitude will be 0!)

Pitfalls

  • You'll need to pre-filter the accelerometer's data with a low-pass filter to ensure high-frequency content is removed. If you don't, you'll get a lot of cross-talk between the channels
  • Writing the DSP software on the computer is not a trivial process, and there aren't any off-the-shelf programs I know that can do it. You can script it out in MATLAB or Mathematica fairly easily, but it's going to be time-consuming to develop.
  • Since your signals will be bandpassed, they won't react well to sudden changes in acceleration (which generate high-frequency content).

This is a terrible idea. Instead, do this:

I'm answering the question under the constraints you provided, however, I wouldn't ever actually implement a system like this, as every computer in the world has a USB port. Buy an accelerometer that has an i2C/SPI interface, and slap a USB-equipped microcontroller on it. Set it up as an HID device and you don't even need to worry about drivers.

Done.