Showing posts with label sensors. Show all posts
Showing posts with label sensors. Show all posts

22 October, 2016

rtl_433: simple daemon and tools

Last time I wrote about simple awk script that prints the latest values collected from rtl_433 application. I was pretty much satisfied with this "quick and dirty" solution until recently, when I needed to use the data from two different projects...
Right. It is time for simple daemon solution that will collect the data in format that makes it easy to be used from different clients. And here is my code:


#!/usr/bin/awk -f
BEGIN{
  FS=","
  cmd="rtl_433 -F csv -q -p 24 2> /dev/null"

  # Get csv column labels and count
  cmd | getline; csvNF= NF;  header=$0;

  while( cmd | getline){
    if (NF==csvNF){

      if ($2=="Proove") sensor=$3+$14
      else sensor=$3$4

      fn= "/dev/shm/rtl_"sensor
      print $0 > fn; close(fn);

      if (($5!="OK") && ($5!="")) {
        fn= "/dev/shm/rtl-BAT"
        print $0 >> fn; close(fn);
      }
    }
  }
}

07 March, 2016

rtl_433: simple text monitoring panel

There is this really nice rtl_433 "application using librtlsdr to decode the temperature from a wireless temperature sensor (433.92MHz)"  https://github.com/merbanan/rtl_433 which does exactly what is says. 

I just thought that I can write a simple script that will keep showing only the latest decoded data.
As one can see in the example output, further below, some of the sensors sends the data 3 times and if you have couple of them the data starts to get a bit difficult to read. With a small awk script (tailored for my needs) I can get this simple output that contains only the interesting data and few colors to prettify it:

===================================================================================
|        Time         |               Name             |  ID  |  Temp |   %  | Bat
===================================================================================
| 2016-03-07 10:26:19 | Gym - WT450                    |   61 |   5.4 |  84% | OK
| 2016-03-07 10:26:13 | Outdoor - Nexus                |   92 |   1.5 |  90% | OK
| 2016-03-07 10:25:51 | Indoor  - WT450                |  131 |  20.1 |  27% | OK
| 2016-03-07 10:25:45 | Outdoor - WT450                |  151 |   2.0 |  94% | OK
| 2016-03-07 10:25:37 | Ventilation - Nexus            | 1281 |  17.8 |   0% | OK
===================================================================================

01 May, 2015

Tellstick Duo revisited

For one or another reason I have replaced/upgraded my first Raspberry Pi (RPi) /256MB RAM/ with the latest RPi2 - the advantages are kind of obvious. I used to run the old telldus-core and now it was perfect time to upgrade it and rewrite my programs written in python with bash script using the new features in telldus-core-2.1.2.

I have tried before but failed with the device recognition and lost my patience to find the cause for the problem i.e. missing controller configuration - here is the solution.

There is really nice way to compile everything in a very clean way: instructions written in Swedish (perhaps here as well ). I got tempted to try the GUI suggested there but the repository was 5 years old which was clear NO to me.

Anyway, before I had python program running as a daemon to log selected device events and automate different switches + poor man's security monitoring solution. The only reason I was using python is to catch device and sensors triggered interrupts.

22 March, 2015

Universal thermostat CE UT-200

There is not much to write about it. It is an digital thermostat that one can easily use to maintain temperature below or above certain value. Conveniently enough, depending on the "on" and "off" setting you can set the thermostat in heating or cooling mode.


We have small room attached to the house that is not centrally heated and during the winter gets easily quite cold. We use it as gym, so maintaining a temperature around 5 degree seems reasonable enough (one can easily heat it better but of course it reflects on the electricity bill). I have hooked a regular 700W passive heating element that has its own digital thermostat, but that one is only regulating the temperature of the element.

