rogerjames
Junior Member
If better is possible, good is not good enough.
Posts: 61
|
Post by rogerjames on Dec 2, 2019 12:37:53 GMT -8
SHT30 sensor - extender cableIs it technically possible to use an extension cable for SHT30 up to 2-4 meters? If so, it is possible to buy such an outdoor cable from SwitchDoc Shop. The new SHT30 sensor has a very short cable and I would like to place the controller box inside the house, away from dirt and snow.
|
|
|
Post by SDL on Dec 3, 2019 15:43:38 GMT -8
Probably. Best thing to do is try it. The i2C bus has a limit not on distance but on the capacitance of the line. You should be able to go another meter or two.
If you find it doesn't work, tie another 5K Ohm resistor pull up from VDD to SDA and VDD to SCL. That will help.
BP
|
|
rogerjames
Junior Member
If better is possible, good is not good enough.
Posts: 61
|
Post by rogerjames on Dec 4, 2019 6:05:19 GMT -8
Thanks for the tip
I will test it when my WeatherPlus is brought to work :-)
|
|
rogerjames
Junior Member
If better is possible, good is not good enough.
Posts: 61
|
Post by rogerjames on Dec 5, 2019 8:29:50 GMT -8
SHT30 sensor - extender cable
Have found a thread that elaborates on the conditions around the i2c bus and what can be done to use lengths beyond 1 meter. Maybe it can inspire others ... electronics.stackexchange.com/questions/106265/maximum-i2c-bus-lengthThe 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.
|
|