Telemetrics and management of a building heating system with Raspberry Pi and Arduino ** Documentation is work in progress ** Last update: 2012-11-29 GoalsMy goal was to help the community manage and view a big building's heating control. Heating is controlled by 3 zoned thermostats, and gas boilers. For reliability and system safety, in this first phase, only the telemetrics (measusing and recording temperatures in quasi real-time, publishing on internet, with history) was implemented. Another goal was to keep the costs down, because the community budget was very limited You can see the hardware below. Not too attractive, but very good to be mounted on the wall. Theoretically IP 55, but because the USB cable didn't fit, not quite there. System Components - Hardware:
Total estimated hardware cost: $152 Software components
Some notes on the solutionTemperature sensorsTemperature sensors - Raspberry Pi InterfacingFor using 1-Wire sensors, there are several solutions. There are USB-1-wire interfaces (like ... ), I2C - 1Wire chips, and my solution, using a microcontroller (Arduino). The easiest solution would have been to buy a "cheap" USB-1-wire interface, and use it with OWFS / Linux (One Wire File System). However, my physical topology of 1-wire sensors means that 1 had 3 different buses, arranged in a star shape, the Rasp Pi in the middle. Because the USB-1-wire interface can only drive one bus, it wouldn't work. The other reason is that I already had experience with Arduino programming, I had several Boarduino boards at hand, and Arduino has a good 1-wire library, so it was very fast and easy to write a very simple software for Arduino which just reads all sensors (from all 3 buses) and sends it to the RaspPi with serial. Theoretically, the Arduino and DS18B20 would have been able to run at 3.3 volt, but I felt more used to running it with 5 volts, and I have plans for the future to drive 5 volt relays easily. [ TODO - Schematic here ... ] InstallationRaspbian, command line customizationSetting a fix IP address Command line and config parameters for kernel - TTY, memory split, USB problem 3G USB ModemI used the ZTE MF195 USB modem for the project, because this was cheap (used) and it had Linux support. It also has a nice green/red led, which was very useful while configuring it. I had no problem with it being locked (to T-Mobile) since T-Mobile has good monthly data rates here. I had to install and configure usb_modeswitch Because the modem sometimes didn't want to switch, I had to set up the usb_storage module so that it doesn't use the device. The following must be added to cmdline.txt usb-storage.quirks=19d2:1514:i My next problem was that the modem had to be setup for the network (T-Mobile) with a PIN code. I found the comgt package helps with this. You can set the PIN code into an environment variable, so you don't have to type it after every reboot (very useful). export COMGTPIN=1234 comgt PIN -d /dev/ttyACM0 comgt -d /dev/ttyACM0 I forgot to enable the 3G data package at T-Mobile, and it didn't work at first. Because of disconnects, I created a check script, which I am running every 2 minutes. This check for PPP connection, then reconnects. ZTE Mf195 + Ubuntu 11.10 (Hungarian) Serial interface to ArduinoLevel conversion, 3.3volt (Raspberry Pi) vs 5volt (Arduino) See also: Logmein HamachiTemperature sensing custom scriptsHardware |