MS8607 sensor did not respond. Please check wiring.

Hello Forums

I’m just getting my feet with ESP32. So far I have managed to get the wifi and hello world example up and running. Now I am trying to read some temperature and humidity data from my Sparkfun Qwicc PHT MS8607. Here is the full output from the serial console.

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:12804
ho 0 tail 12 room 4
load:0x40080400,len:3032
entry 0x400805e4
Qwiic PHT Sensor MS8607 Example
MS8607 sensor did not respond. Trying again...
MS8607 sensor did not respond. Please check wiring.

Here is the example sketch (identical to the documentation on github https://github.com/sparkfun/SparkFun_PH … eading.ino)

/*
  Reading barometric pressure from the MS8607
  By: PaulZC
  Date: January 28th, 2020
  Based extensively on:
  Reading barometric pressure from the MS5637
  By: Nathan Seidle
  SparkFun Electronics
  License: MIT. See license file for more information but you can
  basically do whatever you want with this code.
  The original library and example code was written by TEConnectivity,
  the company that made the sensor. Way to go TE! May other companies
  learn from you.
  Feel like supporting open source hardware?
  Buy a board from SparkFun!
  This example prints the current pressure in hPa and temperature in C.
*/

#include <Wire.h>

#include <SparkFun_PHT_MS8607_Arduino_Library.h> // Click here to get the library: http://librarymanager/All#SparkFun_PHT_MS8607

MS8607 barometricSensor;

void setup(void)
{
  Serial.begin(115200);
  Serial.println("Qwiic PHT Sensor MS8607 Example");

  Wire.begin();

  if (barometricSensor.begin() == false)
  {
    Serial.println("MS8607 sensor did not respond. Trying again...");
    if (barometricSensor.begin() == false)
    {
      Serial.println("MS8607 sensor did not respond. Please check wiring.");
      while (1)
        ;
    }
  }
}

void loop(void)
{

  float temperature = barometricSensor.getTemperature();
  float pressure = barometricSensor.getPressure();

  Serial.print("Temperature=");
  Serial.print(temperature, 1);
  Serial.print("(C)");

  Serial.print(" Pressure=");
  Serial.print(pressure, 3);
  Serial.print("(hPa or mbar)");

  Serial.println();

  delay(500);
}

Any idea where I’m going wrong? I can see the red LED light up on the sensor so I know it’s getting power. Maybe I’ve installed the library wrong or something?

how did you connect the sensor to the ESP32 ?

Can you detect 2 both sensors with I2c scanner ( e.g. https://playground.arduino.cc/Main/I2cScanner/) ?

paulvha:
how did you connect the sensor to the ESP32 ?

Can you detect 2 both sensors with I2c scanner ( e.g. https://playground.arduino.cc/Main/I2cScanner/) ?

My super duper apologies for taking so long to respond. I basically didn’t instantly get this thing working and the company I work for decided to go with another option. I am now back to having availability to make this baby work!

I will try the link you suggested and report back.

It is connected to the ThingPlus via the qwicc cable, it is plugged into the PHT board into the left socket (I’ve tried both), and the red power led on the PHT is on, so I know it’s getting power, this led lights up whether I use the left or the right socket on the PHT.

I have uploaded this sketch from that link:

    // --------------------------------------
    // 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
    }

The response in the serial monitor is:

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

configsip: 0, SPIWP:0xee

clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00

mode:DIO, clock div:1

load:0x3fff0018,len:4

load:0x3fff001c,len:1044

load:0x40078000,len:8896

load:0x40080400,len:5816

entry 0x400806ac

I think maybe the PHT unit is faulty.

The Thing Plus seems to work but maybe it’s i2c unit isn’t working properly?

that is a normal message at the start of an ESP32. I don’t see any sketch output. Check you serial monitor has the same speed as your sketch. (e.g. 9600).

Ooh, I wasn’t aware that was a thing I had to think about. Sorry total noob. Should I also upload the sketch at 9600?

Here is the output now, I’ve tried to switch the sockets on the PHT while it’s running, it repeats the same thing.

⸮
⸮ܠ⸮⸮J⸮⸮1⸮⸮⸮s⸮!⸮⸮⸮!⸮1⸮
I2C Scanner
Scanning...
No I2C devices found

Scanning...
No I2C devices found

Scanning...
No I2C devices found

I’m not sure what those first characters are supposed to be.

how did you connect the sensor to the ESP32 ?

can you share pictures ?

It is using the qwicc interface, I will upload a pic, one second.

paulvha:
how did you connect the sensor to the ESP32 ?

can you share pictures ?

https://imgur.com/a/YsYI1g8

that is straight forward. :slight_smile: Which ESP32 board did you select in the Arduino IDE ?

paulvha:
that is straight forward. :slight_smile: Which ESP32 board did you select in the Arduino IDE ?

Sparkfun Thing Plus I think (sorry at work now, will be able to screen shot the IDE later this evening when I get home)

Is it possible that selecting the wrong board would cause this issue? The official instructions do say to select the adafruit feather, but I figured the guide was just old and outdated. I am able to upload a sketch that lets me connect to wifi so I presumed I had it all set up correctly and this sensor is just faulty.

That could be your issue. While both have an ESP32 the PAD (the connection on the processor) to pin (the pins on the board) can be completely different depending on the board design. On many (if not all) processors the PADs can be set to different input/output functions ( e.g. analog, digital, SPI, I2C PWM etc). Make sure to follow the hookup guide that belongs to your board, so the pad to pin mapping in the library is the right one for your board.

paulvha:
That could be your issue. While both have an ESP32 the PAD (the connection on the processor) to pin (the pins on the board) can be completely different depending on the board design. On many (if not all) processors the PADs can be set to different input/output functions ( e.g. analog, digital, SPI, I2C PWM etc). Make sure to follow the hookup guide that belongs to your board, so the pad to pin mapping in the library is the right one for your board.

It was set to Sparkfun Thing Plus. I tried the Ada Fruit Feather ESP32, same sketch. 9600 baud. Still can’t find any i2c devices. Should I begin some kind of warranty claim or something at this point? I’m not even sure what the return policy is and I’ve had this thing sitting in a box for a few months now.

Double check that you have it all setup according to the hookup guides. Maybe reinstall the libraries. An small error is easily made.

Try the original sketch (not only the scanner). If it still fails, contact the supplier. Normally warranty is longer than a couple of months.

Cheers. I will do that today.

Just for clarification, the point of ThingPlus with wifi and qwiic, is that i should be able to having something working really quickly with almost no effort right? Generally speaking, i should be able to include a library, plug in the qwiic cable, upload the sketch and be up prototyping quickly? This is the product stack I want for that right?