I2C line on PCB V2 : no pullup ? no level shifter?

I was giving a look at the PCB V2 schematic (available in the 3.0.9 release of AOG) and I am quite surprised that there are no pull-up resistors on SDA and SCL. Are they embedded on the ADS1115 16-Bit ADC module ? If so, are they low enough (4,7 kOhm is commonly used) ? Internal pullup of the arduino nano can’t be used because they can be as high as 50 kOhm.

Then, I am puzzled by the 330 Ohm series resistance to allow the 3.3V MMA8452Q accelerometer to communicate on the 5V I2C line. This set-up doesn’t look really wise. I already had to communicate through I2C at two different voltages, and I believe the proper way to go is with a level shifter (https://www.nxp.com/docs/en/application-note/AN10441.pdf).

Maybe these points could explain why some people can’t communicate with the magnetometer with a wire more than 30 cm long (Bno055 - #3 by ropecope, BNO055 not work?). This shouldn’t be a limitation with I2C.

1 Like

I lost roll signal today. Just roll for no apparent reason. All other arduino things were working. I’ve wondered if i2c issues are some of my problems.

I ve done the level shift on both SDA and scl with a nmos transistor 2n7002 on each channel and it works perfectly
No complicated ic…but non more than 30 cm
Francois

@Francois I agree with you. Two NMOS make really proper shifters for I2C lines. I think I’ll go that way. I will also add 4.7 kOhm pul-up resistors on both sides (3.3V and 5V) to to avoid any issue.

I2C should be able to go further than 30cm. The only limit is the capacitance on the lines. Reducing the pull-up resistor values allow more capacitance. See figure 3 here : http://www.ti.com/lit/an/slva689/slva689.pdf
image
A CAT5 ethernet cable has 52 pF/m according to Wikipedia : Category 5 cable - Wikipedia.

The Autosteer arduino sketch V4.3.10 has the following code, line 195 :
//50Khz I2C
TWBR = 144;
So 4.7 kOhm should do the trick up to 400pF. This should allow for a few meters of CAT5 cable between the autosteer PCB and the magnetometer on the roof.

1 Like

If you Want to go to the limits in term of line capacitance and pull up résistor, you must considèr that the level shifter is not the best drive for I2c and it adds non négligeable résistance and capacitance to your line
Francois

More about MOSFET requirements for level shifting in I2C in this (old) application note from Philips : https://cdn-shop.adafruit.com/datasheets/an97055.pdf

Hi everyone,

An update about the I2C communication on my setup. I decided to use a twisted pairs wire (like phone cable or CAT5 cable) to connect the BMO compass and the MMA inclinometer from the roof of the tractor to the PCB V2. The total length of the cable is about 3 m. I used this document to draw the schematic : https://www.nxp.com/docs/en/application-note/AN10441.pdf.

I had to add two NMOS transistors (2N7002) and two 4.7k resistors to the PCB for 5V pullup. On the other side, I added two 4.7k resistors for 3.3V pullup and a 22µF capacitor to smoothen the sensors power supply.

I tried it for a few hours doing work in the field and the setup seems to work properly. I get MMA and BNO data continously.

Here is a schematic of my setup :
Schematic I2C over twister pairs

Some pictures :
DSC_0318
DSC_0319
DSC_0320
DSC_0321

An I2C extender like the P82B715 would be even more powerfull. It would allow to use even longer cables and would make the link even more reliable. It would be easier to have it included on the PCB though.

3 Likes

Hello folks,

Another update about I2C. After a few weeks of smooth operation, the setup I suggested in my previous reply began to show malfunctions : the I2C bus was sometimes ineffective, with the following symptoms : MMA dead, BNO dead, and WAS dead. I didn’t spend much time debugging the circuit, but the problems may have been caused by a capacitive load too high on the bus, a burnt NMOS, crappy soldering job, etc…

To fix the problem, I decided to design the I2C link again, from scratch, but this time using an I2C bus extender, namely the P82B96 from TI. It’s designed to drive I2C on two twisted pairs, with a capacitive load up to 4 nF ! Below there are the schematic of the whole system, and a few pics.

At the moment, this setup was tested in the field and showed good results : the link with MMA and BNO is strong and uninterrupted.

I intend to use this I2C extender in the PCB I’m designing at the moment.

2020-11-21 Sensors_circuit
Overall wiring diagram

2020-11-16 Carte capteurs V2 1_1
Cabin side

2020-11-16 Carte capteurs V2 4
Roof side

1 Like

Hello,
So how this roof system worked until now? Everything is okay? Stable? Maybe you are now using CMPS14 upgrade or another new system for heading?
Thank you.