I2C design constraints

I had a “learning experience” when I was a callow youth of 19. I was working for Control Data Corp ( Control Data Corporation - Wikipedia ) at the time in their Australian Repair Centre (what a great job! Getting paid to strip down worn out electro-mechanical kit, then rebuild to new specs). One of this particular drum printer alignment procedures required 2 scope channels to be ‘added’ and to have the scope floating from earth. Needless to say, after I set this all up, I moved the scope cart while holding the frame on the printer. Ummm…not for long.

1 Like

Hi Gerard

Well, I don’t think you could do better than that. You might get a bit more rounding on the top of the positive going transitions if you use a bit longer cable but you should be able to live with that. All good.

You tend not to forget those “learning experiences” don’t you.
I mentioned the difference in voltage between “Technical earth” and “Mains earth” a while ago.
The worst case of this I have personally seen was at the Coffs Harbour TV TX site. The roofing plumbers were fixing the roof of the TX building and every time they withdrew a drill from the roof they were getting quite bad shocks. The roof was tied to Technical earth as was the antenna mast and everything else of a TV nature. The drill was attached to Mains earth (no battery drills in those days). When investigated the difference between earths was would you believe over 70VAC. The ground was very poor and the electrical authority had to drive some 20 odd extra stakes to get the “Earths” somewhere near the same potential.
Cheers Bob

Ps: That level converter is supposed to handle inputs of open drain and push pull which makes it a bit complicated. It is full of active bits like op amps gates etc and could do anything. It would be some task for someone very up on how it all worked to figure out just what happened here. Earlier I thought you were using one of the simpler types with just a Mosfet and I expressed a bit of concern about using external pull ups and one of these at the same time as this converter already has a pull up on board.

2 Likes

I can imagine. The worst shock I ever had was adjusting the yoke PCB on a colour computer monitor when I foolishly used the metal shaft of a tiny screwdriver to tweak a trimpot. Little did I realise that the pot wiper was at 600VDC. That was serious as I couldn’t let go of it. Can’t remember how I got free.

1 Like

So I got rid of the TMS0108 and, in turn, the 74LS14 as it now had no use… as I can drive the LEDs straight from the GPIO pins.

I also moved the I2C to a single location.

1 Like

Hey @Gerard163258,

Great to see this one up and running!

The PCB looks solid overall. One thing to watch out for is keeping the top ground plane as continuous as possible, try to avoid long signal traces that split it up, particularly under the ESP module. Dropping in a few stitching vias near decoupling capacitors and around the board edges will also help lower ground impedance and cut down noise.

Here’s an example where the ground plane gets broken by signal routes:

Look for sections like below where the top ground plane is cut by signal traces:

Back in my design days, I kept this book on my desk - Grounds for Grounding: A Circuit to System Handbook | IEEE eBooks | IEEE Xplore, It’s a fantastic resource and worth hunting down if you can find a copy :slight_smile:

Hi Gerard
Yes that looks nice and tidy. Well done.
As a point of interest, you seem to have a quick turn around for new boards. Do you have a tame board maker on tap or do you do it yourself.

I think there is one good lesson to be learned from this exercise. Keep things as simple as possible without too many “add ons”. The more bits that are “tacked on” the more complicated things become and can and usually do become pretty messy and the possibility of introducing problems which should not be there.
I think the main problem when trying to sort this sort of thing out is that in most cases the device has NEVER worked properly so there is really no goal to work to. You mostly can’t say the device has developed a fault and I can fix it. The “fault” could have been accidentally put there so it us usually hard to pin down.

One thing has come out of all of this. I personally have found out a lot more about I2C than I knew before (nothing) so thanks for that, and thank Michael and others who provided information on that subject and links to more info. Stirred my interest a bit more.
Cheers Bob

1 Like

I have a small company in China who I use, LZPCBA. The turnaround from submitting the plot files to getting the finished result is about 14 days. I would prefer a local mob but they don’t seem to be around anymore.

When I first started PCB layouts about 40 years agon, there were quite a few PCB builders and local assemblers. Of course, back in those days, it was Bishop Graphics, an HP plotter and photolithography. No EDA tools.

You’re correct. It was too complex but also unnecessarily so. Although, I’ve designed way more complex things than this but you can’t really beat simplicity.

Thanks for your (and Michael and Trevor!) help. Much appreciated.

2 Likes

Actually, @Robert93820 , I need your ideas about some minor changes to that analog soil moisture sensor op-amp design you cae up with.

2 Likes

Hi Gerard
OK. Start another thread or resurrect the old one.

There used to be a few advertised in Silicon Chip, have used one in Melbourne with success but I think that selection is reduced to one these days.
Market place page ,
Silicon Chip September 2025 - Market Centre.pdf (391.3 KB)
Or Google “PCB manufacture Australia”
Cheers Bob

2 Likes

Great to finally nail this issue… well done!

A related (?) question… re my PCB design, which is for a Pico on a board with a couple of I2C Qwiic connectors: Should I put an ESD thing on the board between the Pico and the Qwiic connectors?

Happy to move this to another thread … I probably have more questions about my PCB design (er… definitely…)

Cheers, T.

1 Like

Hi Trevor
What do you mean by

Cheers Bob
This thread is getting a bit long so you could do better with a new thread about “ESD things”

1 Like

Electrostatic Discharge device… and yes, I’ll start a new thread

On reflection, I suspect this is more for USB connections etc, I’m just following up “advice” chatGPT gave me!

I’ll start a thread about PCB design…

Cheers, T.

1 Like

@Gerard163258 Hi… can I ask what cable, length and connectors you used for the I2C devices? In my project I am at the point of dispensing with the PiicoDev I2C cables for my external device, and (hopefully) replacing with 6-core (or, just use Cat5…) I need one, maybe two more wires to the device (VL53L1X) in addition to usual 4 x I2C, hence 6 conductors. If it runs over a meter that would be spiffy!

If needed I can drop the frequency down on this I2C bus… as long as it works OK over a meter run.

Cheers,

T.

1 Like

While most of the “pre made” boards dont follow this, linked with no official standard, I tend to think the following makes sense (nxp are no fools so this would have come from testing and needs).
src: https://www.nxp.com/docs/en/user-guide/UM10204.pdf

1 Like

Thanks Mike. Would still lke to know what Gerard actually did on his project.

I was thinking of using a 6-pin DIN connector, and probably 8-core CAT-5, and play with the twisted pair connections on the bench, look at the CRO traces etc. and see if I can make it work.

I can’t really make out the connectors in Gerard’s pic in post #97. Looks like they are either twist-lock or screw… which I would also want. I also probably need IP67.. as mine will be somewhat exposed to the elements.

Cheers, T.

1 Like

Hi Trevor
From what I can read and mu couple of experiments on the bench the cable length constraint with I2C would be cable capacitance. Any pull up resistors will be in series with this cap and have a finite time constant as this cap has to charge via this resistance. This shows up as a “bending” or curving of the square wave corners. The term “stronger” pull up for lower values of resistance improving the shape would really be because the lower value reduces the charging time thus “squaring” the shape somewhat.

RS232 is restricted in cable length in the same manner. The specs lay down a maximum capacitance NOT a specific length (which is usually a couple of metres with a “standard” cable.
However distances like 75 metres can be achieved with the use of low cap cable and wiring techniques.

Low cap cable. Uses polypropylene insulation. yields about half the capacitance as PVC. Polyethylene insulation is lower cap again.
Rs232 is a 3 wire system, TX RX and Gnd. Use 2 pair low cap cable and have the TX and RX with their own mate as separate twisted pairs. Connect the mates together at each end then connect to signal ground. Even though the mates are connected together the TX and RX signals will behave as if they have their own twisted pair. I have used RS232 at over 75m successfully in the past.

I have wondered if using the same technique with the SDA and SCL lines of I2C would enable longer runs. While not an actually balanced line it showed remarkable improvement with RS232. Your CAT-5 cable should be low capacitance. A look at the data sheet should show. It is twisted pairs so if you select 2 pairs and wire as I describe it would be interesting to see how far you go.
Cheers Bob
Below is scans of an old Hartland catalog which should illustrate what I mean


1 Like

Hi Trevor,

Just saw this.

My current leads are 1m in length. What I can do for you is make a special lead 2m long and report back.

Gerard

1 Like

Thanks… but I really don’t need 2m. 1m will be just fine. I currently get by with just 500mm on my prototype, but it’s not ideal.

Please just advise cable type and connectors on your pic back on September 1st.

Cheers, T.

1 Like

Hi Trevor,

Apologies. I’ve been meaning to get onto this for days….

This is the cabling diagram that we’re using. Your I2C cabling is at the bottom. Cable P/N CBL_J5-8_P_I is the small internal cable and cable P/N CBL_J7-6_E_P is the 1m external cable.

I had these made in China.

1 Like

Thanks… GX12 was the bit I was looking for! I’ll get some connectors and play with some Cat-5 cable… unless you have a different cable you recommend???

Cheers, T.

1 Like