Electronic – House wide automation network: CAN or Ethernet

armcanethernet

I am half-way through building my home automation system. As an electronic engineer/software developer a lot of this has been rolled myself from scratch and I will hopefully be starting to blog more and build up/publish my story and workings once complete.

I am now at the point of lighting automation. I have approximately 30 wall switches running a prototype touch sensor faceplate and I need to now connect these back to my Win7 Embedded automation computer. I also need to connect about 30-40 dimmers and relays.

As far as I can see I have a couple of options for protocols both at physical/application level and really am looking for any comments or advice on the below options, plus if anyone has any other suggestions.

Right now, all controllers are running off ARM M3 processors and I have both Ethernet and CANopen stacks available. The system needs to be "multi master" and ideally support both event driven (e.g. someone presses a button) and process driven (querying a sensor every 30 seconds, or asking a specific node a question).

CANopen

  • Multi-master and automatic error correction/collision avoidance
  • Process, service and event options for messages
  • Can be complicated to "virtually wire" up device. Lots of configuration potentially required
  • Cheap to implement in hardware, relatively scalable. Limit of 127 devices on a bus. Daisy-chain network.

Ethernet

  • Multicast UDP, or broadcast? Not sure which is more appropriate
  • Probably have to roll my own messaging protocol or API on-top to handle all the types of events I require, not sure about event driven actions
  • Star network, BUT could support PoE which is nice
  • More expensive in hardware
  • Much more expandable in software (potentially infinite number of devices, etc).

Has anyone got any comments or thoughts on which may be the best route to proceed? I have a feeling Ethernet may be the way but worry there is far more implementation required in software.

Thanks

Best Answer

Although you could use Ethernet and implement a TCP/IP Stack on each controller, and surely use UDP to broadcast sensor readings/commands/etc. I would recommend the use of CAN for the following factors:

  1. Easier to Implement/Code
  2. Very, very lightweight. You can integrate with smaller controllers. A MCP2515 can be used if the MCU doesn't have CAN.
  3. You could use CAT5/CAT6 and use the spare wires and carry 24V or 36V to power the nodes.
  4. The small message frame can be easily fitted inside a sub-1Ghz RF frame if you decide to extend the Bus over RF. You just need to code a CAN to RF gateway, maybe using el-cheapo RFM69 modules.

There's a blog that explore the use of CAN bus for similar use, might worth checking it out: talk2.wisen.com.au

Anyway, if you decide go with Ethernet, UDP would be better so you don't need to worry much with node addressing.

All the best!