Forum

Share:
Notifications
Clear all

Home Automation - I2C Wired Communication ... Network Physical Setup ...

3 Posts
2 Users
0 Reactions
56 Views
(@boo-semi-retired)
Posts: 551
Honorable Member
Topic starter
 

this posting pertains to the setup of the physical wire to connect all the nodes (main host, mid host, end node) in HAS for I2C wired communication ... a node is a unit with an MCU (e.g. arduino UNO R3) in it. communication is done between MCU in a HAS network. a sensor is connected to a node (e.g. end-node) thru one of the pins (e.g. A0, D13, etc) of the MCU. a sensor in itself, cannot do communication with another node. it is the MCU, to which the sensor is connected, that does the communication on its (sensor) behalf.

as mentioned in other posting, I2C is a good option (also a lot cheaper than wireless) for a wired communication setup in a HAS because it only uses 2 wires - SDA for data and SCL for the clock. with a 7 bit addressing for I2C communication, you can have 120 nodes connected in 1 I2C bus line which is more than enough to start with.

as with any wired network, you need cables (wires) to physically connect each node. this can be done using an ordinary CAT5/CAT5e cable that are link together using an RJ45 connection. a CAT5e cable has 8 physical wires (4 twisted pairs) inside. using the 568A or 568B standard for wiring a patch cable as a guide, you can setup the items below based on the 4 unused wires (2 twisted pairs):
(1) 1 pair for the power line (+ and - line connection)
(2) 1 pair for I2C communication bus line (SDA and SCL)
tip - use the solid wire CAT5 or CAT5e cables, they are excellent for permanent wiring. added benefit, you can use the 8 individual wires for connecting the electronic parts on a stripboard or prototype board for creating some breakout boards for testing - just like jigs in woodworking 🙂 he he he.

always align your design setup to some standard, for this case, use ethernet (568A or 568B) standard because the cables your using was designed for ethernet communication. this will minimize problem in case someone accidentally plug a real ethernet cable to your HAS setup 🙂 ha ha ha ...

a typical 10Base-T or 100Base-T ethernet cable, uses 2 pairs (from the 4 pairs) of wires for communication. from my understanding before (e.g. i setup the LAN in our SG apartment before and i made all the RJ45 jack/cables using a crimper to hide all the wires), this are the green pair and the orange pair of wires. the other 2 pairs (blue pair and the brown pair) are not use. so, basically we can use this for the 2 items above and hopefully it will not cause any problem if a device was accidentally plug to the HAS RJ45 connection 🙂 ...

for (1), with this approach, all your node's power supply can come from a single source. picture this setup, one node (e.g. arduino UNO R3 as main host) can be powered from an AC outlet. if the 1 pair of wires for power is connected to the 5V (+) pin and GND (-) of this node, then any other nodes that connect to this 2 wires (also connect to it's 5V and GND pins) will also have the same power source. it's just like a typical electrical line with each node connected in parallel to the line with different pins.

the concept of the setup is basically the same as a PoE (Power over Ethernet) setup use to power IP cameras using the RJ45 cable. ours is just a crude version without all the other things to control the PoE - too technical for me :-).

in my test setup before, i use the brown twisted pair (brown and white/brown wires) for the power line because it's at one end of the RJ45 jack 🙂 - its wire 7 and 8 in the photo of a typical RJ45 jack

for (2), the SDA (e.g. pin A4 of UNO R3) and SCL (e.g. pin A5 of UNO R3) pins of each node is connected to this 2 wires. when done, each of the nodes (with it's own unique address) can communicate with each other using I2C. imagine the 2 wires as a loop with each nodes connected to each wire using a different pin (e.g. A4 and A5 pins for UNO R3).
take note that a node can only communicate with another node if they are connected in 1 bus line. same with (1), it's just like a typical electrical line with each node connected in parallel to each line using a different pin.

the only unused pair available in a CAT5e cable will be the blue twisted pair (blue and white/blue wire) which we can use for this I2C wires.

if a node from 1 bus line needs to communicate (for some reason) with another node in another bus line, then there is a need to handle the communication link between the 2 bus lines. one way of doing this is to have a common node (e.g. main host or mid host) that is connected to the 2 bus line which can then then handle passing of messages between the 2 lines.
although this possibility exist, based on my old notes, up to now, i still could not imagine an actual scenario for this to happen.
the thing to always remember in the HAS setup is that monitor-sensor/s and action-sensor/s for a particular event should always be in one bus line - this is the logical thing to do. adding of a new bus line should be looked at only as an expansion, to add more nodes/sensors into the HAS system once the 120 unique addresses has already been allocated.

if i can find my simple design (notes) for a wired connections, i'll post it later in this thread ... it's really so difficult to find my old notes scattered in my notebook and other external drives ... which is why it's important for me to catch up with my documentation and arrange them in an organize manner 🙂 ... cheers

Boo!

Attached files

 
Posted : 24/11/2015 2:35 pm
rsurnet
(@rsurnet)
Posts: 18
Active Member
 

Hi Boo,

Gamit po kayo ng differential line drivers for far nodes in your wired system. it can be used for i2c or uart protocol. For very far nodes naman you might want to try zigbee module (i use xbee dati sa wireless scoreboards). Fast, secure and reliable :).

 
Posted : 07/04/2016 10:38 am
(@boo-semi-retired)
Posts: 551
Honorable Member
Topic starter
 

in some articles i read, I2C was rated to work at 100m but i don't think i will have a distance that long 🙂 ... i'll check out the differential line drivers in case i need to wire an end node in a long distance ... thanks for the info ... cheers

Boo!

 
Posted : 07/04/2016 4:51 pm
Share: