![]() |
Forum Index : Microcontroller and PC projects : Length of I2C and One Wire Buses (CMM2)
Author | Message | ||||
Nimue![]() Guru ![]() Joined: 06/08/2020 Location: United KingdomPosts: 420 |
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 RepublicPosts: 533 |
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 KingdomPosts: 420 |
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 KingdomPosts: 7937 |
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 StatesPosts: 3378 |
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: NetherlandsPosts: 5091 |
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: AustraliaPosts: 6283 |
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 StatesPosts: 3378 |
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 |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |