Hello everybody!
Im working with the 3.3v arduino pro mini and a china express accelerometer (Pololu - MMA7260QT 3-Axis Accelerometer ±1.5/2/4/6g) also a bluetooth (not an issue at this point) and a 3.7V lipo battery. i have a resistor from gnd to gnd from the arduino to the accelerometer.
I had everything hooked up and working on a breadboard and connected via serial port t my computer and i was getting accurate and consistant data(Ranges around 550). Then i connected the battery and the bluetooth and it worked, i got accurate and consistant data.
Then i soldered every thing together and when i was finished my readouts where in the 770 area and the would jump around a bit. when i went to bed last night they were around the 1000s. and when i woke up this morning is read 1005 and doesn't measure acceleration or tilt. This happens whether im using serial port or bluetooth.
WHAT HAPPENED??
1.) Upon inspection i feel i did a good job soldering everything together and i don't think i have any crossed wires or anything touching anything. if you think this might be the problem where should i look?
2.) is it possible that I've fried my accelerometer.
3.) should i have a resistor before the battery reaches the arduino?
4.) is 10k enough?
/*
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 2 -- ground
const int powerpin = 4; // analog input pin 4 -- 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);
}