Pages: [1]   Go Down
Author Topic: Accelerometer arduino pro mini  (Read 2706 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everybody!

Im working with the 3.3v arduino pro mini and a china express accelerometer (http://www.pololu.com/catalog/product/766) 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?

Code:
/*
 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);
}

 
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

5.) what kind of data would a fried accelerometer read? if any.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26285
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The code shows the accelerometer powered from i/o pins, but I don't see where they are initialised.
Quote
i have a resistor from gnd to gnd from the arduino to the accelerometer.  
Quote
3.) should i have a resistor before the battery reaches the arduino?

4.)  is 10k enough?

I don't understand these statements.
Can you post a circuit diagram?
« Last Edit: April 02, 2011, 11:47:30 am by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The battery is actually a 3.7V 1000mAh  Lithium polymer battery not 2 AAs but thats the image fritzing had.

Im put a resistor in because my accelerometer was getting hot...




Uploaded with ImageShack.us
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26285
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Im put a resistor in because my accelerometer was getting hot...
These things run on hundreds of microamps.
It shouldnot be geting hot.
It should not need a resistor.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

right, yeah, so i took out the resistor and no change.

i tried running everything with no ground going to the accelerometer and there was no change, the data reads 1003 across the board.

im wondering if i've fried my accelerometer. I've fried other sensors before (force sensor) but i got zeros across the board. it seems strange that its sitting at 1003 and not 1023 . any thoughts?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26285
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
it seems strange that its sitting at 1003 and not 1023 . any thoughts?
I think that without a ground connection, all bets are off.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

it sits at 1003 whether there is or isn't a ground connection to the accelerometer. its as if the accelerometer isn't even there.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26285
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
its as if the accelerometer isn't even there
No,if it weren't there, the pin would float.
However, without any hands-on, I'd say it is toast.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK so i've unsoldered everything and reconnected to the breadboard...and everything works great hovering around 550 and i'm getting readings when i move it around.

So the problem must have been with my solder job.

thanks for your help AWOL
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

re soldered everything together using a different higher quality perf board and everything works great.
Logged

Pages: [1]   Go Up
Jump to: