I am working on Arduino mega 2560 (Mega ADK) for my project... and am trying to interface it by ADXL335.
I am getting reading i guess they are in mV...i really want to understand how can i convert them into G's.
For the time being i used the sample code which exists in the arduino software itself...and am going to develop it later to use it in my system.
Thank you in advance for you assistance....and any further information regarding this accelerometer, difficulties you guys faced and things i should take into consideration when am dealing with it....
I would really appreciate if anyone of you provide me with any further information regarding ADXL335
Why guess?
Your code should tell you (it doesn't tell us anything, because we can't see it)
Somewhere in the accelerometer's datasheet will be a sensitivity figure, giving the number of counts or mV per g.
That will tell you how to convert mV to ms-2
OK, so the readings are not in mV, they're raw readings.
If you want mV, they you need to multiply the raw readings by 5.0 / 1023.0.
Once you've got that fixed, then you need to plug in the sensitivity value from the datasheet.
There'll also be an offset to be applied, because the accelerations will be +/-, but the accelerometer will only give positive voltages.
Regarding the sensitivity values which one should i use (max=330 , min=270 , typical=300) ?
Providing that am using 3.3v to power the accelerometer and the arduino board is powered by I2C cable.
and the offset will be solved by subtracting the zero bias voltage from the voltage i will get in mV , am i right ?
unfortunately am getting random numbers for all axises (ranging from 197 till 479 )
Double check your connections (do your pins match the pins you're reading?) and ensure you've got a solid ground connection between your Arduino and your accelerometer.
Any strong sources of interference nearby?