Author Topic: Circuit Design: HTU21D and ESP32-POE-ISO I2C Long distance Issues  (Read 1112 times)

0 Members and 1 Guest are viewing this topic.

Offline virtappTopic starter

  • Contributor
  • Posts: 11
  • Country: fr
Hi, i'm trying to design an interface to read a 10x I2C HTU21D from this sensor that is produced by a local factory here in France (schematics below) temperature and humidity sensor and send data to an mqtt broker using an ESP32-POE-ISO from olimex.

This is the sensor side sch:



In the MCU side i'm using the same PCA9306 in order to use 5V and go "far" (30m) from the main MCU PCB using CAT5E cable and RJ45 connectors (The I2C cables used are White-Green/Green for SDA and White-Blue/Blue for SCL).

The MCU circuit is very simple, basically there are 10 GPIO's used to enable the MCU side PCA9306 and "select" the right sensor to read.

The cable has a capacitance of 56pf/m, so 30 meters are 1680pf in total, higher than the maximum I2C limit of 400pf...i know that and i can't change nothing as project specs.

The I2C bus speed is lowered to 100khz and there are external pull-up resistor of 10k on I2C bus (ESP32 side) and 330ohm pull-up resistors on the PCA9306 bus side in order to counteract the wild cable capacitance of the bus.

Here is the schematic of the MCU Side (a part of the ESP32 MCU those components are repeated 10 times):



For some additional informations below there is the scope trace of the SCL bus signal measured at 30m away from the MCU pcb (SCL - CH1): As you can see, the clock waveform is really sharpen - In this scenario, data reading works but it's unstable: like 10 measurements wrong every 100



I've already tried to lower speed to 10khz, add precise timings to the Arduino sketch, etc...in any case, in my lab environment this works (with some problems, like 10 measurements wrong every 100) but when i go out of my lab, like in a datacenter or office, many times from all 10 sensors only one works and really i-don't-know-why!

Maybe is the ESP32-POE-ISO POE power extraction that is poorly designed?
Maybe is the ESP32 I2C interfaces that is a poor interface?
Maybe i have to add something that will filter noise on the I2C bus?

I have to use those sensor in industrial environments and offices...and i need to get them work: in the past there was an old hardware and they works without any problem...what i'm missing? what i have to modify/add to the schematic?

Many thanks in advance!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf