Re: Problems after implementing weater functions


Laurent HOUSSAYE
 

An interesting extract from a forum :

"The insane sounding lengths like 10, 25, and 100m are perfectly possible, and I use the method often (with UART not I2C, but the method stands) when I need to put stuff together quickly. It's not exactly the best way, though.

The key is to know your input voltage threshold. Make sure the voltage drop in the ground lead is well below this, or else a transmitter at a high ground potential will not be able to pull the voltage low enough. Lack of tolerance for ground offsets IMHO is the biggest reason to use RS485 or can transceivers (I2C over CAN is mentioned in a few application notes).

Ideally, all devices will have their own wall wart and battery and no power will be sent over the ground wire between devices.

But, lets take CAT5 for example. CAT5 can't be higher than 52pf/m, or it isn't CAT5.

100m of 52pf cable has a capacitance of 5200pf or 5.2nf.

5.2n times 20kohms (pullup) gives a time constant of about 104 microseconds. That limits speed to about 10kHz or so.

Using 2.2kohm pullups, you could probably get to 100kHz.

I have heard that devices should have a resistor on SDL and SCK, because of the big capacitive load they are driving, of something like 180 or 200 ohms.

But honestly, I2C is not at all the way to go for long distances. CAN transceivers or RS485 used with normal UART is a robust solution with very good fault protection, ESD resistance, speed, distance, etc, at a cost of a dollar a chip or so, ground offsets don't matter nearly as much so you are free to carry power along with data.

The only downside is that a can transceiver can reach 70ma transmitting and 1 or 2ma just listening, so I2C or direct TTL UART might be useful in extreme low power situations, but consider how much time you actually spend sending."

It seems that if the reading frequency is low enough, there is a chance that the I2C communication may work over large distance. We do not need speed for reading weather sensors data, therefore I am confident it will work if we can drastically reduce the communication frequency on this I2C bus. I also may need to power the sensors with dedicated wall warts and not through the 30 m cable.

Join onstep-ocs@onstep.groups.io to automatically receive all group messages.