Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:59 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Length of I2C and One Wire Buses (CMM2)

Author Message
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 420
Posted: 10:01am 18 Feb 2021
Copy link to clipboard 
Print this post

Via Dr Internet it seems like I2C busses can be from 3-100m depending on the speed.  Slower = longer.

One Wire seems to be about the same length restrictions.

Is anyone here using I2C / one wire devices on a bus of 20 - 30m?

Nim
Entropy is not what it used to be
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 533
Posted: 10:13am 18 Feb 2021
Copy link to clipboard 
Print this post

I have used it on 20m without problem and my friend used 100m... But just DS18b20 (more of them), nothing else. And it was no parasite power used.
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 420
Posted: 10:31am 18 Feb 2021
Copy link to clipboard 
Print this post

  jirsoft said  I have used it on 20m without problem and my friend used 100m... But just DS18b20 (more of them), nothing else. And it was no parasite power used.


Thank you.

Looking to move my DS18B20 x 2 (inside and outside temps), CCS811 (Classroom CO2) and BME280 (pressure / humidity) away from the CMM2 into a nice ventilated case.

Cheers
N
Entropy is not what it used to be
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 12:26pm 18 Feb 2021
Copy link to clipboard 
Print this post

It depends on your cable and site. Max bus capacitance can be regarded as 400pF for use at 100kHz. For long distances you may need low capacitance cable to keep it below that. Also, pull-up resistor value changes the range. It can be advantageous to use constant current sources rather than resistors.

This NXP document has a lot of info:
http://www.nxp.com/documents/user_manual/UM10204.pdf
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 01:24pm 18 Feb 2021
Copy link to clipboard 
Print this post

I've run 10 meters on Dollar Store 3-wire mini-stereo cable for DS18B20s (5V).

For extra-long I2C I've used the P82B715PN DIP PHILIPS i2c extender (on 50 feet (15 meters) of CAT6).
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5091
Posted: 07:04pm 18 Feb 2021
Copy link to clipboard 
Print this post

I2c stanard is developped by Philips to communicate between ic's on a printed cicuit board. This is a controlled environment with limitted bus length. The i2c bus design is not robust per design. Compare i2c to ethernet to understand the difference. Ethernet knows collision detect, retries, cable compensation.

Although every situation and location is different, i would never use i2c outside its controlled environment (read: closed box) , especially not if the application is mission critical.

Just to give some background info on this: i am a senior electronics engineer and have been fighting the lack of immunity of an i2c bus sytem for ESD for the last weeks. If you have a noisy environment (esd or surges or eft) the i2c bus is a baby that requires very soft gloves.....outide the house is a typical uncontrolled environment with lightning, esd, power grid, ground loops, motorcyles(ignition ), belt grinders, milking machines, radio and tv transmitters, whatever your environment has.

In short: if you want to measure humidity outside for fun: go ahead and use i2c sensors.
If you plan to control your heating system, or solar farm with sensors, please dont use i2c but look at 20ma sensors (industrial) or rs485 serial with preferably a modbus protocol.

Volhout
Edited 2021-02-19 05:05 by Volhout
PicomiteVGA PETSCII ROBOTS
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 08:27pm 18 Feb 2021
Copy link to clipboard 
Print this post

I have used I2C over a few metres in quiet locations as a short term fix but my preferred method is use a satellite Micromite 170 with the sensors and run RS422 over cat 5 or 6 cabling. I have runs up to 50-60 metres. The same cable also supplies the power to the sensor module.

I have lost some of the equipment due to lightning strike but seeing that I did loose just about every electronic device in the house with one strike a few years ago, I do expect the occasional loss.

Jim
VK7JH
MMedit
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 09:05pm 18 Feb 2021
Copy link to clipboard 
Print this post

Another alternative is to go wireless if you have power at the sensor location. An esp-01 or d1 mini can control the sensors and write their readings to a web page. The CMM2 with an esp-01 can read the web page and harvest the data.

I've just done that sort of thing with an F4--posting later today.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025