# Hardware based magnitude for accelerometer

In the past I've taken the magnitude of an accelerometer digitally, using the following equation:

magnitude = sqrt(x^2 + y^2 + z^2)


However, in order to do this I need to sample all three accelerometer planes (x, y, and z) which takes up three channels in my DAQ. This is fine for a single accelerometer, but now that I'm starting to use multiple accelerometer this means I need a lot of channels!

Seeing as I'm just taking the magnitude anyway, I was wondering how I would perform the same calculation in hardware, prior to sampling the planes, so that I only have to sample one channel per accelerometer as opposed to three.

Would someone be able to show me what the circuitry would look like for me to perform this magnitude calculation?

• Put an MCU with analog inputs and let it sample and calculate... Or use a digital accelerometers sitting on an 2-wire I2C bus all together. – Eugene Sh. Sep 15 '16 at 21:53
• Look up the price of an "analog multiplier" IC and weep. Then re-think the idea... – Brian Drummond Sep 15 '16 at 21:54
• Some of the multi axis digital output chips have a built-in motion processor, it is quite likely you could program it to do the magnitude calculation internally. Or an MCU capable of doing so should be cheap, provided the update rate isn't too high. – Chris Stratton Oct 16 '16 at 0:37