AM3X Module Reading

Our range of tiny modules are designed to make it easy for you to quickly add functionality to your projects. [Module List]
Post Reply
avrdude
Posts:32
Joined:Mon Sep 30, 2013 3:42 pm
AM3X Module Reading

Post by avrdude » Sun Feb 16, 2014 6:23 am

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

andrew
Freetronics Staff
Freetronics Staff
Posts:978
Joined:Sun Jul 14, 2013 7:06 am
Location:Melbourne, Australia
Contact:

Re: AM3X Module Reading

Post by andrew » Sun Feb 16, 2014 10:55 am

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?

avrdude
Posts:32
Joined:Mon Sep 30, 2013 3:42 pm

Re: AM3X Module Reading

Post by avrdude » Mon Feb 17, 2014 9:07 am

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.

avrdude
Posts:32
Joined:Mon Sep 30, 2013 3:42 pm

Re: AM3X Module Reading

Post by avrdude » Mon Feb 17, 2014 9:27 am

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?

andrew
Freetronics Staff
Freetronics Staff
Posts:978
Joined:Sun Jul 14, 2013 7:06 am
Location:Melbourne, Australia
Contact:

Re: AM3X Module Reading

Post by andrew » Tue Feb 18, 2014 12:09 am

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.

avrdude
Posts:32
Joined:Mon Sep 30, 2013 3:42 pm

Re: AM3X Module Reading

Post by avrdude » Tue Feb 18, 2014 12:20 pm

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.

andrew
Freetronics Staff
Freetronics Staff
Posts:978
Joined:Sun Jul 14, 2013 7:06 am
Location:Melbourne, Australia
Contact:

Re: AM3X Module Reading

Post by andrew » Wed Feb 19, 2014 12:01 am

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

hanlonpp
Posts:1
Joined:Thu Dec 19, 2013 8:49 am

Re: AM3X Module Reading

Post by hanlonpp » Fri Mar 21, 2014 9:32 am

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

avrdude
Posts:32
Joined:Mon Sep 30, 2013 3:42 pm

Re: AM3X Module Reading

Post by avrdude » Fri Apr 04, 2014 5:03 pm

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.

Post Reply