Skip to main content

Posts

Showing posts from January, 2014

Raspberry Pi Temperature Data Recorder - Part III: Visualization

<- Part II: Data Collection Once we have accumulated some data in the RRD database, we can start generating some plots with the RRDTools built-in graph function. The graph above shows the values of the DS18B20 temperature sensors over 3 unseasonably warm days in January. Because of the short cables, the sensors are not optimally placed. E.g. the inside temp sensor is relatively close to the radiator, the outside one is on the ledge, just outside the window and still behind a partially closed shutter in a narrow alley between 2 old poorly isolated buildings. According to the weather report, the current outside temperature is about 3-4 C less than what the sensor shows. From the chart, we can see that the heater feed temperature seems to fluctuate a bit, maybe a sign of  hysteresis  in the burner controller. The heater temperature is also lowered a bit for about 6h during each night, but this seems not to have any noticeable effect on the room temperature. There are small gaps in

Raspberry Pi Temperature Data Recorder - Part II: Data Collection

<- Part I: Hardware In the previous part of this tutorial , we looked at how to connect a few DS18B20 digital temperature sensors to a Raspberry Pi and read their values. The next part of the problem is periodically collect and record these measurements and store them for graphing and further analysis. It is always possible to store measurement data in a general purpose database e.g. SQLite or MySQL  and then plot the data for example with the Google charts API . For this project however, we are going to use RRDTool , which is a special purpose database optimized for recording, aggregating and graphing time-series data. It is particularly popular for network and system monitoring applications and for example at the base of smokeping  which we used in an earlier example . However this time, we need to configure and setup our own database from scratch. Some of the reasons why RRDTool is particularly nice for this type of application: Fixed-size, fixed-interval sliding

Raspberry Pi Temperature data recorder - Part I: Hardware

The Raspberry Pi seems ideal for all kinds of "physical computing" applications, as it is small, cheap, low-powered and yet more powerful and feature rich than a traditional micro-controller. One way to showcase such applications in an educational context could be to control science experiments which require long term measurements and data collection. One of the easiest measurement sensors to connect to a Raspberry Pi is the DS18B20  digital thermometer,. It can be read out via a multi-device 1-wire bus that is directly supported by a driver in the Linux kernel. Several sensors can be connected in parallel to the same data-wire and read out individually over the bus interface by their hard-coded IDs. All we need to connect one or more DS18B20 sensors to a Raspberry Pi, is to connect the VCC pin to 3.3V, GND to GND and data to GPIO4 on the Raspberry Pi GPIO header as well as connect a 4.7k Ohm resistor between the VCC and data lines of the sensor. The sensor is available

Wi-Pi : 802.11 Networking for Raspberry Pi (EW-7811Un)

One of the most conspicuously absent standard interfaces on the Raspberry Pi is built-in support for 802.11 WiFi wireless LAN networking. A low-cost, low-power way to remedy this is for example the Edimax EW-781Un USB WiFi adapter which plugs easily into one of the USB ports on the Raspberry Pi and is supported out of the box by the current Raspbian distribution. It seems to be very popular for use with Raspberry Pi and is available for about $10 in many places where Raspberry Pi are sold. WiFi Client Connecting to an existing WiFi network is trivial, once we know the SSID and access password for the network we are trying to connect to. After plugging in the adapter, it should be automatically recognized by the linux kernel - the output of lsusb should contain an entry like this: Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS] In order to connect to a typical home wifi network, we only need to add the f