Please HELP: ADXL345 GY291

Hi,

I have 2 ADXL345 GY-291 sensors. All from one Ebay seller. I have tried this example and calibraion: Programming and Calibration | ADXL345 Digital Accelerometer | Adafruit Learning System

Wiring is the same as example and codes too.

After calibration:

ADXL345 Accelerometer Calibration
MY:

Type key when ready...
Accel Minimums: -3.84  -9.06  0.00
Accel Maximums: 0.00  0.00  62.96
Type key when ready...
Accel Minimums: -3.88  -21.06  0.00
Accel Maximums: 0.00  0.00  62.96
Type key when ready...
Accel Minimums: -3.88  -21.06  0.00
Accel Maximums: 8.16  0.00  62.96
Type key when ready...
Accel Minimums: -4.31  -21.06  0.00
Accel Maximums: 8.16  0.00  62.96
Type key when ready...
Accel Minimums: -4.31  -21.06  0.00
Accel Maximums: 8.16  2.55  62.96
Type key when ready...
Accel Minimums: -16.04  -21.06  0.00
Accel Maximums: 8.16  2.55  62.96
Type key when ready...

MUST BE:

ADXL345 Accelerometer Calibration

Type key when ready...
Accel Minimums: 0.00  0.00  0.00
Accel Maximums: 0.12  0.20  1.14
Type key when ready...
Accel Minimums: 0.00  0.00  0.00
Accel Maximums: 0.12  0.20  1.14
Type key when ready...
Accel Minimums: 0.00  0.00  0.00
Accel Maximums: 0.12  0.20  1.14
Type key when ready...
Accel Minimums: 0.00  0.00  0.00
Accel Maximums: 0.12  0.20  1.14
Type key when ready...
Accel Minimums: 0.00  0.00  -0.24
Accel Maximums: 0.12  1.37  1.14
Type key when ready...
Accel Minimums: 0.00  0.00  -0.24
Accel Maximums: 0.12  1.37  1.14
Type key when ready...
Accel Minimums: 0.00  -1.22  -0.27
Accel Maximums: 0.12  1.37  1.14
Type key when ready...
Accel Minimums: 0.00  -1.22  -0.27
Accel Maximums: 0.12  1.37  1.14
Type key when ready...
Accel Minimums: -1.18  -1.22  -0.27
Accel Maximums: 0.12  1.37  1.14
Type key when ready...

I have tried anywhere to calibrate (on the table, on the floor, another table, etc..), but result almost the same. Z axis did not change. I made a little research. ADXL345 has different revisions: B, E. I have REV B. Maybe this is the problem? I do not believe that all 2 sensors are dead. It is not possible (or maybe yes?).

Einars:
Hi,

I have 2 ADXL345 GY-291 sensors. All from one Ebay seller. I have tried this example and calibraion: Programming and Calibration | ADXL345 Digital Accelerometer | Adafruit Learning System

Wiring is the same as example and codes too.

After calibration:

include your actual code. Most of the people who frequent this forum have day jobs. Chasing code thru links doesn't happen.

Also post photos of your circuit, schematics of your circuit, expected value and actual values.

Most of the problems solved by this forum falls in to a couple of categories:

  • bad coding
  • assumptions that are wrong
  • miss-wiring
  • bad circuit design
  • failed parts

saying that you are using someone's working code, but your project doesn't work points us to the latter three possibilities.

Without picture and schematics I would blame you for the assembly or design. Most vendors provide good parts. The economic effects of bad reviews will kill a vendor, they try real hard to provide 'good' parts.

Now, there are an infinity of possible code snippets on the Web. Most of us take them with a grain of salt. the idea might be good, but the execution may be suspect. If you paste and copy code, you have executed a #2 failure. You assume the code actually works as described, and the code works with your actual hardware setup.

The genius of the Arduino ecology is that you can steadily build on top of a working foundation. The Uno board can function with only a USB connection. You can write a simple program that displays on your PC monitor with a few lines of code. you can add additional lines of code to initialize, interrogate, and control your sensor. You can build these commands one step at a time as you learn the how's and Why's for controlling your sensor.
Just cutting and pasting code you don't understand doesn't gain you anything unless you happen to create the exact hardware configuration and the code actually works.

Pictures of your hardware design are a very useful tool for identifying faults and mistakes. Some of the faults can be non obvious. If you are using breadboards, the spring plates that pinch your wire jumpers and modules can become tarnish(insulated) or flat out fail. Until we could evaluate your design and construction the possibilities are endless.

Chuck.