i have x,y,z pins connected to A0, A1, A2, pins on the micro controller.
power is running from VCC on the pro mini to 3.3v on the accelerometer and i have gnd to gnd.
Is this all i need as far as physical connections?
this is the code im running
/*
ADXL3xx
Reads an Analog Devices ADXL3xx accelerometer and communicates the
acceleration to the computer. The pins used are designed to be easily
compatible with the breakout boards from Sparkfun, available from:
http://www.sparkfun.com/commerce/categories.php?c=80
http://www.arduino.cc/en/Tutorial/ADXL3xx
The circuit:
analog 0: accelerometer self test
analog 1: z-axis
analog 2: y-axis
analog 3: x-axis
analog 4: ground
analog 5: vcc
created 2 Jul 2008
by David A. Mellis
modified 4 Sep 2010
by Tom Igoe
This example code is in the public domain.
*/
// these constants describe the pins. They won't change:
const int groundpin = 2; // analog input pin 4 -- ground
const int powerpin = 4; // analog input pin 5 -- voltage
const int zpin = A2; // z-axis of the accelerometer
const int ypin = A1; // y-axis
const int xpin = A0; // x-axis (only on 3-axis models)
void setup()
{
// initialize the serial communications:
Serial.begin(9600);
// Provide ground and power by using the analog inputs as normal
// digital pins. This makes it possible to directly connect the
// breakout board to the Arduino. If you use the normal 5V and
// GND pins on the Arduino, you can remove these lines.
}
void loop()
{
// print the sensor values:
Serial.print(analogRead(xpin));
// print a tab between values:
Serial.print("\t");
Serial.print(analogRead(ypin));
// print a tab between values:
Serial.print("\t");
Serial.print(analogRead(zpin));
Serial.println();
// delay before next reading:
delay(100);
}
I'm getting readouts that are consistently around 490, and when i move the accelerometer it will give bump to 520ish for one or two readouts. i was hoping to get stronger more pronounced readings. Im fairly confident that this is the right wiring and that my code is goofed but i don't actually know.
Case 1 - you are powering the Pro Mini on its Vcc pin:
If your Pro Mini is 5V, connect its Vcc to the Vin of the accelerometer module, if its a 3.3V Pro Mini connect its Vcc to the Vcc of the accelerometer module.
Case 2 - you are powering the Pro Mini on its Vin pin and using its onboard regulator: connect Vin to Vin.
Also connect ground to ground, connect x, y, z to any available analog inputs.
If your Pro Mini is 5V you have already overloaded the accelerometer chip's supply by putting 5V on its Vcc - this might have damaged it. Vcc for the accelerometer is 3.3V max.
If the mini is 5V then the readings should centre around 338, otherwise 511. Don't be surprised that the acceleration due to gravity will show up!
Hey I have the 3.3V arduino and a 3.3v accelerometer.
I have the Vcc from the arduino connected to the 3.3v pin on the accelerometer. I tried connecting to the VIN on the accelerometer and i got readouts around 20...and no reaction at all.
I've noticed that the accelerometer works really well as a tilt sensor but i need it to measure vertical movement.
Well, I don't have that particular accelerator module, but off the top of my head:
Your output and power connections look fine. the 3.3 volts from the FTDI is more than enough.
However, on the module for the accelerometer, it looks like there are 2 pullups holding g1 and g2 high. According to the data sheet, that selects the least sensitive range, where you need 6g to do full swing. Connecting those to ground should select the 1.5g range... which sounds like where you want to be.