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?

Thanks in advance.

  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – Eugene Sh. Sep 15 '16 at 21:53
  • 5
    \$\begingroup\$ Look up the price of an "analog multiplier" IC and weep. Then re-think the idea... \$\endgroup\$ – Brian Drummond Sep 15 '16 at 21:54
  • \$\begingroup\$ 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. \$\endgroup\$ – Chris Stratton Oct 16 '16 at 0:37

This is a classic problem, and has a classic answer.


simulate this circuit – Schematic created using CircuitLab

While straightforward, it is marked by considerable inaccuracies if you try for a wide dynamic range. 1% accuracy is pretty much standard. Such multipliers are still available, such as theAnalog Devices AD532.

  • 1
    \$\begingroup\$ That AD532 from digikey is an 'eye watering' price! \$\endgroup\$ – gbulmer Sep 16 '16 at 4:37
  • \$\begingroup\$ @gbulmer - They used to be a good deal cheaper, but with declining usage the price has gone up. \$\endgroup\$ – WhatRoughBeast Sep 16 '16 at 13:23
  • \$\begingroup\$ It seems doubtful in this day and age than precision analog computational circuitry would be advantageous over an MCU-based digital solution. \$\endgroup\$ – Chris Stratton Oct 16 '16 at 0:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.