I2c expanders not steadily detected

Hi,

I used the schematics of the Arduino to create my own PCB with a bunch of new components. It is connected to my computer via USB and a USB-->FTDI module. Wires then go from the module to the PCB (RX, TX, DTR, VCC and ground).
The microcontroller is an Atmega 328P that I unsoldered from a Nano - so I didn't have to burn a bootloader on it - and I have 4 I/O expanders (TCA9538DBR) on the i2c lines, plus sensors and LEDs connected to these expanders.
Near each expander is a vcc pad, and there are 2 capacitors (0.1 uF and 10 uF) between each vcc pad and the main ground pad running all around.

When I run the i2c_scanner from the Arduino IDE to confirm the communication between expanders and microcontroller, the result is pretty weird.
I have to slightly touch the expanders with my fingers, otherwise there is no detection. When they get detected, their addresses are correct (0x70, 0x71, 0x72 and 0x73).
Also, I can detect 1 or 2 at a time but no more, even when touching the 4.
Here is the kind of output that I get :

  11:36:31.156 -> I2C device found at address 0x70  !
  11:36:31.203 -> I2C device found at address 0x73  !
  11:36:31.251 -> done
  11:36:31.251 -> 
  11:36:31.487 -> No I2C devices found
  11:36:31.534 -> 
  11:36:31.818 -> No I2C devices found
  11:36:31.865 -> 
  11:36:32.148 -> No I2C devices found
  11:36:32.148 -> 
  11:36:32.431 -> I2C device found at address 0x70  !
  11:36:32.478 -> I2C device found at address 0x73  !
  11:36:32.526 -> done
  11:36:32.526 -> 
  11:36:32.809 -> No I2C devices found
  11:36:32.809 -> 
  11:36:33.093 -> No I2C devices found
  11:36:33.140 -> 
  11:36:33.423 -> I2C device found at address 0x70  !
  11:36:33.470 -> I2C device found at address 0x73  !
  11:36:33.470 -> done
  11:36:33.470 -> 
  11:36:33.754 -> No I2C devices found
  11:36:33.801 -> 
  11:36:34.083 -> No I2C devices found
  11:36:34.083 -> 
  11:36:34.367 -> No I2C devices found
  11:36:34.414 -> 
  11:36:34.697 -> I2C device found at address 0x70  !
  11:36:34.744 -> I2C device found at address 0x73  !
  11:36:34.791 -> done

It looks like there is some sort of periodic thing happening. I tried different time values in the delay() function at the end of the sketch, it doesn't change anything.
I replaced the 4 expanders, the capacitors, the clock, the microcontroller, the voltage regulator, so everything except the sensors and LEDS, soldered new ones and the result is still the same.
I also tried to bypass the voltage regulator to get 5V in case the 3.6V delivered would not be enough, but same result again.
Probably worth noticing : the detection occurs only when I touch the expanders (the black package, not the connections) with my fingers and not with any other weight, so I thought that it could have to do with electrostatics. So I set a wire between the ground plane and the black package of the chip to force it to discharge, but it didn't work.

Has anyone run into the same problem?

Thank you

Aurel

Post the schematic of your design.

That effect is well known, at least to me. It is the "magic finger effect". it sometimes appearers that a circuit works only when you hang a very expansive oscilloscope on it as well.

These are hard to diagnose and there can be many causes. But eventually you will find something is wrong. For example what is the value of your I2C pull up resistors? If the answer is you have not got any then that is your problem.

A schematic is essential for a better guess.

Thanks for your answers.
Yes there are pull up resistors for SDA and SCL, both of 4.7kOhms.
Here is the schematics :

Well a lot of LEDs but no current limiting resistors? What gives?

Hmmm. Not designed for driving LEDs HIGH. :roll_eyes:
TCA9538 datasheet

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.