Go Down

Topic: Acceleration Sensor BMA020 (Read 6 times) previous topic - next topic

Norbert

HI  @ all,

I try to make my BMA020 working on my Arduino. I think all wires are conected properly.
Here is the sketch i have written until now:

Code: [Select]

#include <Wire.h>


int val = 0;

void setup() {
    Wire.begin();
       
    Serial.begin(9600);
    Serial.print (val);
}

void loop() {
  Wire.beginTransmission(0x70);
  Wire.send(0x02);
  //Wire.endTransmission();
  Wire.requestFrom(0x71, 6);
  if (Wire.available()) {
     val = Wire.receive();
   }
  Wire.endTransmission();
 
  Serial.println (val, BIN);
 
  delay(25);
   
}



The problem is i only get zeros out. Can anybody help me to find out the problem? Here is the Link for the DAtaSheet of the BMA020:

http://dkc3.digikey.com/PDF/Marketing/Bosch_BMA020.pdf

AWOL

Did you remember that the I2C / TWI pins are analogue pins?
Did you use external pullups?
"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.

Norbert

I don´t use external pullups. I use the Arduino DUemilanove-Board directly to cennect with the BMA020.
Do you mean this doesn´t work? Can you give me some advice how to get this Sensor working?

AWOL

Do you have access to an oscilloscope?
"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.

Norbert

no i have no acces to an oszilloscope. But i was wrong, the arduino board has external pullups. I think all cables are conectet correctly. The problem must be in the sketch.
The best will be if someone can give me a correct sketch which works with my combination of arduino board and BMA020.

Go Up