We have interfaced PCB393B12 accelerometer with MSP430F5438A board, by using 8-bit ADC.

We receive raw data in 0-255 range with 0v to +2.5v as reference.

How we can obtain corresponding acceleration(g) from ADC raw data?

Note: Our sensor has a sensitivity of 10000mv/g.


2 Answers 2


With 8 bit and U_max of 2.5V you get a voltage resolution of 2.5V/255 = 9.8mV / ADC_step. With 10000mV/g one step of your ADC would result in an acceleration of 0,00098g.

Or, as a formula, you get a = (U_ref/2^N-1 / Sensitivity) * ADC_value = (2.5V/255)/10V/g) * ADC_value = 0,00098g * ADC_value.


The answer from jusaca is correct as far as it goes. Unfortunately, it doesn't go far enough.

A quick look at the datasheet for the PCB model 393B12 acceleration sensor shows that it will be more complicated.

There will be several steps involved. I'm not going to go into details of the steps - each would be enough for a question and answer pair.

  1. Input range

The 393B12 is rated for 10000mV per g, and a maximum acceleration of 0.5 g. Full scale is therefore 5V. This doesn't fit in your ADC range when using a 2.5V reference.

You will have to scale the signal from the sensor down to fit in the ADC input range, then account for the scaling in software.

  1. DC offset

The signal will also have a DC offset that you will have to deal with. It will probably depend on the excitation voltage. You will have to account for that offset while scaling your signal and again in your software.

  1. Positive and negative values

I expect it will give positive and negative acceleration (the datasheet isn't clear on this.) That would double the needed range.

Positive acceleration will be the sum of the DC offset and the acceleration, negative acceleration will be the DC offset minus the voltage from acceleration.

You will have to account for positive and negative in software.

  1. Acceleration

The sensor appears to be more of a vibration detector rather than constant acceleration sensor. As such, it acts like there's a highpass filter in series with the output. You won't see much signal activity if the acceleration changes too slowly. The cutoff is 0.05 Hz.

  1. Sampling rate

The sensor has an upper limit for vibration frequencies. That's at 4000Hz. If you need to use the full bandwidth of the sensor, you will need to sample at over 8000Hz (probably more, but that's the Nyquist minimum.)

In any case, you will need a low pass filter between the sensor and the ADC.

Your ADC may have a built in filter that automatically matches itself to the sampling rate. If it doesn't, you will have to implement the anti-aliasing filter yourself

Parts 1, 2, and 3 fall under "signal conditioning."

4 and 5 fall under "sampling theory."

Once you account for all of that, calculating the acceleration goes pretty much like jusaca said:

  1. ADC value to voltage

  2. Account for scaling (multiply to get the true voltage reading)

  3. Subtract offset (this gives you the correct voltage from which to calculate the acceleration.)

  4. Multiply the voltage by your conversion factor to get g from voltage.

This leaves out all of the fine details like protecting your ADC from overvoltage (the sensor operates on 18 to 30V) and actually figuring out the offsets, and probably a zillion other things.

As I said above, each part is probably large enough to warrant its own question.

Search the site first, though. Each part has been asked and answered multiple times. See if you can puzzle it out yourself before asking a new question.

I've scattered key words all through the text. If you encounter a term you don't know, search for it.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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