I have Raspberry Pi that receives the temperature readings from outside and the room and in principle I can just use a regular remote switch that could be controlled by the computer. Except, that my philosophy is that I want to have a centralized system that controls the stuff around the house, but I want it to be also autonomous. I have the network version of the home automation module (Tellstick NET) and on couple of occasions when the internet connection was lost things could have got confused... Luckily, the local version (Tellstick Duo) is running independently. Unfortunately this one is also prone to failures, despite that it is running backed by UPS. So here is how I ended buying the thermostat.

Here are two graphs from the monitored temperature in the room (green line) and outdoors (red line), just to illustrate how well it works. The thermostat is set to switch on the heating below 4.5 and switch it off again above 5 degree Celsius.


Since it works as expected, I just need to mention the single disadvantage - it speaks German ;-)

25 January, 2015

D-Link DCS-935L: first impression


Well, I had ideas of utilizing some of my old stuff as wireless camera like Raspberry Pi (RPi) with an USB camera and WiFi. Or an old Eee PC netbook. The problem with the Eee PC was that is old, slow and a bit noisy. The RPi is also slow, with plenty of cables etc... An old Android phone comes closer for the purpose but... all would have had the very same problem - no real use in dark conditions.

So, I decided to buy a wireless web camera - something with decent resolution and hopefully with motion detection option.

The cheapest that have these specs (and I can easily buy) came to D-Link DCS-935L Home Monitor HD.

And straight to the good and bad of the camera.

19 January, 2014

Raspberry Pi and IR remote control with LIRC

I have been planing for a while to add an IR remote control to my RPi and the day came with the discovery of a IR set with remote control sold by Kjell&Company for a symbolic price.

First step first. I have added the receiver part since it does not require soldering at all. I have followed this manual to set and test LIRC on RPi with one exception - I use GPIO 18 as input from the IR detector. The set does not include any manual, so some research was necessary. The example code is for Arduino without any references to the specific hardware. Anyway, here I found the most relevant information. One can find example lircd.conf for some similar remotes but they did not work with the one in the package with label KEYES and distinct key pattern.

16 February, 2013

How long does it take to warm an engine up?

From time to time in some car or other forums, pops up a question of this sort...

How long does it take to warm an engine up?

Most of the answers are reasonable but lack any concrete data. Here I provide, as reference, some data for Renault Clio III 1.2 TCe 100.

At the time of the experiment, the car was less than an year old, at about 10 000 km, with all original parts. The numbers were collected from the OBD-II port via ELM327 Bluetooth type adapter and Torque Pro (OBD 2 & Car) for Android.
  • ambient temperature about 0 °C
  • air humidity almost 100%
  • city terrain (50 km/h speed limit) with no congestion, (just one slow guy in front of me for a while), 
  • AC on. 
For better understanding, some relevant parameters were also monitored i.e. engine RPM, speed and turbo boost.


In summary:
It took about 13 minutes and 8 km to fully warm the engine coolant without rushing. The engine is small and probably one can see that the temperature increase is smaller while the engine is idling (on the graph - shortly after the 2 km mark). The thermostat opens at 89 °C first, then drops to 79 °C and converges with attenuating oscillations between 80 and 84 °C

04 January, 2007

GRT-815M - common temperature values

I have found on internet many people looking for referent data to check if they computers perform well. I have posted already couple of times the common values of the temperature sensors for the model in a previously mentioned user forum, but they are quite difficult to find. This is the main reason why I am writing this blog.

The values are for an idle computer running under Windows XP Home SP1 or SP2 (AC power): use Mobilemeter to get access to the readings of the sensor elements.
quote from my original post:

Recently (2006. Oct. 8) I have opened it and cleaned the dust that was accessible from what one can see under the keyboard and now when the computer is idle the CPU temperature is 45c (dropped from 47c before cleaning) - the temperature in the room is between 22 and 24 degree Celsius - about 40% humidity - (this is not a joke - it matters). Under heavy load the temperature goes up to 69c-70c and stays there. The HDD temp. is usually 35c and goes up to 39-40c under heavy I/O load. I get the same numbers under Windows XP and Linux.

P.S. Consider 45c as a record - I have never had this temp. since I bough it.