3 Replies Latest reply on Nov 25, 2015 11:11 AM by nitewing117

    I2C device not found with Arduino breakout kit - (SparkFun MS5803-14BA)

    nitewing117

      This is my first time building a project using I2C as well as using the Edison. I'm trying to get signal from the SparkFun MS5803 pressure sensor board. I first made an attempt with their demo code and noticed that no data was showing up in the serial monitor.

       

      The breakout is connected as follows:

      MS5803               Edison breakout board

      GND                             GND

      PWR (3.3V)                    3.3V

      SDA                              SDA

      SCL                              SCL

       

      I've tried pins 2/3 (per the sparkfun hookup guide) and 4/5 (from what I've seen on the forum) for SDA/SCL and still had no output.

       

      I then used the following code to scan for any I2C signals:

      #include <Wire.h>
      void setup()
      {
        Wire.begin();
        Serial.begin(9600);
        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
      }

       

      No I2C devices are found. I double checked the make sure that I was using the Edison-specific Arduino IDE as well.

       

      To make sure that the sensor is actually functional, I tested the board with an Arduino Leonardo and the code above detects the device...

       

      I've seen some posts mentioning that the SDA and SCL pins may need pull-up resistors, but the sparkfun breakout board already includes these. Has anyone been able to connect any similar I2C devices using the Arduino IDE? I appreciate any help that you can provide.

        • 1. Re: I2C device not found with Arduino breakout kit - (SparkFun MS5803-14BA)
          Intel_Peter

          Hello nitewing117,

           

          I can see in SparkFun Pressure Sensor Breakout - MS5803-14BA that the sensor operates at a voltage range of 1.8v to 3.6v. Did you make sure to change the Edison's voltage reference to 3.3v, in case you haven't, this might be what's causing you trouble. In fact this could have even damaged the sensor.

          I know that you are powering your board with 3.3v, nevertheless you have to change the voltage reference of the whole board, otherwise SDA and SCL will send 5v signals. To learn how to set the board's voltage reference to 3.3v go to Jumper Headers.

           

          Also, as you mentioned, when working with I2C, always remember to use pull-up resistors, otherwise things might not work properly. I mentioned this because I could not find any confirmation in SparkFun Pressure Sensor Breakout - MS5803-14BA that the sensor includes pull-up resistors. I might be wrong, but as I mentioned I just couldn't find it.

           

          Try these suggestions out and let us know.

           

          Peter.

          1 of 1 people found this helpful
          • 2. Re: I2C device not found with Arduino breakout kit - (SparkFun MS5803-14BA)
            SpiderKenny

            Just to backup what Peter is saying.

            Pull up resistors are essential with I2C since the SDA and SCL signals are only ever driven LOW, never high.

            Without the pull up resistors your signal can never go high. Use something like 4.7 KOhm, tied to VCC if using the highest speeds you might even want to drop that to about 2K.

             

            If you have access to an oscilloscope or logic analyzer then hook it up to the SCL and SDA signals and see if you are getting anything at all.

            1 of 1 people found this helpful
            • 3. Re: I2C device not found with Arduino breakout kit - (SparkFun MS5803-14BA)
              nitewing117

              Hi Peter,

               

              I noticed there is a 2.2k pull-up resistor in the SparkFun schematic. I hope I'm reading that correctly.

               

              Thanks for the info about the jumper. I got lucky and it seems like the sensor is still functional - I hooked it back up to the Leonardo and ran the demo code and I'm getting proper and consistent readings for degrees C and F.

               

              Back to the Edison, I swapped the jumper to the 3.3v and hooked the sensor back up. With the i2c_scanner code, I still get a "no device found" message. However, I decided to upload the MS5803-14BA demo sketch and I see data in the serial monitor that matches what I saw when the sensor was hooked to the Leonardo. Unfortunately, I intermittently receive a -500 C reading (all other output fields seem fine...) so it looks like I have a bit more trouble shooting to do.