ADXL337 works a gyroscope sensor instead of accelerometer

Hi

I bought ADXL337 chip from ebay and soldered it to my PCB
It works, but for some reason it works as a gyroscope sensor. I thought it should be an accelerometer.
It wouldn't be such a surprise for me if it would be some random numbers - but the result is nice and repeatable - its is a gyroscope.

Number on the chip is Y3U 3444, but I can't find anything by this number in the internet

Any ideas what am I doing wrong?

here you can see the video https://photos.app.goo.gl/5TxSz9GzNPHLedzN7
I use this pinout - https://www.analog.com/media/en/technical-documentation/data-sheets/ADXL337.pdf

Thanks,

It is acting like a tilt sensor using the 3 accel axis to measure tilt with reference to earth's gravity vector. Works in roll and pitch, but not yaw.

Ideally a rate gyro output is proportional to rotation rate (motion). A rate gyro, at rest, will output zero regardless of the orientation.

Post the code that you have uploaded to get that result.

Thank you for your replay

Yes, exactly It works as a tilt sensor.

The code is fairly simple

I'm reading values from A0, A1 and sending the values to Serial

:::::::::Code::::::::::::::::::::::
// read the values from the sensor:

int y = analogRead(A0);
int z = analogRead(A1);

delay(100);

Serial.println(String(String(y, DEC) + ";" + String(String(z, DEC))));
:::::::::End of the code::::::::::

Where A0 A1 are connected to Xout Yout of the sensor.

And I expected to get an acceleration, instead of tilt. Because ADXL337 is Accelerometer.

I just suspect that maybe the vendor has sent me some wrong chip and it's not really ADXL337
That code on the chip reds Y3U 3444, and I can not find anything in the internet for this code.

I also did not add to my PCB the capacitors that are suppose to be near X/Y/Z outs. But they are only for noise reduction as far as I understand, and can not change the behaviour of the chip so drastically.

Thanks,

But it is acting like an accelerometer. Take an ideal 3-axis accel. Set it on a level surface. X and Y will read 0g. Z will read 1g. Tilt the accel 90° about the X axis. The X and Z will read 0, Y will read 1g. The same for a rotation about the Y axis. Y and Z reads 0g and X reads 1g. A bit of math and you can measure any tilt of the accel referenced to gravity. The program on the PC is doing the math for the display. What is that program?

Google "accel measure tilt" for many explanations.

Hmm, but if the pin gives an acceleration, then it should get back to 0 when I stop moving it. In my case when I tilt the chip 90° about X axis, the value on the pin remains unchanged till I tilt it back to the original position.

For example how it works:

Original position - value is 0
tilt for 90° degrees - value is 90
wait for 1s - value is 90
wait for 1s - value is 90
tilt it back to the original position - value is 0

What I would expect from accelerometer:
Original position - value is 0
tilt for 90° degrees - value is 90
wait for 0.1s - value is 45
wait for 0.2s - value is 0
wait for 1s - value is 0
tilt it back to the original position - value is -90 (I know that negative voltage is not possible on the analog output, it's just for the explanation)
wait for 0.1s - value is -45
wait for 0.2s - value is 0
wait for 1s - value is 0

The program takes the values from serial port, and draws last 10 points on a screen.

Thanks

Original position - value is 0
tilt for 90° degrees - value is 90
wait for 0.1s - value is 45
wait for 0.2s - value is 0
wait for 1s - value is 0

That would be true for a very slow responding rate gyro, but not an accel. That is because there is the earth gravity accelerating downwards.

Think of how an accel works. For one axis we can model an accel as a mass between two springs of equal tension when at rest and level. Now tilt the model 90° so that the springs are vertical. The mass is now pulling on the top spring and compressing the lower spring. Because of gravity the downward force and therefore displacement, is steady.

accel.jpg

accel.jpg

Got it :slight_smile:

"Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement."

I was thinking only about dynamic forces, and didn't take into account static ones.
Thank you for your patience in explaining that! :wink: