Page 1 of 1

AM3X Module Reading

Posted: Sun Feb 16, 2014 6:23 am
by avrdude
Hi,
I just got my accelerometer module today from Jaycar, and I was wondering whether I should have these readings.
I have used the analogRead() function to get the x, y and z axis readings, then divided by 1023, multiplied by 3.3 (I have used analogReference on 3.3v for easier coding), and subtracted 1.65.
I believe this is what I should be doing but the results are:
X = 0 as expected
Y = 0 also as expected
Z = 0.5 ???
I was under the impression that z should read 1 because it is under the earths gravity of 1g?
However, the weirdest thing is, when I turn the module upside down, z shows -1, as it should.
Could the module be faulty on only half an axis?
Thanks

Re: AM3X Module Reading

Posted: Sun Feb 16, 2014 10:55 am
by andrew
Hello
There is the possibility that you have a DOA unit, however please connect the module to 5V, run the sketch from here:
http://www.freetronics.com/pages/am3x-quickstart-guide
and let me know what values are returned when the module is sitting flat on a desk.
Finally, have you soldered connecting wires to the module?

Re: AM3X Module Reading

Posted: Mon Feb 17, 2014 9:07 am
by avrdude
Running from the arduino 5v (4.74v is this low?) the results from that sketch are:
X = 500
Y = 520
Z = 670
I did some checks, the 3.3v from the module is 3.27v which I guess is acceptable. I tried a smoothing capacitor across the 5v: no difference.
Yes i soldered wires but I've checked the connections and they're all good.

Re: AM3X Module Reading

Posted: Mon Feb 17, 2014 9:27 am
by avrdude
I should mention that those tests were done with 3.3v analog reference.
Is there perhaps a way to recalibrate the module? Or something with the "test" mode?

Re: AM3X Module Reading

Posted: Tue Feb 18, 2014 12:09 am
by andrew
avrdude wrote:Running from the arduino 5v (4.74v is this low?) the results from that sketch are:
X = 500
Y = 520
Z = 670
I did some checks, the 3.3v from the module is 3.27v which I guess is acceptable. I tried a smoothing capacitor across the 5v: no difference.
Yes i soldered wires but I've checked the connections and they're all good.
Considering the tolerance of the sensor at 3.3V, it's a touch low for the Z-axis - but not that much.
http://cache.freescale.com/files/sensor ... 7361LC.pdf
See page 3 - table 2. When running at 3.3V, the Z-axis output for zero G can vary between 1.32 and 1.815V. Then add 1 G for gravity which can vary between 740~860mV.

If possible, measure the 3.3V output pin with a meter to ensure it's accurate, double-check that the module is flat on a flat desk (!) and measure the Z-axis output voltage. If it is less than 2.06V or greater than 2.675V it's out of spec. Let me know how you get on.

Re: AM3X Module Reading

Posted: Tue Feb 18, 2014 12:20 pm
by avrdude
Hi,
Like i said before, the 3.3v output of the module is 3.27v, so all's good there. The output voltage for the z axis is 2.2v so that's within the acceptable range right?
I'm going to develope a auto calibration bit of code so the scaling factor (0.8v/g) is calibrated to each axis. This way, I'll always have good accuracy.
Anyway, just wanted to make sure my module was not malfunctioning.
Thanks for all the help John.

Re: AM3X Module Reading

Posted: Wed Feb 19, 2014 12:01 am
by andrew
avrdude wrote:Hi,
The output voltage for the z axis is 2.2v so that's within the acceptable range right?
Thanks for all the help John.
Yes, it's fine :)
have fun
John

Re: AM3X Module Reading

Posted: Fri Mar 21, 2014 9:32 am
by hanlonpp
I am enthused by the AM3X and (Arduino Freeduino etc), but can't quite get myself on an even keel with my analog readings. I have seen mention in the forum of sensitivity being 800 mV/g (or 206 in 6g mode), and another mention of a range 740-860, and further complexity like differential precision across axes.

I did a test with average readings XYZ 419 665 629 AREF=3.3 and inferred accelerations of -0.37 0.62 and 0.68, AM3X in a random still orientation. This gives a resultant magnitude acceleration of 0.86 using square root of the sum of the components squared, which seems I should be adjusting 'my' precision downwards by 14%. I suppose I could experiment with the individual axes, but it would reduce the attractiveness of the whole project.

Any other calibration attempts?

Pete

Re: AM3X Module Reading

Posted: Fri Apr 04, 2014 5:03 pm
by avrdude
I think this library:
https://code.google.com/p/mma7361-library/
It has some trick to calibrate the readings, the result is perfect 0s at level ground.
However, despite it working, there's still no explanation as to how one actually would go about calibrating it. I guess you could dig through the .cpp file and see if its there.