Qwiic Micro - I2C

I am also having trouble with my QWIIC thermocouple amp. The address cannot be found for it. I have attached a picture of the schematic. and the code. The message “Device did not acknowledge” keeps showing. I have tried all 8 addresses, and none of them register. I have the SDA and SCL wires going into pins A4 and A5 respectively because my board does not have a QWIIC connect on it. Please help. Thanks.

Moderator edit to add code tags

/*
  Temperature Measurements with the MCP9600 Thermocouple Amplifier
  By: Fischer Moseley
  SparkFun Electronics
  Date: July 8, 2019
  License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware License).

  This example outputs the ambient and thermocouple temperatures from the MCP9600 sensor.

  Hardware Connections:
  Attach the Qwiic Shield to your Arduino/Photon/ESP32 or other
  Plug the sensor onto the shield
  Serial.print it out at 115200 baud to serial monitor.
*/
#include <Wire.h>
#include <SparkFun_MCP9600.h>
MCP9600 tempSensor;

void setup(){
    Serial.begin(115200);
    Wire.begin();
    Wire.setClock(100000);
    tempSensor.begin(0x60);       // Uses the default address (0x60) for SparkFun Thermocouple Amplifier
    //tempSensor.begin(0x66); // Default address (0x66) for SparkX Thermocouple Amplifier

    //check if the sensor is connected
    if(tempSensor.isConnected()){
        Serial.println("Device will acknowledge!");
    }
    else {
        Serial.println("Device did not acknowledge.");
        while(1); //hang forever
    }

    //check if the Device ID is correct
    if(tempSensor.checkDeviceID()){
        Serial.println("Device ID is correct!");        
    }
    else {
        Serial.println("Device ID is not correct.");
        while(1);
    }
}

void loop(){ //print the thermocouple, ambient and delta temperatures every 200ms if available
    if(tempSensor.available()){
        Serial.print("Thermocouple: ");
        Serial.print(tempSensor.getThermocoupleTemp());
        Serial.print(" °C   Ambient: ");
        Serial.print(tempSensor.getAmbientTemp());
        Serial.print(" °C   Temperature Delta: ");
        Serial.print(tempSensor.getTempDelta());
        Serial.print(" °C");
        Serial.println();
        delay(20); //don't hammer too hard on the I2C bus
    }
}

Can you provide a picture of your setup?

Yes…

What I am eventually need to do is use this as a PID controller with 2 thermocouples and 2 heaters and display the temperatures on 2 LCDs. But for now, I am just trying to get this to read the temp and display it on the LCD.

I think your SDA/SCL pins are in the wrong place. Move them to the headers labelled for SDA/SCL as this pinout from Arduino details: https://content.arduino.cc/assets/Pinou … latest.png

I moved the pins to the ones in the image and tried all 8 addresses also, and it still shows “Device did not acknowledge” in the serial monitor

Can you run an I2Cdetect sketch?

  • - Connect the red wire from the board to 3.3 volts.
  • - Connect the yellow wire from the board to SCL (or A5)
  • - Connect the blue wire from the board to SDA (or A4)
  • - Leave the black wire connected to GND
  • Then run the I2C scanner sketch (below) and let us know what shows up in the serial monitor.

     // --------------------------------------
    // i2c_scanner
    //
    // Version 1
    //    This program (or code that looks like it)
    //    can be found in many places.
    //    For example on the Arduino.cc forum.
    //    The original author is not know.
    // Version 2, Juni 2012, Using Arduino 1.0.1
    //     Adapted to be as simple as possible by Arduino.cc user Krodal
    // Version 3, Feb 26  2013
    //    V3 by louarnold
    // Version 4, March 3, 2013, Using Arduino 1.0.3
    //    by Arduino.cc user Krodal.
    //    Changes by louarnold removed.
    //    Scanning addresses changed from 0...127 to 1...119,
    //    according to the i2c scanner by Nick Gammon
    //    https://www.gammon.com.au/forum/?id=10896
    // Version 5, March 28, 2013
    //    As version 4, but address scans now to 127.
    //    A sensor seems to use address 120.
    // Version 6, November 27, 2015.
    //    Added waiting for the Leonardo serial communication.
    // 
    //
    // This sketch tests the standard 7-bit addresses
    // Devices with higher bit address might not be seen properly.
    //
    
    #include <Wire.h>
    
    
    void setup()
    {
      Wire.begin();
    
      Serial.begin(9600);
      while (!Serial);             // Leonardo: wait for serial monitor
      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("Unknown 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
    }
    

    D12 and D13 aren’t A4 and A5. Try connecting the thermocouple board to the same pins that the LCD is connected to or use the two pins next to the 6-pin header as an alternate place to pick up A4 and A5.

    /mike

    https://i.stack.imgur.com/1djIN.png

    Yes, I did that for the lcd and it works for that. I tried it for the thermocouple amp,moved the SDA and SCL pins to pins A4 and A5 and it says “No I2C devices found.”

    At this point, I would recommend that you file an RMA request here: https://sparkfun.com/returns

    Ok, I moved the data and clock wires to pins for the thermocouple to A4 and A5 and I am getting a temperature reading. That part is working. However, which ports do I plug the data and clock wires into now, so as to display the temperature on the LCD, since they were plugged into A4 and A5?

    Well, after a couple times of it reading the temperature, now it is back to saying “Device did not acknowledge.”

    What’s the address for your LCD?

    However, which ports do I plug the data and clock wires into now, so as to display the temperature on the LCD, since they were plugged into A4 and A5?

    You are able to have them in the same pins. You can breakout the SDA and SCL to the bread board and run them in parallel. However, if your screen and sensor have the same address then you'll have issues

    Ok, so I moved the data and clock wires for the LCD to pins 18 and 19 and the LCD is working and left the wires for the amp in A4 and A5. What happens now is the code will run and display the temperature, until the next time I up load it to the board and it says “Device not found.” Then I move the QWIIC connect to the connector on the other side of the amplifier and then upload the code again and it starts working fine again, for a little while then the same thing happens again. “Device not found.”

    I didid the I2C scan and it found the address for the LCD is 0x27. I unhooked the SCL and SDA wires for the lcd and ran the scan again for the thermocouple amp. The serial monitor said “No I2C device found.” So, the thermocouple amp isn’t even being recognized.

    It sounds like the thermocouple board might be damaged and is somehow dropping off the bus every now and then. The only thing I can think of would be to try another thermocouple board.