Go Down

Topic: Accelerometer ADXL335 output meaning problem (Read 444 times) previous topic - next topic

uzzulsub

Dear there,
I am using ADXL335 for acceleration. I took the code from the https://www.electronicwings.com/arduino/adxl335-accelerometer-interfacing-with-arduino-uno.
 
The output shows x=343, y=339, z=312.
What are those values? How can I calculate acceleration as m/s2 from those value?

Thanks for your time.

jremington

#1
Apr 23, 2019, 05:23 am Last Edit: Apr 23, 2019, 05:27 am by jremington
Have you looked at the ADXL335 data sheet, where the output is explained?

You might also take a look at the code you downloaded, which has some interesting lines in it, like this one:
Code: [Select]
x_g_value = ( ( ( (double)(x_adc_value * 5)/1024) - 1.65 ) / 0.330 ); /* Acceleration in x-direction in g units */

uzzulsub

I do not understand from those code. I think their code is okay. I just I want to know if I want to get acceleration value m/s2 what should I do.

jremington

#3
Apr 24, 2019, 04:13 am Last Edit: Apr 24, 2019, 04:13 am by jremington
Hint: 1 "g" = 9.8 m/s2

Additional hint: if the code gives you "g" values, the first hint suggests that you multiply those by 9.8.

MarkT

I do not understand from those code. I think their code is okay. I just I want to know if I want to get acceleration value m/s2 what should I do.
Perhaps:
Code: [Select]
  float x_accel = 9.8 * x_g_value ; // similar for y and z...
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up