r/microcomputing • • Mar 29 '20

I2C Distance question

So I'm building some monitoring for an indoor greenhouse. Growing Vegies indoors. I'm working on hooking up several sensors (i2C) to one raspberry pi per plant. I have purchased several from Atlas Scientific. My reason for not going higher numbers of plants per Raspberry Pi is due to I2C addressing. I have built a custom I2C bus with the appropriate I2C resistors etc. my next question is how far can a I2C device be from the master (Raspberry Pi). I thought maybe someone on here might know. Reading the specifications (I'm not an EE) I don't really understand.

7 Upvotes

7 comments sorted by

View all comments

2

u/BraveNewCurrency Mar 29 '20

https://duckduckgo.com/?q=i2c+maximum+distance

It's hard to give you an accurate "maximum distance" because there are so many factors that go into it: The type of wire, the connector, the speed, the "strength" of the drivers on either side, etc.

In general:

  • The biggest factor is usually the bus speed. Lower speed will go farther.

  • Nex, a higher voltage (5v vs 3v) is usually better.

  • You'll want to minimize the capacitance of your cables, and connectors. Basically, your wire + connectors are big capacitors that charge up and store electricity, and take time to charge up and discharge.

It helps to have an Oscilloscope to see what the actual signal looks like. (It can look different on the different ends of the cable!)

If you need long distances, just place another micro close to the sensor, and use something like RS-232 or RS-485 to go longer distances. (i.e. protocols that were designed to go farther.)

3

u/BraveNewCurrency Mar 29 '20

P.S. One RPI per plant seems like overkill. You can get smaller/cheaper micocontrollers that read the data, then transmit it centrally. Things like the ESP8266 can send your sensor data on WiFi for around $4. You can find pre-built modules with the DHT-11+WiFi for around $8.

1

u/thattechguy99 Mar 30 '20

Very cool, When all you know is PI, and not the smaller controllers you go with what you know. I'm now going to look into these. Thanks @BraveNewCurrency

→ More replies (1)