Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running my accelerometer through my Arduino mini and outputting my values using the following values

 // print the sensor values:
  Serial.print(analogRead(xpin));
  // print a tab between values:
  Serial.print("\t");
  Serial.print(analogRead(ypin));
  // print a tab between values:
  Serial.print("\t");
  Serial.print(analogRead(zpin));
  Serial.println();
  // delay before next reading:
  delay(100);

Here's an example.

enter image description here

The x,y,z values that are outputted are quite high even the arduino is not moving. I'm new to Arduino programming and would love some understanding on how to convert these x,y,z to an Acceleration value ie. Is the arduino moving or not?

share|improve this question
    
Can you edit the original question and include the model of accelerometer and a link to the datasheet. – KennetRunner Sep 30 at 8:27
    
I've edited. @KennetRunner – Ben Sep 30 at 8:32
    
It is possible that sensor is close to both values. For example, if x is at 9.9 sometimes it can be a bit more, so it will give you 10, while other times it will just give you 9. (this would be the same for y and z) – Foitn Sep 30 at 8:54
1  
Quite high? Those are minuscule values. You have the raw ADC values there. They can range from 0 to 1023. 8 is just 0.78% of the maximum value. That's hardly "quite high" - that's almost non-existent. – Majenko Sep 30 at 12:38
1  
Can you please specify the Model of Accelerometer? Each different model will send data differently and values will have to be interpreted differently. – Mero55 Oct 1 at 15:20

The accelerometer will output a specific number of volts (or millivolts) per g. You need to find that information in the datasheet for your accelerometer.

Then you need to take the readings you make through analogRead() and convert them to a voltage. Then that voltage can be used, combined with the value you found above, to determine the g reading.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.