Accelerometer in Tilt app. Convert +/- 15 degrees to 0 -> 5 volt ?

Thread Starter


Joined Aug 13, 2009
Hi im using an ST LIS2L02 accelerometer in a tilt application. The supply voltage is 5 volt, and it is used in 2g setup. It outputs the following:

-90 degrees 1,50 volt
0 degrees 2,50 volt
90 degrees 3,50 volt

im my application the output goes to an AVR mcu, where it is convertet via builtin ADC. Since im only interested with the scope +/- 15 degrees

-15 degrees 2,33 volt
0 degrees 2,50 volt
15 degrees 2,66 volt

i would loose alot of precision during convertion. how can i scale the output from the accelerometer so i get the following output result ?

-15 degrees 0,00 volt
0 degrees 2,50 volt
15 degrees 5,00 volt


Joined Jan 11, 2009
Op amp buffers are the common solution. Google should help you out. Be careful not to drive the ADC beyond the supply range of the converter ( if it is similar to the PIC see the spec sheet ) You might also be able to change the reference voltages of the converter ( spec sheet again ) to achieve a similar effect. Most ADCs need a fairly low impecance input, the op amp should provide that the accelerometer may not ( again see the spec sheets )


Joined Feb 4, 2008
Use an instrumentation amplifier with its negative input and its reference pin biased at 2.5V. Connect its positive input to the output of the accelerometer. Adjust the gain to 15.625.


Joined Apr 27, 2009
This can be solved with one Op Amp. (See attached)

If you want to see how I arrived at this circuit read the following article:

So I started with a differential amplifier, as in this article. The result is R2=infinity and R1=anything. R4 is actually 14.152k, so you need to choose a standard value of 14k 1%. Because of that, the output will be a little bit below 5V and a bit more than 0V.

Be sure to choose a dual supply Op Amp, if you want its output to come close to zero.

If you need to have an Op Amp with one supply, choose rail-to-rail or reduce R4.


Last edited: