Pages: [1]   Go Down
Author Topic: Getting the Accelerometer (ADXL345) to work  (Read 646 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello (Arduino's) World!
First of all, let me briefly introduce myself - I am a veterinarian and researcher, passionate about photography, music and electronics.
Now, to my project: I need to build a system that measures the inclination of an object and sends the data wirelessly to the arduino. This, in turn, should actuate a servo whenever the inclination angle exceeds a given value.

Being a complete newbie to this world I am moving on step by step. What I am up to right now (and stuck there  smiley-mad) is trying to make Arduino read values from the ADXL345 accelerometer. I know there's plenty of examples and pre-build sketches around, but I've tried many and none of them seems to work. So I guess I am missing some important point and this is why I am here to ask for advice.

What I did so far is:

1) Setting up the arduino, following the official quickstart guide (including uploading the example sketch in the Arduino software) - everything seems to work as expected
2) Connecting the ADXL345 as explained here:
3) Uploading the sketch reported in the same site.

According to the explanation I should get measures of the sensor inclination in the three axis, but what I get on the Serial Monitor is just a bunch of zeroes, and, of course, nothing changes when I tilt the sensor.
Is there anything else I was supposed to do before being able to read values from the accelerometer (e.g. should I have uploaded a library onto the arduino)?
Any hint would be appreciated!

Massachusetts, USA
Offline Offline
Tesla Member
Karma: 212
Posts: 8949
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The software appears to be working so I would guess a hardware error.  Check for bad connections.

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Sr. Member
Karma: 1
Posts: 282
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The ADXL345 that I have doesn't "start" automatically, I have to sent a command to it before it starts sending data. I don't use the SPI bus like the sparkfun example but the I2C bus with the following library I did have some trouble to get it working, you can read about it on my blog.

Pages: [1]   Go Up
Jump to: