An adventure with ADXL325 sensor

Hello everyone!

A few days ago I received a project/task from the university based on the ADXL325 as in the title. My first goal is to connect and run it, to get some (or any) output information. I have tried to follow the instructions on: ADXL3xx, but with miserable effects (code below). The output is 695 for every axis. I will appreciate every help and clues on how to get it working properly. Thanks for any replies!

const int xpin = A3;                  
const int ypin = A2;                  
const int zpin = A1;                 

void setup() {
  // initialize the serial communications:

void loop() {
  // print the sensor values:
  // print a tab between values:
  // print a tab between values:
  // delay before next reading:

Did you notice that the example feeds the module through 2 arduino pins?

How is the module being fed?

I did not notice that. if this is what you are asking about, it's being fed by 3.3V.

You picked one of the worst possible tutorials, which suggests using a port pin as an analog ground. Really stupid idea!

Connect the real grounds instead.

You forgot to mention which Arduino you are using, but assuming it is a 5V Uno, "695 on every axis" means that the sensor analog outputs are all presenting about 3.3V.

I followed this tutorial as there is none about this sensor on the internet. Also that is why i am looking for help. You are correct, i am using Uno 5V. What about ground when this sensor does not have GND pin as the other ones?

The pins labeled COM are all ground (GND). Connect ST (self test) to GND and apply 3.3V power to the Vs pins.

If you are using a module with the sensor mounted, post a link to it.

If you are using the naked chip, I hope you have very carefully soldered all the connections, with no solder bridges or bad joints. You need a decoupling capacitor (typically 0.1 uF) between Vs and COM/GND, as close as possible to the chip.

Thanks for the info with GND.
I have such sensor as in the attachment.


Connect it correctly and let us know what happens.

If you run into trouble, make and post a hand-drawn wiring diagram of your setup.

Hi again after short break. I connected everything as adviced, analog reads of X Y Z axis are as follows: 391.00 390.00 357.00 (it changes a little bit, while tilting the sensor). Are these values correct? If yes, what should i do to procces this data ?

Sounds like it is working.

There are a number of tutorials on line showing how to use ADXL accelerometers with analog output.