WeatherDuino Forum

Full Version: i2c help please
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I did a search here and on the internet and I am seeing conflicting information regarding how to wire my i2c SHT31 temp sensor. I plan to use some Cat5 cable that I have.

On a search of this site I found reference to twisting the VCC with SCL and twisting the Gnd with SDA.

On the internet I found reference to twisting the SCL and SDA together and VCC and SCL together.

And finally on another website I found reference to twist VCC with SDA and Gnd with SCL. I found that here. https://electronics.stackexchange.com/qu...-vs-p82b96


Suggestions:
  • Use 5V not 3.3V. Use I2C slaves (CMOS levels) not SMBUS that have TTL input levels
  • Use a shielded or twisted cable
  • DON'T put SDA, SCL together, especially don't twist them together. Twist SDA with VCC and SCL with GND, and have 100nF between VCC and GND at each end. (If you look carefully in the 82B96 circuit you will see that NXP show the bus wires arranged this way.)


So needless to say I am a little confused. On 1 of my Tx boards I have installed the 82PB715 chip so I assume the SHT31 will get plugged into the EI2C port? Do I have to get another 82PB715 and install it at the SHT31 end of the CAT5 cable or is 3ft of cable ok to use with just the single 82PB715 on the Tx board?

TIA
Hi,

I2C is a bi-directional bus, so strictly there should be a buffer at each end of a "long" cable, assuming that the SHT31 and host have similar drive capabilities (I haven't checked the data of either).  But for a 3 feet connection a buffer shouldn't be needed at all.

The main requirement is to reduce crosstalk betwen SDA and SCL, which is why they should not be twisted (or ideally even run very close) together.  The GND and VCC are assumed to be "clean" (no ac signal) so shouldn't produce any crosstalk; the presence of a dc "bias"on VCC  is irrelevant because we only need to consider capacitive coupling through the "insulation".  Most of the advice in your link looks very good, particularly using a 12 v pullup (if necessary), provided that the catching/clamp diodes are fitted reliably, preferably at both ends.

But the best aim is to keep the capacitance on SDA and SCL as low as possible, so (for example) using individually-screened coaxial cores would be a bad idea.  Unless there is severe "local" electrical interference (e.g. a large Switched-Mode Power Supply), perhaps the simplest interconnection would be a flat "ribbon" cable with the ETH/VCC on the two inside cores and SDA/SCL on the two outside cores.

All the above is based on a single master-slave interface, but if there are multiple slaves then a single "buffer" may help to isolate a "long" cable from a cluster of slaves and the host.  

Cheers,  Alan.
Alan,

If I am using the on board 82PB715 do I have to use a second 82PB715 at the other end of the cable? Or can I use it with just the single 82PB715?

3 feet is what I am guesstimating the length required because I have not received all of the parts yet to know precisely what I will need.
(02-06-2017, 18:33)danner Wrote: [ -> ]can I use it with just the single 82PB715?

Yes, I'm fairly sure that you can.

Standard I2C devices are designed to work with a "stray" load capacitance of up ro 400 pF (to Earth).  The 82B715 effectively spliits the bus into two "halves" so that each half can have a capacitance up to 400 pF.  CAT5 cable has a capacitance of only just over 50 pF/metre* so if only that and the SHT31 are attached to the "second" side of the 82B715, then the cable length might be as much as 7 metres (20+ feet).  Personally I wouldn't go as far as that because there are other factors such as crosstalk and "radio frequency" noise, etc., but 3 feet should be absolutely fine.

The 82B715 chips themselves are able to drive a much higher capacitance, so if you had a cable with very high capacitance (say 3000 pF) then you would put a 82B715 at each end, so that all the standard I2C chips are "proitected" (buffered) from that capacitance.

* The only cable I can think of with a capacitance that might approach 300 pF/metre is small-diameter "individually screened" coaxial cable as might be used for audio connections (e.g 4 cores for in/out and left/right in a sheath of < 5mm diameter).

Cheers,  Alan.
Thank you for the very informational reply and for your time. Have a great weekend!
The Tx board which will host the SHT31 is almost complete and ready for testing. I still have to get the Rx in its enclosure, but I am getting closer! :-)

The enclosure is just a cheapy one I got off of ebay. It's the same one used by cable companies in the USA for their MPOE/NID.

[Image: GyjliTa.jpg]
(02-06-2017, 23:30)danner Wrote: [ -> ]... but I am getting closer! :-)

It looks good! Soon all the leds will be blinking... Smile
Don't worry too much about how to connect the SHT31. With a so short cable (3ft) it will work with any of the I2C ports on the board, but as you have installed the 82B715 chip, connect the sensor to the EI2C port.
Just avoid using the SCL and SDA signals on the same twisted pair of the cable. Twisting the SCL with VCC and SDA with GND gives the same result than twisting SCL with GND and SDA with VCC.

Regards
Tx0 testing with flying colors. Nice to see the SHT31 and the BME280 agree on the temp! This is the SHT31 wired to the EI2C port, but the wires are only about 2ft long just for testing.

[Image: GkEz9qI.jpg]
In the process of a "burn-in" at the moment. The RX is in its enclosure and the TX board is out in the back yard connected to a battery while waiting on the mount for the solar panel to arrive. So far so good.

[Image: 3gvQPyr.jpg]
Perfect, Danner! Nice job, good work.
Congratulations!
Pages: 1 2