I am a little confused about the specs given about the accelerometer and the conversion to g force.
I am using the 3vo from the accelerometer to the Aref pin on the arduino.
Theoretically a reading from the analog pin of 512 will be zero.
a reading of 0 is -3g minimum, and 1023 would be +3 g minimum.
On the data sheet, the spec's say +/- 3g MINIMUM, +/- 3.6g typical.
By tilting the accelerometer fully left, right forward, and back, I get readings of 400 to 612 on the X/Y axis.
That tells me the "zero" is read at 506, and 1g of static acceleration is +/- 106 from zero.
Does this mean:
+/- 2g = 212 from zero = +718 / -294
+/- 3g = 318 from zero = +824 / -188
+/- 4g = 424 from zero = +930 / -82
for a total scale of roughly +/- 4.8g? (512 / 106)
At 3.0v output sensitivity is 300mV/g.
At 3.3v, the output sensitivity is 330mV/g.
At 3.6v sensitivity is 360mV/g.
1.65v is "zero", .33v steps/unit of g, 1.65/.33 = 5
This is also showing me the maximum reading would be around 5g.
I am not looking for an exact reading, but something close to real values.
Thank you for helping me out - JD3
ADXL335 conversion questions
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: ADXL335 conversion questions
Those calculations look about right.
- arctic_eddie
- Posts: 233
- Joined: Tue Feb 28, 2012 6:01 pm
Re: ADXL335 conversion questions
I had a similar problem with an ADXL345 board. That board has an I2C I/O instead of voltage outputs. However, the problem is similar. That board has ideally a zero value output for no gravity on an axis and +/- 256 for 1G on any axis. The sensors in the chip don't behave exactly in that fashion. The spec sheet shows that the zero value and counts per G have a tolerance, as you found. The solution is to position the board at each of the six extremes, +/-X, Y, and Z and record the sensor output values. From that data, you can calculate an offset and a gain value for each axis. Use these values in your sketch to correct the sensor readings to the desired ideals.
On my board, the Z offset was 33 and the other two less than 5. The gains/scaling factors were within 2% of the ideal value of 1.00.
On my board, the Z offset was 33 and the other two less than 5. The gains/scaling factors were within 2% of the ideal value of 1.00.
-
- Posts: 1
- Joined: Tue Aug 13, 2013 4:54 am
Re: ADXL335 conversion questions
I get more basic questions about the conversion?
a. how to calculate the raw data counts into G of each axis?
b. after measured the 6 extreme x-y-z data, how to use this info for offset compensate?
a. how to calculate the raw data counts into G of each axis?
b. after measured the 6 extreme x-y-z data, how to use this info for offset compensate?
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: ADXL335 conversion questions
http://learn.adafruit.com/adafruit-anal ... rogramminga. how to calculate the raw data counts into G of each axis?
b. after measured the 6 extreme x-y-z data, how to use this info for offset compensate?
Code: Select all
// Convert raw values to 'milli-Gs"
long xScaled = map(xRaw, xRawMin, xRawMax, -1000, 1000);
long yScaled = map(yRaw, yRawMin, yRawMax, -1000, 1000);
long zScaled = map(zRaw, zRawMin, zRawMax, -1000, 1000);
// re-scale to fractional Gs
float xAccel = xScaled / 1000.0;
float yAccel = yScaled / 1000.0;
float zAccel = zScaled / 1000.0;
Serial.print(" :: ");
Serial.print(xAccel);
Serial.print("G, ");
Serial.print(yAccel);
Serial.print("G, ");
Serial.print(zAccel);
Serial.println("G");
- immersion
- Posts: 5
- Joined: Wed Aug 21, 2013 2:33 pm
Re: ADXL335 conversion questions
Hi Bill, I have very similar problem:
My conversion table below is when tilting the cube every 90 degree:
+1g = 1.935 Volts
0g = 1.625 Volts
-1g = 1.301 Volts
So every 0.310V counts for 1g, but when I measure acceleration of a device that normally generates 1.7g, it only measures 0.140V(0.45g)! I have 20 boards of ADXL335 and all measure the same way, why???
I must say I'm powering it up using a USB and measuring X Y Z using my scope. Please advise.
Thanks.
Raz.
My conversion table below is when tilting the cube every 90 degree:
+1g = 1.935 Volts
0g = 1.625 Volts
-1g = 1.301 Volts
So every 0.310V counts for 1g, but when I measure acceleration of a device that normally generates 1.7g, it only measures 0.140V(0.45g)! I have 20 boards of ADXL335 and all measure the same way, why???
I must say I'm powering it up using a USB and measuring X Y Z using my scope. Please advise.
Thanks.
Raz.
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: ADXL335 conversion questions
Is the breakout board firmly mounted to the device under test?when I measure acceleration of a device that normally generates 1.7g, it only measures 0.140V(0.45g)
If you have a reference accelerometer that you used to measure the 1.7g, you might compare its outputs from the same calibration procedure.
- immersion
- Posts: 5
- Joined: Wed Aug 21, 2013 2:33 pm
Re: ADXL335 conversion questions
My other accelerator has the same characteristics i.e. same conversion table.
The fixture is the same and it weights 100grams standard, only accelerometers are being replaced.
We have also other range of accelerometers which measure the same way around 1.7g give or take. What's the sensitivity of your accelerometer?
I just bought 20 of these accelerometers Bill, if they all perform the same way then they'll be useless to us. We measure acceleration on daily bases and we need them to reflect or get at least close to real acceleration when measuring.
Let me know if we're missing anything with conversion table and/or method. If you like, I can send you different acceleration traces for comparison.
Thanks.
The fixture is the same and it weights 100grams standard, only accelerometers are being replaced.
We have also other range of accelerometers which measure the same way around 1.7g give or take. What's the sensitivity of your accelerometer?
I just bought 20 of these accelerometers Bill, if they all perform the same way then they'll be useless to us. We measure acceleration on daily bases and we need them to reflect or get at least close to real acceleration when measuring.
Let me know if we're missing anything with conversion table and/or method. If you like, I can send you different acceleration traces for comparison.
Thanks.
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: ADXL335 conversion questions
The range is specified as >+/- 3G. There will always be manufacturing variances and that is the purpose of the calibration. What other accelerometers are you testing against. Have you calibrated them?
- immersion
- Posts: 5
- Joined: Wed Aug 21, 2013 2:33 pm
Re: ADXL335 conversion questions
Is there any other way you can propose for me to calibrate them beside turning the accelerometer in different access and measuring the out put analog voltage with respect to gravity?
I must say I have a precision setup that makes sure the accelerometer is in perfect 0, 90 and 180 degree angle with respect to flat surface. Let me know.
Besides the voltage I measure is way off target from what it supposed to measure. We're talking %70 off...
Bill, we've decided to return these accelerometers, please provide me RMA info through my email address I've listed when registered or through this blog(whichever more preferred.
Thanks.
Raz.
I must say I have a precision setup that makes sure the accelerometer is in perfect 0, 90 and 180 degree angle with respect to flat surface. Let me know.
Besides the voltage I measure is way off target from what it supposed to measure. We're talking %70 off...
Bill, we've decided to return these accelerometers, please provide me RMA info through my email address I've listed when registered or through this blog(whichever more preferred.
Thanks.
Raz.
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: ADXL335 conversion questions
That is the way accelerometers are calibrated:
The simple method assumes that the sensor is reasonably well aligned in the assembly.
http://www.rocklandscientific.com/LinkC ... 68&mid=455
This method allows you to factor out assembly alignment issues.
http://cache.freescale.com/files/sensor ... AN4399.pdf
The specified range for these is +/3 3G minimum - 3.6G typical. There is no maximum range specified: http://www.analog.com/static/imported-f ... DXL335.pdf
The simple method assumes that the sensor is reasonably well aligned in the assembly.
http://www.rocklandscientific.com/LinkC ... 68&mid=455
This method allows you to factor out assembly alignment issues.
http://cache.freescale.com/files/sensor ... AN4399.pdf
70% off from what? How did you calibrate the units you are comparing against?We're talking %70 off...
The specified range for these is +/3 3G minimum - 3.6G typical. There is no maximum range specified: http://www.analog.com/static/imported-f ... DXL335.pdf
- immersion
- Posts: 5
- Joined: Wed Aug 21, 2013 2:33 pm
Re: ADXL335 conversion questions
I appreciate your respond and I'm well aware of calibration practices and calculation. We've been measuring vibration and haptic feedback in our company for many years. Two main points:
Calibration: As I mentioned before, I was using 3-point calibration system to define the limits of your accelerometer XYZ analog outputs based on gravity, and I gave you the conversion table of your accelerometer with respect to horizontal alignment . Based on that table, the output voltage variance should translate to 310mV per one gee.
Measurement: Again, my test setup has accelerometer sitting inside the 100 gram mass at exactly same location as any other accelerometer we use. Also I've 3 different motors with their specs here.
When a motor spec states that it should generate around 2 gees using 3V drive signal on a 100 gram mass and your accelerometer is measuring only 0.5 gees while all our other accelerometers are measuring around 1.8 to 2.1 gees, it's pretty clear that your accelerometer measurement is around %70 off from what it supposed to measure. If the measurement was relatively close, I wouldn't have bothered at all.
Question: according to your pdf file, Vin supposed to be max 3.6V, but as per your assembly instructions(even Silk screen behind the board) it can also work up to 5V, which one is the correct voltage for Vin?
Calibration: As I mentioned before, I was using 3-point calibration system to define the limits of your accelerometer XYZ analog outputs based on gravity, and I gave you the conversion table of your accelerometer with respect to horizontal alignment . Based on that table, the output voltage variance should translate to 310mV per one gee.
Measurement: Again, my test setup has accelerometer sitting inside the 100 gram mass at exactly same location as any other accelerometer we use. Also I've 3 different motors with their specs here.
When a motor spec states that it should generate around 2 gees using 3V drive signal on a 100 gram mass and your accelerometer is measuring only 0.5 gees while all our other accelerometers are measuring around 1.8 to 2.1 gees, it's pretty clear that your accelerometer measurement is around %70 off from what it supposed to measure. If the measurement was relatively close, I wouldn't have bothered at all.
Question: according to your pdf file, Vin supposed to be max 3.6V, but as per your assembly instructions(even Silk screen behind the board) it can also work up to 5V, which one is the correct voltage for Vin?
- Franklin97355
- Posts: 23910
- Joined: Mon Apr 21, 2008 2:33 pm
Re: ADXL335 conversion questions
Vin of the breakout board is 3 to 5 (I would think 3.3 to 5 but I don't know the low end value) The board has regulation.Question: according to your pdf file, Vin supposed to be max 3.6V, but as per your assembly instructions(even Silk screen behind the board) it can also work up to 5V, which one is the correct voltage for Vin?
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: ADXL335 conversion questions
If consistency with your existing sensors is the goal then you should calibrate against your existing sensors instead of gravity.
Please be positive and constructive with your questions and comments.