Saturday, April 20, 2013

The Network

To have internet access to the control system, I decided to use the Raspberry Pi with the EW-7811UN wireless USB adapter which connects it to the internet router. My router can setup a dynamic DNS, so I am able to access the raspberry pi, without knowing the IP address. Having domain name is also convenient for the webserver programming, so the Raspberry Pi's webserver does not need to figure out the router's IP address. On the SPI port I added the CAN controller MCP2515, so the Raspberry can communicate with the other devices via CAN protocol, see Picture below:

There are two more controllers attached to the CAN bus: the 1 wire controller and the ventilator controller.

The 1 Wire Controller

The 1 wire controller contains interfaces for two 1 wire buses. I decided to connect the temperature sensors on the first 1 wire bus, and the humidity sensors on the second. The reason why I have a 1 wire controler is that 1 wire sensors are widely available. In theory they can even drive their power from the signal line. But I am not using the 1 wire sensors in that way (I could though). Sensors with CAN interfaces are less available, they are larger, they need power supply, and they are more expensive.

The Ventilator Controller

The ventilator controller uses two S202 S12 solid state relais to apply 220V to the ventilators to turn them on and off.

Final Words

Why did I choose CAN and 1 wire instead of using zigbee, FS20, or something similar with wireless? There are several reasons:
  • Zigbee, FS20 or anything else with wireless were not very popular or available during the time I designed the control system. I am not aware that there are sensors having zigbee (maybe there are, but I did not look), and if yes, I can imagine they are expensive.
  • I am a little suspicious about the reliability of radio controlled systems. E.g. the operating range of these radio controlled systems is rather limited. Probably I would have needed repeaters all over the house. And what if the neighbor uses the same FS20 system. So when he opens his garage door with FS20, he triggers my ventilators as well? 
  • All the devices need power supply anyway, so there must be a cable which supplies power somehow. In my system the devices draw power from the CAN cable.
So I can have radio controlled devices, which need power and probably repeaters (which also need power), or I install in a one time effort (I know it is not a little effort) a cable in the house with bus signals strands and power strands.


  1. hi,

    thanks for your helpful informations. Helps me figuring my networkconcept out.
    I've got two questions:
    Why are you using 2 1-wire-busses for your temp- and hum-sensors?
    Why did you choose the CAN-Bus for the connection between the raspi an the controllers?


  2. 1. Question: Probably you ask me why I have designed two 1-wire interfaces on the 1 wire controller. The reason was that I wanted to separate the temp sensors from the humidity sensors with hw. Accessing the temp sensors requires a different protocol than accessing the humidity sensors.
    Another reason was that the 1 wire bus strangs go into different directions. The humidity sensors are located somewhere else than the temp sensors. Having the node directly at the controller is convenient.

    2. Question:
    Because the atmel controller has CAN on it, and because I already use it for communication between the 1 wire controller and the ventilator controller. There is no other bus left but the 1 wire. 1 wire is slow though.

    Thanks for your interest.