Go Down

Topic: How to change voltage to angle (Read 1 time) previous topic - next topic

svot3

Mar 08, 2015, 07:16 am Last Edit: Mar 08, 2015, 07:18 am by svot3
I want to use the Arduino Leonardo and ADXL335 to measure the model angle, now I get the acceleration, so how can I change the acceleration to angle.

Peter_n

Is the code calibrating it ?
Can you calibrate it for 1G ?

The static value of an accelerometer measures the earth gravity. Some code calibrate that away, if only the acceleration is of interest.

You should measure 1G, and if you turn it upside down, you should measure -1G.
Note to myself: Fastest way to toggle pin 13 on a Arduino Uno after setMode(13,OUTPUT); is PINB=bit(PORTB5);

svot3

Yes, the key is how to convert it to the angle of model.

Peter_n

They are often with "pitch" and "roll" and almost always with a filter.
Do you want to know the tilt angle in two dimensions ? the x-angle and y-angle ?
It is the atan of the value.

I searched for something simple, and found this : https://www.electronicsblog.net/simple-angle-meter-using-adxl335-accelerometer-arduino/
I think that is a good start.

This also explains it well : http://www.hobbytronics.co.uk/accelerometer-info

To get some serious angle data, the accelerometer should be combined with a gyro and a filter, like the Kalman filter. Ready to get serious ? this is the Kalman Guide : http://forum.arduino.cc/index.php?topic=58048.0
Note to myself: Fastest way to toggle pin 13 on a Arduino Uno after setMode(13,OUTPUT); is PINB=bit(PORTB5);

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy