No I2C devices found (Nano 33 BLE + MS5611 + MKR GPS SHD)

I have a setup using Nano 33 BLE with external barometric and GPS sensors connected to Nano's I2C pins. Multiple I2C-Scanners are unable to find I2C devices.

hardware:

  • Arduino Nano 33 BLE (ABX00030)
  • GY-63 MS5611
  • Arduino MKR GPS SHD (ASX00017)

Using Arduino IDE 2.0.0 rc3 under Windows 11. Communication via COM Ports (upload to the Nano BLE board and serial monitor) is working as expected, tested with the basic blink example and two different I2C scanners.

fritzing:

diagnostics:

power supply for Nano BLE

The Nano BLE Board is powered by USB. External sensors are powered via the Nano BLE Board. I also tried with external power supply (5V breadboard module, connected to Nano's VIN [5V input] and to external sensors directly), with same results.

power supply for external sensors

Since the Nano BLE is obviously working (upload and serial monitor working), I focussed on the power supply of the external sensors. Both sensor modules take 5.0 V input, working with 3.3 V internally. So I tested different power supply setups:

  • 5.0 V external power supply, connected directly to the external sensors
  • 5.0 V input (Nano BLE pin VIN, which supplies 5.0V when USB is powered)

Nano 33 BLE documentation says:

NOTE: Since VUSB feeds VIN via a Schottky diode and a DC-DC regulator specified minimum input voltage is 4.5V the minimum supply voltage from USB has to be increased to a voltage in the range between 4.8V to 4.96V depending on the current being drawn

As a 3rd option I could use the +5.0V output for peripherals ("+5V"), which is inactive by default for security reasons, because all digital input pins are limited to 3.3 V. Therefore the pin "+5V" needs to be soldered, what I have not done yet. Nano 33 BLE documentation says:

NOTE: Arduino Nano 33 BLE only supports 3.3V I/Os and is NOT 5V tolerant so please make sure you are not directly connecting 5V signals to this board or it will be damaged. Also, as opposed to Arduino Nano boards that support 5V operation, the 5V pin does NOT supply voltage but is rather connected, through a jumper, to the USB power input

https://support.arduino.cc/hc/en-us/articles/360014779679-About-Nano-boards-with-disabled-5-V-pins

PIN description:

PIN 12
VUSB
Power In/Out
Normally NC; can be connected to VUSB pin of the USB connector by shorting a jumper

Measured power supply is stable in all tested power supply setups. The GY-63 module has a red LED on when powered, which I found to be an operating indicator in other other examples found by Google search.

power level of I2C signals

The external sensors are operating with 3.3 V internally. So one could assume that power level of I2C signals is not exceeding 3.3 V. Measuring with a multimeter shows 3.8 V.

In found some forum threads about I2C pull up. Nano 33 BLE documentation says:

NOTE: As opposed to other Arduino Nano boards, pins A4 and A5 have an internal pull up and default to be used as an I2C Bus so usage as analog inputs is not recommended

i2c scanner on duplicated hardware

For testing purposes and later LoRa connectivity I bought and built the setup twice.

On two very exactly duplicated hardware setups I did i2c scans. None of them found any i2c device. But I noticed different timings. Scan on first breadboard/Nano finishs within milliseconds (without "Scan finished" message), while second breadboard/Nano finishes after 20 seconds.

First breadboard:

10:46:53.920 -> Scanning...
10:46:53.959 -> No I2C devices found
10:46:53.959 ->
10:46:58.943 -> Scanning...
10:46:58.987 -> No I2C devices found
10:46:58.987 ->
10:47:03.964 -> Scanning...
10:47:04.003 -> No I2C devices found
10:47:04.004 ->

Second breadboard:

10:49:09.135 -> --- Scan started ---
10:49:31.474 -> No I2C devices found
10:49:31.474 -> --- Scan finished ---
10:49:31.474 ->
10:49:36.467 -> --- Scan started ---
10:49:58.777 -> No I2C devices found
10:49:58.777 -> --- Scan finished ---
10:49:58.777 ->
10:50:03.806 -> --- Scan started ---
10:50:26.121 -> No I2C devices found
10:50:26.121 -> --- Scan finished ---
10:50:26.121 ->

Code:

#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++ ) 
  {
    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
}

Conclusions:

At this point I have no further ideas about troubleshooting. Next step could be to buy an oscilloscope to measure the I2C signals of the external sensors.

Any else suggestions?

I suggest you try one i2c component at a time if it works then there is no problem with the nano

I already tried that, also without finding any I2C device. I thought, multiple external I2C devices could increase evidence that the problem is on the Nano side.

do you have another arduino? did you try other scripts

Please post the schematic view from Fritzing, not the Breadboard view. On the breadboard view, there are no pin labels on the Nano or the GPS module, only on the barometer module, so it's not much help.

If you have not used Schematic view in Fritzing before, it's not just a matter of switching views. You do have to arrange the components and draw in the connections, but at least Fritzing will help you by indicating the connections from the Breadboard view as dotted lines.

hello,
it seems you have connected the power cables wrong you connected the vin pin to 5+ on breadboard that means the i2c components dont have power, ground connection is write if i am not mistaken you should connect:

5+ => 5+ on breadboard
gnd => gnd on breadboard

try that i dont know if what i am saying is right

good luck

EDIT: i am trying the script on an arduino , connections are fine in yours
EDIT 2: i tried it and it worked on my arduino it found the device:

Not sure, if the component schematics are right. I found them in the internet...
ARD MKR GPS SHD is definitely connected to the GND pin.

i think you have a problem with the chip of the nano on my arduino it worked fine

@the_dev_hut
As I wrote in the original post the +5 PIN is not active (unsoldered jumper).

https://support.arduino.cc/hc/en-us/articles/360014779679-About-Nano-boards-with-disabled-5-V-pins

I connected VIN to +5 on breadboard, because it is connected to VUSB when the Nano is powered by USB.
I measured with my multimeter: 4.8 V stable power supply at the sensors Vin PINs.

Which Arduino did you use?

uno
with the same script i think it is the same correct me if i am wrong

Uno is whole different.

// I2C Scanner
// Written by Nick Gammon
// Date: 20th April 2011

#include <Wire.h>

void setup() {
  Serial.begin (115200);

  // Leonardo: wait for serial port to connect
  // while (!Serial) 
  //  {
  //  }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
  
  Wire.begin();
  for (byte i = 1; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

try it

Thank you for helping. Same result, again, on both identical breadboards.

14:6:56.999 -> Done.
14:6:56.999 -> Found 0 device(s).

I think this is a hardware or a signalling issue.

After days of investigating I'm quite frustrated...

people say that the A4 pin is grounded and that is not done
Deliberately but i don't believe that so what i suggest you do is check with the multimeter if it is grounded

A4 (SDA) to GND has a voltage of 0.52 V.
I wired to GND, again without effect on the I2C scanner.

@the_dev_hut
I ordered an Uno. Delivery expected by tomorrow. Did you wire SDA/SCL (with or without resistors) to GND in your Uno setup?

The Arduino Nano 33 BLE has already a onboard I2C device (LSM9DS1).
Connect the board to the USB cable and nothing else, then a I2C scanner should see it. If not, then it might be broken. You have to disconnect all the wires from the Nano 33 BLE board to be sure that it is broken (take the Nano 33 BLE out of the breadboard).

First bright spot of the day:

I found this post, pointing to the TwoWire class:

https://forum.arduino.cc/t/advice-i2c-communication-with-internal-sensors-ble-ble-sense/613815

With the attached i2c scanner sketch (optimized version for Nano 33 BLE) I was able to see the internal i2c devices (on I2C bus 1) on both Nano BLE boards while completely disconnected from the breadboard.
(i2c_scanner_for_nano_33_ble.ino (2.27 KB))

17:17:33.468 -> Scanning...
17:17:33.468 -> I2C device found at address 0x1E !
17:17:33.468 -> I2C device found at address 0x6B !
17:17:33.468 -> done
17:17:33.468 ->
17:17:38.465 -> Scanning...
17:17:38.465 -> I2C device found at address 0x1E !
17:17:38.512 -> I2C device found at address 0x6B !
17:17:38.512 -> done
17:17:38.512 ->
17:17:43.476 -> Scanning...
17:17:43.476 -> I2C device found at address 0x1E !
17:17:43.521 -> I2C device found at address 0x6B !
17:17:43.521 -> done
17:17:43.521 ->

17:22:45.896 -> Scanning...
17:22:45.896 -> I2C device found at address 0x1E !
17:22:45.896 -> I2C device found at address 0x6B !
17:22:45.896 -> done
17:22:45.896 ->
17:22:50.906 -> Scanning...
17:22:50.906 -> I2C device found at address 0x1E !
17:22:50.906 -> I2C device found at address 0x6B !
17:22:50.906 -> done
17:22:50.906 ->
17:22:55.941 -> Scanning...
17:22:55.941 -> I2C device found at address 0x1E !
17:22:55.941 -> I2C device found at address 0x6B !
17:22:55.941 -> done
17:22:55.941 ->

So it seems to be that duration of i2c scanning is rather milliseconds than 20 seconds.

The scan did not find the external sensors. But still no evidence, that I2C bus 0 is not broken...

How the scanner has to be modified to find the external devices on I2C bus 0? Unfortunately I'm not familiar with that.

The mentioned post states:

So, the main reason, why we can’t properly communicate with the internal sensors via I2C is that one of the default I2C bus wires is set to control the power mode of some sensors and therefore blocking the default I2C bus for direct communication. Now that we know the problem, we can use the TwoWire class of the Wire.h library to switch to a secondary I2C bus in order to communicate with the sensors.

I wrote my own version of an i2c scanner:


#include <Wire.h>
extern TwoWire Wire1;

/*
TwoWire Wire0 = TwoWire(0);   // channel 1
TwoWire Wire1 = TwoWire(1);   // channel 2
*/
/*
// I2C channel 1: SDA and SCL pin
#define SDA1 21
#define SCL1 22
// I2C channel 2: SDA and SCL pin
#define SDA2 17
#define SCL2 16
*/



void scan(TwoWire * wire, char channel)
{
  
  Serial.print("Scanning I2C addresses on channel ");
  Serial.println(channel);

  byte error, address;
  uint8_t nDevices = 0;   // counter for found devices

  for (address=0; address<128; address++)
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmission to see if
    // a device did acknowledge to the address.
    wire->beginTransmission(address);
    error = wire->endTransmission(true);
    if (error == 0)   // device found with ACK
    {
      Serial.print("0x");
      if (address<16)
      {
        Serial.print('0');  // add leading zero
      }
      Serial.print(address,HEX);
      nDevices++;
    }
    else if (error == 4)   // device found with error
    {
      Serial.print("ERR4");
      Serial.println(address,HEX);
    }
    else   // no device found (error code 2 or 3)
    {
      Serial.print("....");
    }
    Serial.print(' ');   // spacer after every device
    if ((address&0x0f) == 0x0f)
    {
      Serial.println();   // line break after every 16 addresses
    }
  }
  Serial.print("Scan completed, ");
  Serial.print(nDevices);
  Serial.print(" I2C device(s) found on channel ");
  Serial.println(channel);
}


void setup()
{
  Serial.begin(115200);
  while (!Serial);
  Serial.println("I2C Scanner");
  Serial.print("Waiting for 3 seconds...");
  delay(3000);
  Serial.println();

  Serial.print("Initializing I2C bus 1...");
  Wire.begin();
  Serial.println();

  Serial.print("Initializing I2C bus 2...");
  Wire1.begin();
  Serial.println();

  /*
  Wire0.begin(SDA1, SCL1, 400000);
  Wire1.begin(SDA2, SCL2, 400000);
  */
}


void loop()
{
  scan(&Wire, '1');
  delay(100);
  scan(&Wire1, '2');
  Serial.println("Waiting for 10 seconds...");
  delay(10000);
}


Same output on both identical breadboards, but ...

13:10:07.154 -> I2C Scanner
13:10:07.154 -> Waiting for 3 seconds...
13:10:10.162 -> Initializing I2C bus 1...
13:10:10.162 -> Initializing I2C bus 2...
13:10:10.162 -> Scanning I2C addresses on channel 1
13:10:10.349 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
13:10:13.310 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
13:10:16.272 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
13:10:19.240 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
13:10:22.193 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
13:10:25.130 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
13:10:28.066 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
13:10:31.077 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
13:10:33.924 -> Scan completed, 0 I2C device(s) found on channel 1
13:10:34.002 -> Scanning I2C addresses on channel 2
13:10:34.002 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
13:10:34.002 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... 0x1E ....
13:10:34.002 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
13:10:34.002 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
13:10:34.047 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
13:10:34.047 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
13:10:34.047 -> .... .... .... .... .... .... .... .... .... .... .... 0x6B .... .... .... ....
13:10:34.047 -> .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
13:10:34.047 -> Scan completed, 2 I2C device(s) found on channel 2
13:10:34.047 -> Waiting for 10 seconds...

... with different scan duration on external sensors!

Scanning channel 1 (external i2c bus) takes milliseconds on first breadboard and 20 seconds on second breadboard. What timing with external wired sensors would be to expect on external devices? Is slow scanning a notice for right function or malfunction or that the controller "hangs" with signal interpretation...?

Scanning channel 2 (internal i2c bus) takes milliseconds on both breadboards.

This story is to be continued. I ordered an Uno (to test the external sensors with it), an oscilloscope and a logic analyzer.