Disclaimer and Social

This page may contain affiliate links. As an Amazon Associate I earn from qualifying purchases.

Monday, June 4, 2018

Run an I2C Bus up to 100' on Ethernet

Here's something I didn't know I needed. It's new breakout boards from Sparkfun and another, slightly different version from Adafruit that lets you extend your Arduino's I2C bus up to 100' using Ethernet cable. 

The Sparkfun version uses a PCA9615 chip and their Qwiic connect system. The Adafruit version uses the LTC4311 chip and their STEMMA QT connector system. Both breakout boards also have breadboarding holes for connecting to power, ground and the I2C lines either by soldering wires directly or with pin headers.

The sensors and/or the microprocessor get connected via the Qwiic/STEMMA connectors. The two systems are interchangeable. The long-run signal is sent through the Ethernet line.

The Sparkfun version requires a board at both ends. It also has an Ethernet port built in. The board actually translates the signal and passes it to the other board where it is translated back into an I2C signal. This version also has the ability to send mixed voltages for power and signal, with the configuration selectable by jumpers.

The Adafruit board is more like a booster/active-terminator. Placed (usually) at the beginning of the cable (next to the microprocessor) it boosts and cleans the signal so that it can be sent farther. You can extend the range with a longer run using just the STEMMA port, but will need to connect the STEMMA port to an Ethernet cable for really long runs. A short video explains why.

Both boards work well, so choosing the best option depends on your needs and hardware requirements.

I just spent the last year learning how to create reasonably reliable data packets for Bluetooth and LORA. Now, I can place sensors and displays 100' feet apart and still use the reliable native I2c protocol instead. 

These hardwired boards provide several advantages over Bluetooth, LORA or even WiFi.
  • Power is transmitted over the Ethernet cable, so you don't need to have batteries or power at the remote location. (Unless you're driving devices like motors or solenoids)
  • You won't need to reset and pair your RF devices anymore. No more dropped BT/LORA/WiFi connections.
  • Only one processor is needed. With RF communication, you need a brain for the transmitter and another for the receiver. With these extenders, you only need the one main brain to send and receive signals.
  • Less likely to be hacked than RF communication
Two situations immediately come to mind:
  • Place the sensors, controllers, and MCU in the uncomfortable or hazardous environment, but have the data-display and control panel in a safe, comfortable location. Great for monitoring and controlling machinery from inside the office. Say a greenhouse where the fans, pumps and lights are in a hot. humid environment but you want to see the sensor data and machine-status inside your nicely airconditioned office. In this scenario, the main power supply would be near the MCU so you can pull power for relays and motor drivers easily. It powers the MCU and sensors also. Only the graphical display, inside that perfectly cooled office, is running off the Ethernet extender
  • Place just the sensors someplace like an attic or crawlspace. You can monitor the temperature, humidity or water levels from the display mounted on an Arduino inside your house. Since the power comes from the ethernet cable, you won't have to crawl under the house to replace batteries ever again. 

I2C range extender over ethernet
Let's say I want to monitor and control some lights and motor from a distance. Here's a simple topology that might work. I can read the sensor data off an I2c capable display, and give commands to the MCU with control buttons on the display. This could be great for controlling lights and fans in the greenhouse from the comfort of the air-conditioned office.




I2C range extender over ethernet
Or maybe I just want to put some sensors in a remote location (attic or crawlspace) while keeping my central MCU and command panel inside. I might never have to access that crawlspace again - unless the sensors tell me there's a problem.


Remember, the boards do send power over the ethernet cable, but not a lot. So you might need to provide a local power source if you want to drive relays, motor controller boards, or even a big display. But the docs make it look easy, just change a few jumpers to connect to local power.

I will still use RF in some of my projects. And since this uses the I2C bus, you can still use RF on the serial lines for a hybrid system. If you need to transmit data for a half mile, or a couple of kilometers, then LORA or XBee is still a good bet. Or if  you can't run cables or the remote location changes frequently, then Bluetooth and WiFi are still good options. 

But both of these boards look really interesting for anything I want to install permanently in a nasty or difficult to access environment.

As an Amazon Associate I earn from qualifying purchases.
Shop through our Amazon links to help support this site.

Also find me on:

No comments:

Post a Comment