I am having problems trying to convert the ADC value that the Arduino Uno reads from the x, y, and z outputs from the MMA7361 Triple Axis Accelerometer to Gs. I don’t really understand what these output readings (ADC values) mean and why they are in that particular scale.
I put the photos of the circuit setup I have. I followed the suggested layout from the data sheet, and I am positive my setup is right. Anyway, the link to the datasheet is this:
Also, I put a picture of the serial monitor readings. The readings correspond to the Accelerometer when it is lying flat on a surface and it’s stationary. By the way, the g-Select setting is at 1.5g.
(Btw in this picture the g-range is set at 6g – the second pin from top to bottom is connected to power)
(Note that the g-Select pin is now disconnected – 1.5g range is enabled.)
(Analog outputs for x, y, and z pins)
Also, here's the code I am using:
int valX = 0;
int valY = 0;
int valZ = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
valX = analogRead(A2);
valY = analogRead(A1);
valZ = analogRead(A0);
Serial.print("X=");
Serial.print(valX);
Serial.print("\t");
Serial.print(" Y=");
Serial.print(valY);
Serial.print("\t");
Serial.print(" Z=");
Serial.print(valZ);
Serial.print("\n");
delay(500);
}
At the position shown in the picture I took, the data sheet of the accelerometer indicates that the output pins of the accelerometer should have the following voltage readings.
Xout @ 0g = 1.65 V
Yout @ 0g = 1.65 V
Zout @ + 1g = 2.45 V
(This info is on page 6 in the data sheet for the top side view)
When I measured the outputs with a multimeter, I get the following results:
(Again, the g-Select setting is at 1.5g)
1.655 V for Xout
1.738 V for Yout
2.139 V for Zout
I thought this information might help, but I can’t really figure out or think of a way to take all this information and convert it to Gs.
I would really appreciate some help.
Thanks in advance.