Accelerometer MMA8451 not found by Boron

I’ve been trying to test my accelerometer using this sample code from the adafruit library. My schematic is the same as that of this tutorial. Whenever I flash this code to my Boron, it says it can’t find my accelerometer. Does anyone have any ideas for how I can troubleshoot this? My soldering job is pretty bad but I won’t have access to another soldering iron until Monday.

Can you show us a hires photo of your setup?
Can you run this I2C address scanner program to see whether your device is found at all?

void setup()
{
  Wire.begin();

  Serial.begin(9600);
  delay(10000);
  Serial.println("\nI2C Scanner");
}


void loop()
{
  byte error, address;
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for(address = 1; address < 127; address++ ) 
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16) 
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");

      nDevices++;
    }
    else if (error==4) 
    {
      Serial.print("Unknow error at address 0x");
      if (address<16) 
        Serial.print("0");
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");

  delay(5000);           // wait 5 seconds for next scan
}
1 Like

Sorry for the late response! I ran the scanner and it said no I2C devices found.

Hm, this looks like it should be fine - I’m surprised that the I2C scanner doesn’t produce a result.
I see 3.3 / GND / SDA / SCL correctly configured. Can I see the solder job underneath the MMA8451?

1 Like

Here’s an image of the soldering job… not great but I think they’re making contact.

@mbackus, those look like incomple and/or cold joints. Make sure the solder flow between the connector posts and the gold board pads by applying the tip of your iron to both the pad and the post and applying the solder.

3 Likes

Alright thanks I’ll try to fix them today

I fixed the soldering and everything works now! Thank you!

2 Likes