The control systemI have installed two ventilators, five temperature sensors and one humidity sensor in my basement. I installed one humidity sensor outside of my house, as well. The humidity sensors measure the relative humidity, but the sensors translate the values into absolute humidity by doing some math (see here). Below a picture of the controllers. The right circuit (red) is a controller for the ventillators. It contains two S202 S12 solid state relais to control both ventillators. The controller has a CAN interface to communicate with the left controller. The left controller (green) gathers the temperatures, humidity values from all sensors installed in the basement. It has a CAN interface and 1 wire bus interfaces. Also the circuit has a 24LC1025 eeprom to store the gathered data persistently. I used DS18B20 temperature sensors and connected them directly to the 1 wire bus coming from the controller. Both controllers use at90can128 mikrocontrollers.
The controllers have USB ports. When I wanted to get all measured values onto my laptop, I had to go down to the basement and dump out the eeprom values from USB. In the picture below you can see the humidity values of both humidity sensors from the eeprom dump. The data was gathered from mid 2011 to beginning 2013. In the middle of the curves you can see two lengthy interruptions. I switched off the control system, because I was renovating the basement.
This data gathering was pretty time consuming, so I prefered to have wireless and get the data from the living room or from the office. I needed something that works with wireless on the one hand, and retrieve the sensor data from the controller's eeprom on the other hand. So I came up with the raspberry pi.
Bringing in the raspberry piThe raspberry has SPI and I2C ports, but no CAN. So I need something which translates SPI (or I2C) to CAN. There are chips available for doing this. Such as the MCP2515 . The chip is widely available, and runs with 3.3V which can be powered from the raspberry pi. Also I needed another chip which is a CAN transceiver. It connects the MCP2515 chip to the CAN bus. I used SN 65HVD230D, which is also widely available and which operates also on 3.3V.
This is the schematic:
I soldered this all together with silver wire and now it looks like this from top, see picture below. On the left upper corner in the picture below you find the raspberry pi. On the buttom right corner you find the components from the schematic above: