This is my own project (TobiSan5). The aim is to make a Telldus product, the Tellstick Duo (a RF transceiver / receiver) work together with a Raspberry Pi and wireless sensors. The usefuleness of this configuration are obvioius: the ability to make a wireless sensor network with data storage capacity that could be applied easily to any problem, and which could operate on battery for a limited amount of time.
There is also a wider aim (further steps) to this project: Using open source software with a RPi to have a home autoation web server. This is like having a web interface to a network of sensors and actuators, with the purpose of managing and supervision of a home.
The backbone of this project description is the journal, where I will try to register every step in the process.
I just found something interesting for the further aim of using a Raspberry Pi for a home automation system: NexaHome (Developed and described in Swedish only, it seems).
After further communication with Niclas from FooGadgets, the problems with the Wireless Energy Meter (i.e. Wireless Pulse Counter - WPC) might soon be over. It should have worked "out of the box", but I guess the LED on my energy meter is just to faint. Niclas had previous stated that this was the first time that he heard about it not working. It was a disappointment that the modification with a extra resistor "under" the photoresistor (PT) did not help. Now, it's clear to me how I went wrong. Look at the following two drawings (sent to my by Niclas):I soldered the extra resistor directly to the PT, because this was the easiest. But then the signal out connection would not get the advantage of a higher voltage from more resistance. But what I should have done would require more work on the PCB, but I have to do that now. If I want to know if this could be made to work, I have to try. I suspect that it might work, but that the reading will be unreliable because of a much higher sensitivity also for noise. Because the LED on my energy meter is behinds a glass sheet, the only way to shield the PT-LED interaction is to box in the meter altogether. This will not look nice, and it will be harder to read the EM manually. Then it might be just as good to convert the WEM to a Wireless S0-pulse meter (after instructions that were given to my by Niclas).
I have also gone through some thoughts on this project. Altough the Telldus RF USB moule is fairly cheap and easy to use, the number of devices that play along with it is rather limited. FooGadgets are doing a good job to remedy this situation, but I am thinking that I could be using my time more efficiently by going ahead with another, more developed sensor system. But apart from home automation, which is a further step anyhow, the Telldus / RF technology seem to serve the primary purpose well: wireless sensor networks. Especially the quest for making a 1-wire-to-RD-module network out of DS18B20 binary temperature sensors together with the Tellstick Duo will be pursued further. .
I have done some information digging on the available (non wifi) wireless systems, as you can see below. I am being drawn towards the Z-Wave system. Ok, it is not exactly open source, but it seems like the developers have chosen this way also for the sake of the end user: with stricter limits on the developers of devices, the range of devices function in a more or less backward compatible and cross-brand manner.
The Z-wave project was initiated after the year 2000, so that it represents a fairly fresh start. After their own (?) Mark Walters, they account for about 85% of the marked for home automation and security. The Z-wave also goes nice along with the Raspberry Pi, and I think I've seen two promising projects already, one Rasplogic being one.
Over the last couple of weeks I have been trying to get the Wireless Energy Meter (WEM; actually, it is a wireless pulse counter - WPC, and FooGadgets will use this term for the next model). I have been in contact with Niclas at the supplier, to find a solution to the problem.
First I have tried to test the WPC with another voltage supply. I had been using a AAA battery pack, and I measured it to 4,3V while in use. I tried the sensor with a blinking light source (a torchlamp), and got a count of 201 p/m. When I tried the same with a 5V battery eliminator, I got a count of 186. Niclas said that this variance was caused rather by the impurity in voltage from the battery eliminator, than the voltage difference. But anyhow, when tested with the energy meter which I want to supervise, the WPC did not register any blinks.
I also tried to follow another lead: to modify the WPC by putting a extra resistor in series with the one on the main circuit board of the WPC. To do this I had to solder off the photodiode, but that would also allow me to put the diode on a cable, which would be easier to appy to the energy meter. The photodiode on the WPC seemed to be installed in a reversed way. Its cathode is connected directly to the PIC, and the anode is in series with R1 (47,3 kOhm). I soldered off the diode, and put in on a cable with a 22 kOhm resistor to the anode (in series with the on-board resistor). This modification had an adverse effect on the function of the WPC: it would still work, and I would get exactly the same ready as before with the torchlamp, but in order to get counts from the WPC, I would have to put the diode directly onto the torchlamp.
This left me with with two theories:
- The diode got damaged in the process of being soldered off (could very well be, since I am using relatively crude tools)
- The photodiode is not exactly a diode, but a phototransistor.
Update: Niclas answered, it is actually a phototransistor. Then the emitter (closest to the flat side of the plastic casing) is comparable to the cathode of a diode. That should imply that the transistor is mounted in reverse, and according to this source, it should not work properly.
Some links to photo diodes and photo transistors:
I received the Wireless Energy Meter from FooGadgets, and just had to try it out! I am sorry to say, that the result was disappointing. I think the blinking LED on the electricity meter might be to weak, or that the sensor is insensitive to yellow light, which color it has.
But I have made some progress: First I had to find out how to supply the little PCB with power. I saw red that it could have a supply either from batteries or from a transformator, and since this sensor should sit in a cabinet, it should have batteries. But where do the cords go on to be soldered, and how is the polarity. I could see two solder pads within a box labeled "U5". I reckogned that this was the supply pads, but I had no clue to the polarity, except that one pad was closely linked to the power-on led. So I guessed this was positive, but befor I did anything I wanted to check. The closest answer I found was, that according to PCB reference designator, the box should have been labeled "PS" for supply. I made a small battery pack out of 3 pc AAA batteries, and I soldered to cords to the PCB.
Connected to the batteries, the sensor seems to work. While I am tinkering with it, it reads a high number of counts, but most of the time it only reads 0.1, which I reckon is the minimum value.
Update: TelldusError: Could not connect to the Telldus Service (-6)
- I checked the internet for clues:
- Ticket at telldus.net
- Problem raised in forum
- I tried to restart Windows 7, and it worked again.
The day I opened the package from Clas Ohlson. This contained:
- Tellstick Duo from Telldus Technologies
- Remote thermo-hygro sensor (THGN123N) from Oregon Scientific
- The web site of Telldus provided software for the Telldus Duo on Windows 7, among other a telldus-core dll and a usb-driver (software for Linux and Mac also available; if one plans to use a RPi with Tellstick Duo, as I do, I know there is a ready-made SD-card image (automagically?)). Telldus developer wiki
- I looked for a Python implementation, because I am not skilled with using ctypes: Telldus has a blog, with examples of using the c-library directly in Python, but there even exists a Python wrapper for the c-type core constants and functions, available from pypi.org
- The online documentation of the tellcore-py package has code for a Python command-line tool: tellcore_tool.
- I implemented this code in my favourite Python IDE (Jetbrains PyCharm), and made a package as a new project, where I import tellcore_tools. First I moved the comman-line execution code into a standard if-clause (if __name__=="__main__":), so that it would work better with import.
- I got a ValueError from the tellcore_tools module on a calling of time.strftime("%F %T", time.localtime(timestamp)) -> I looked up time.strftime in the referance manual, and found that the format string parameters "%F" and "%T" are not listed there. I changed it to "%c" (local time-date format) instead, and used time.localtime() without a parameter (I realise that <timestamp> may refer to another value, I have to look into this).
- When imported tellcore_tools together with tellcore (py-wrapper), I could use the function print_sensors(sensors). The parameter <sensors> I got from the tellcore.telldus.TelldusCore class method sensors(). The result:
<blocquote> PROTOCOL;MODEL;ID;TEMP;HUMIDITY;RAIN;WIND;LAST UPDATED oregon;1A2D;125;22.5 C;35 %;;;05/01/14 08:46:17 </blockquote>
- Allow TellStick Duo to receive new protocols
- An RPi Telldus project
- Rasberry Pi på Svenska :: Använda en TellStick tillsammans med Raspberry PI
- Sensor network (wired) with Arduino + 1-Wire
- Helsinki Experimental Cooling Setup
- Richard Appleby - 1-Wire sensor hub out of an old wireless router
Interesting academic papers on wireless sensor networks Edit
Knowledge sources Edit
- 1-WIRE SENSORS AND NETWORK
- OPEN SOURCE HOME AUTOMATION SOFTWARE
- TELLDUS TECHNOLOGIES
- TELLDUS TO 1-WIRE
- COMPATIBLES DEVICES TO THE TELLSTICK DUO
- Z-WAVE + 1-WIRE
- Z-WAVE + RPI
Shopping for parts and accessories Edit
- 1-WIRE SENSORS AND NETWORK ACCESSORIES
- TELLDUS COMPATIBLES
- TELLDUS TO 1-WIRE