3

I want to use OpenHAB to make home automations using a Pi to run it and send and receive data from an Arduino, which will be controlling lights, reading sensors, etc.

But to avoid the cost of an Ethernet shield I want to connect the both via I2C. How can I configure the Pi/OpenHAB for this to work?

twski
  • 33
  • 3

2 Answers2

2

I2C isn't meant for long distance communications - you are better off to use Ethernet, or technology that is fit for the purpose you want to use it. I2C was originally designed for communications between chips on the same board - not long distances around a house.

See wiki and search for distance.

cdjackson
  • 31
  • 1
2

If you need something like I2C (in terms of typical data rate and ease of use) and want to avoid ethernet some other serial connections come to mind. For home automation, the typical distances in a home and the necessary data rates I'd go for RS-485. It supports quite some distances - up to 4000 feet (it's electrically a differential signal) - and also multiple devices on the same bus. Both the Pi and your Arduino can easily be made to work with RS-485 using their internal UARTS and a simple RS-485-Transceiver (a $2 device). Wiring could be done with essentially any twisted pair cable (UTP, STP, FTP) whatever you have available. For full duplex operation - if necessary - you need two pairs otherwise just one. So if you have some network cable around (even Cat3) that should do fine. The two additional pairs could even be used to power the remote device if it is low powered (otherwise the voltage drop might be a show-stopper).

Ghanima
  • 15,958
  • 17
  • 65
  • 125