Friday, December 2, 2011

Now I'm in the mood

For doing calculations, as I have to ascertain whether all the effort was worth it or not.
So, I have this curve fitting against which I can compare my gas consumption based on the average outside temperature for the month. But his is done for a month, and I wanted to see if I could go to a lower level, so I found in the KNMI website a service from which you can download all kinds of meteo data for a time period.
I downloaded the average month temperatures for "De Bilt" as that is where I have been basing my calculations all these years, although not the closest station, and plotted it against the daily gas consumption. I couldn't go away without putting it here, so here goes, for the month of November:

Wednesday, November 30, 2011

Considerations on the boiler system

The behaviour I mentioned at the end of the last post, does make sense.
That is, for the boiler to overshoot by a few degrees, once it has reached the set temperature, and by those means bringing the return temperature to the set point is the only way of avoiding it to cycle more.
Once the boiler stops burning, the temperature of the outgoing water drops almost immediately to the return temperature, so to avoid it turning on again, the return should be close to the set temperature, and that is what the boiler is doing, thereby keeping the water in the whole system at the set temperature, and not at the return temperature that happen to be there when the set temperature was first reached... (I hope someone can make sense of all this rambling...)

The system , with the DIY OpenTherm master, has now been running for a few days, with no problems, and quite an accurate temperature in the rooms. The PID controller just needs some small adjustments in order to converge a bit quicker, and converge always (I sometimes have 0.2 degrees below the set point, which is no big deal anyway...)

I found a few graphics depicting the boiler efficiency as a function of the return temperature. Here are a few, all in Fahrenheit (didn't find any in C):

The last is not the efficiency, but the relation of water temperature to outside temperature that I am using. I use a curve near the "1" curve.

Saturday, November 26, 2011

On the way to a finished project

An enclosure is also important! and now that the OpenTherm interface is working, all the software is written, and I just put it to work less than an hour ago (lets see how that goes...), I also went searching for a box.

I went to my trusted shop, probably one of the last in Holland to sell components offline, it is the last one for at least 40Km around...probably more...and found some boxes from Hammond Manufacturing.

These are great, as they have card guides and can fit a Jeenode precisely!! here are some photos:


The low one, one has to cut the flange of the lid to be able to close it (and maybe grind a bit of the sides of the JeeNode), the higher one, which I will be using just fits it all with no problems!!

Here is also a graphic of the gas usage with the first hour with the OpenTherm:

before I always about 4 blocks of burning, as a saw tooth -  burning level increasing slowly, from 0.01 to 0.05m3 per minute in 4 to 5 minutes...maybe I'll try to get one of those images for comparison.

And a bit of the radio transactions already digested:

seq: sequence
set: set temperature received from server
out: temperature of the water leavng the boiler
ret: temperature of the water returning to the boiler
status: status of the boiler

seq       set   out   ret  status
3483    38    42    37    10    @    Sat Nov 26 16:04:19 2011
3523    38    42    38    10    @    Sat Nov 26 16:04:59 2011
3563    38    43    38    2    @    Sat Nov 26 16:05:40 2011
3603    38    39    38    0    @    Sat Nov 26 16:06:20 2011
3643    38    38    38    0    @    Sat Nov 26 16:07:00 2011
3683    38    38    38    0    @    Sat Nov 26 16:07:40 2011
3723    38    38    37    0    @    Sat Nov 26 16:08:20 2011

apparently, the boiler allows an overshoot, or tries to control the water such that the return temperature is controlled...still need to investigate this further...

Wednesday, November 16, 2011

OpenTherm interface ready!

If you have been following this, you know I have been busy getting a JeeNode (arduino compatible) to talk to the boiler suing the OpenTherm protocol.

I am glad to report that the circuit, which you can find here works fine, and the code available in github, is also functional! Sometimes it hangs when first connecting to the boiler, but a reset of the JeeNode solves the problem. Will try to investigate (I have some ideas)

Today I was busy finalising some details, and implementing communication with the server to get the set temperature. All is ready, except one little linking piece of software: the listener that listens to messages coming from the JeeLink has to now accept messages via the serial, which are sent by the module that calculates the set temperature. Maybe for the next post I make a diagram of the software layers involved.

Anyway, here is a picture of the little thing!

The little icons represent: radio link, OpenTherm link, flame, Central Heating, and Hot Water. T1 is the outgoing temperature, T2 is the return temperature, Ts is the set temperature, under the reported set temperature, and to the right of the Ts the received from the radio (for debug...will delete that). The 5 is just a number that changes once a cycle, and serves as an indication that the whole thing is still working.

You can see the yellow antenna, and the home made PCB, the one with the blue connector block.

I will get a PCB done externally, to learn how to do that (although Joao is taking care of that), and then get the whole thing in a nice enclosure.

The next hardware version will be to get the thing powered from the OpenTherm bus, which should be possible, as it provides 5mA for the master to operate. That should be enough, given that the radio only transmits once a minute!

Tuesday, October 18, 2011

New Dashboard

Progress of the OpenTherm interface is going very well! but that is not what I am here to report today. Today it is just a short post to share the prototype of the new design of my dashboard. My wife made the design, and I implemented the functionality. Still some rough edges to adjust. Here is a snapshot:

All information gets updated regularly via HTML5 and AJAX calls. Half of it is already working even, but there is still some to get done. I'll share the code once it is ready!

By the weekend I should report on the Opentherm!

Friday, September 30, 2011

Opentherm JeeNode shield PCB

Progress has been slow, but steady, in the opentherm front!

As I mentioned before, JCS is helping me out with the PCB part, and he has produced a nice PCB in the form of a shield for a JeeNode, which should be able to connect to the boiler! I leave to him to explain how he does his magic...

I have drilled the holes today, big victory for me, and now I just have to populate the board, cut it to the proper size, and develop the software.

I also still need to properly dimension the resistor at the detector optocoupler before I solder the whole thing on the PCB.

In the picture some resistors are still missing, but I just wanted to make this public! The designs and software will come soon!

i just realised that I should have included a couple of LEDs on the board to display status, but it can still be added in a later revision :)

Saturday, September 17, 2011

OpenTherm code repository

Times are changing, but it all stays the same...

I used to use some local version configuration tool, a long time ago, when I did software for real...then I stopped, and had all the troubles associated to the lack of one. Now, and only so that you all can enjoy, and hopefully help out with, the code I made for the OpenTherm thing, I decided to get an account at GitHub - seems to be the place to be - at host my code there!

So there it is, and you can find it at:

It is all still experimental, and not very well documented. The decoder is heavily based on the work by the palebluedot website owner. Thanks!!!

Friday, September 16, 2011

OpenTherm Circuit diagram

Here is a nice circuit diagram, made by JCS (from Coffee, Bits and Bikes), who is helping me with it.

The value of R2, which is indicated as 470 Ohm, is not yet final, as I still have to do some tests. The problem is the CTR of the optocoupler, which can be quite high, and so I will have to define the resistor such as to cause the transition in the proper place.
Next posts will be the code! so stay tuned!

Tuesday, September 13, 2011

More OpenTherm

Back from holidays! and with good news - I managed to communicate with the boiler using OpenTherm!

If you remember, the last time I managed to communicate, however, the boiler was not doing what I was telling it to do, namely, to heat up the central heating water to 35 degrees, instead, it was displaying an error state, and not a very informative one, in the small display.

Here is a picture showing the oscilloscope trace, where both the master to slave and slave to master burst messages are visible.

Since I had not implemented a decoder for OpenTherm, to analyse the reply from the boiler, I could not know what the boiler was complaining about. So I came up with a solution: I installed the OpenTherm arduino decoder found in the palebluedot site, and commented my emitter directly to the arduino with the decoder. As expected, the message was going with an data error. After finding a couple of bugs in my manchester encoder, I managed to get a correct message across.

Time to send the message to the boiler.

Another trip to the attic, and the boiler received the message, but didn't start heating up, but also no longer went into the error state. A careful read of the protocol, and I realised that I was disabling the CH when sending the message with ID=0. At the end of page 24, one can read that the "CHenable bit has priority over the Control Setpoint". So, another change to the message, another trip to the attic, and success!! The boiler started up, heating up the central heating water to the set temperature of 35 degrees!!

Next step is to implement the decoder in the same JeeNode, and the make a little PCB shield. After that, it is a matter of software, both in the JeeNode and in the server, to implement the communication layers, and of course, the much awaited and though of PID controller!

Monday, July 4, 2011

OpenTherm success

I have been waiting for someone to connect an arduino to a boiler using OpenTherm. Someone has managed to use some circuit and an arduino to listen, but I want to be able to send messages as well.

So, I read and reread the OpenTherm standard which is available, v2.2, and have been cooking a solution.

The thing is a current loop, so to read it, one doesn't need more then an optocoupler. to control it, one has to vary the voltage between around 5V and 17V, but the boiler provides a fixed current. So, if the current is fixed and you want (have) to change the voltage, you need to change the resistance.

My plan was then to use two optocouplers, one to read, and one to write the messages. Here is my circuit:
I used a 4N27 and not a 4N35 as in the diagram. The boiler connects at the terminals at the right, and the bridge is also an integrated bridge. The boiler side resistor is 2.2K and 1W, so not the normal low power resistors!! The arduino resistor is a 220 to drive the led.

I haven't yet connected the output of the other optocoupler, the receiver one, but that should not be much work, the worse is to detect and decode the pulses, but for that someone also wrote a library (see link above).

And the good news, works! or at least I think it does...

I tried first doing a PWM control, corresponding to OpenTherm lite (OT-) as defined in the standard, but my boiler doesn't seem to support that, so I wrote a manchester encoder, and sent a message to the boiler, and the boiler replied. It uses interrupt driven code to deliver the pulses with the proper timing.

I haven't actually decoded the reply yet, or sent any real commands to the boiler, I only saw the reply from the boiler in the oscilloscope. Images and code will follow soon...the camera had no battery to take a picture of the oscilloscope in that moment of glory!

Saturday, June 18, 2011

Home dashboard V2

Since the last post, not much has happened, but I have been busy with the dashboard.

I made some changes to it, so here it is:

The left dial is the electricity consumption, and the one on the right is the gas. They go from 0 to 5, so at the moment I took the snapshot, there was a very high electricity consumption - vacuum cleaner :)
The pointer indicates the instantaneous consumption, the white number the total for the last hour, the blue number (month) is the running total for the last 30 days, as well as the cost, which is simplz the number in blue multiplied by the average cost.

It is all made using HTML5 canvas, and AJAX (I think...). On the server side, php does the job of answering the requests. The thing updates every 5 seconds, and the temperature updates every couple of minutes. The agenda fetches data from google calendar and does that only at the moment the page is loaded, so the plan is to reload the page every few hours (my agenda hardly changes...)

I now have to polish it a bit, to display properly in portable devices - it works in android 2.1 - and to lighten the load on the database structure is far from ideal, and the requests take a very long time to process - 1 to 2 seconds - when most data doesn't change that fast.

Friday, May 6, 2011

Home dashboard

Here is my new dashboard for the house! this built with HTML5 and AJAX technologies (sorry if any of the terminology is incorrect, but it's hard to keep up with all these mash ups :)

This is a project that I have been thinking about for many years, and now I finally found the technologies to get it all together! And especially, the touch screens are becoming affordable, with all the tablets around, the final piece of technology will come together and I can finally stick a touch screen somewhere in the house, showing what the house is doing, and allowing control!

It became possible when I found out about RGraph, I then spent a night or two getting some graphs together, but they didn't look very slick, so I investigated, and I found a few nice dashboards, and then I almost copied one of them, this control4 energy, and after one night of iWeb, vi, php, and HTML5 coding, I got to the result above.

I think it looks really nice! I still have to make the whole interface language better and get labels closer to the fields, and that kind of usability stuff going on. This is an AJAX thing, fetches data every few seconds, and adapts the graphics and displayed information. The other pages, for gas and agenda, are not yet ready.
I am particularly proud of the pointer, which moves smoothly between the values, and keeps waving when it reaches a value, mimicking a real pointer on a car or analog meter - it's a pity I can not show it here...maybe I will do a movie...or put the html in here one day.

Hope you enjoy it!

As for the batteries of the RFID lock, they didn't last nearly as long as I had expected, so I am now powering them from a small adapter...will still consider powering them from a solar cell connected to rechargeable batteries.

Monday, May 2, 2011

RFID lock: ready! finally...

After years and years of thinking, googling and trying things out, I finally managed to finish my RFID lock!

So here is what it is: I have a door from the outside to the garden, which I use to get the bikes in the garden. There is a small slope leading to said door. I find it pretty annoying to have to go down the slope, get the keys out of the pocket, unlock the door, get in with the bike, put the bike in the shed, get the keys out again, lock the door. Especially in the rain, and in the winter, when all this implies the further step of taking the gloves out, and finding the lock hole in the dark.

For a long time I did not lock the door. I simply left it unlocked, but that always felt like a big security risk, so I started locking it. But in the back of my mind there was always the will to get it automatic. At work I have a badge which I use to get all the doors open until I reach the bike shed, and this is pretty easy to get out of the jacket pocket, even with the gloves on, so why shouldn't it be also easy to do at home.

So here is the final solution:

- a JeeNode, for wireless connectivity;
- a RFID reader module for Mifare cards, from Stronglink, an SL30
- an Abloy EL561 electronic lock (this is the expensive part of the project)

The RFID module is pretty nice, it uses I2C for communication, and can be put into sleep mode. Stronglink has a pretty good service too! quickest delivery - modules arrived in 3 days from Beijing - and when I had a problem with the power saving mode, they couldn't help me, but sent a whole new set of modules to replace mine, in case it was a hardware problem. The sleep mode problem is still there, as it doesn't quite work as expected, but I managed to get it to work in a procedure that is close to voodoo :) change something in the code and it mysteriously stops working. I wrapped it in FIMO to make a module to have on the outside, since the range on the sensor is not very big - about 4cm.

Then the Jeenode. It controls the whole thing, and when the card number is an authorised one, it closes a SSR relay, which provides 12V to the lock, thereby enabling it to be opened just by using the door handle. It also sends a radio message to the server informing which card was used. It does not yet using central authorisation, as I will need to get encryption going on for that. The Jeenode sleeps for most of the time, but wakes up every 500ms to check for a card, it then wakes up the SL30 module, checks for a card, puts the module back to sleep and sleeps again. It is now powered by 4.5V, so lets see how long before the batteries need replacement. I am hoping they will last a few months, but I will be glad if they last 1 month...

And the lock, is a pretty nice lock, which locks automatically, so the door is always locked also provides a lot of signals, like cylinder used, handle down, door open, and a few more I think, but I do not yet make use of them. I want to, but that will be the next hardware iteration.

There are a lot more details, but those are for next time.

here are a few photos:

The electronics box, with the Jeenode, 12V battery for the lock, 3xAA for the controller, and the cables coming in, one from the lock, and one from the sensor outside the door.

The sensor on the outside.

Wednesday, April 27, 2011

Heating season report

The temperatures around here have been souring, although today it is back to normal, with low temperatures, and the threat of a storm approaching, but I consider the heating season officially closed!
So here is a final report of this season - 2010/2011.
Last year we started pretty early with the heating, in August, due to the birth of our little daughter, and the fact that the end of August was pretty cold already, at the end, with the last days averaging less than 15 degrees.
After that, the boiler didn't stop working, during a pretty long and cold winter, with snow for about a month, and an average December temperature of -1.1C, when it is normally 4.0C.
Last year we got a new boiler installed, a new condensing boiler, so I was very curious to be able to compare the performance of this boiler to the previous old one with pilot light. Since that one spend about 0.7m3 a day just on the pilot light, I guess I would have about 21m3 a month less than usual, which, for the 7 months of heating translates to about 150m3 less, and about 90 euro of gas (about 60 cents per m3).
But, I could not do a proper comparison, since, with the arrival of the baby our habits changed a lot. First, the overall set point was raised by 1C, from 18C to 19C; second, my wife stayed at home for most of the winter on maternity leave, so the house was warmed the whole day instead of the usual night only; third, and similar to the previous, we spend most (if not all) days/nights at home, whereas before we were going out quite often for dinner, movies, parties...

With all these to take into account, I knew that it would not be easy to compare. But anyway, here are the values, and a small analysis (sorry for the bad formatting, but couldn't figure it out...):

month Spent Predicted temperature
August 38.01 59.553 16.8
September 65.75 121.541 13.6
October 150.74 217.062 10.4
November 309.34 413.124 5.8
December 523.18 837.144 -1.1
January 415.31 537.14015 3.5
February 350.72 475.666584 4.6
March 252.13 398.224854 6.1

I did not include April although for almost half of the month the heating was still on.

This leads to a grand total of 2105.18m3 spent, against a predicted (formula based on the first year of occupancy of the house) 3059.46m3. So we spent 69% of the predicted gas consumption.
The other years this value was around 55%, so there was a large increase in our consumption, although, the comfort levels were increased and the time the house was occupied also increased significantly. Maybe it would be a nice idea to make some statistics on this, since I have all the data available.
I cannot however conclude much about the improvement, since the usage conditions have changed so dramatically. I am nevertheless convinced that if I had kept the other boiler I would have spent more than the prediction.
So overall I am quite happy with the result. Next project is still to get a PID controller going based on opentherm (maybe starting with opentherm lite) to try to get the boiler to operate in its ideal range. Now it is still on/off control, which isn't the most efficient. I do try to run the boiler efficiently by limiting the temperature of the water to 55C whenever the outside temperature allows it.

Thursday, April 14, 2011

Thermal camera

This past week I got a hold of a nice infrared camera! or thermal camera or however those things are called...

Due to unforeseen circumstances, however, I didn't have as much time to play with it, as I had foreseen, but nevertheless, I managed to take a few snapshots.
The weather has also been pretty warm (as warm as it get in Holland...) and so it was difficult to get the ideal conditions to identify heat leaks.

One of the main purposes that I was interested in it, is that we are about to change the windows, which are now steel frames - ideal cold bridges - to some high-tech aluminium profile with high performance double glass. So I wanted to snap some shots of the current windows before the new ones come in so that I can compare. I will anyway compare in the energy spending next winter. By the way, the next post will probably be the energy assessment for the past winter.

I'll get the camera again once the windows are in! and the cold sets in!

So, there is not much to say about these, but the images are nice! Here are some samples, outside the temperature was about 6C and inside 15C:

Fig. 1: The iron/steel frames, almost as cold as the outside

Fig. 2: The house outside. Upstairs we already have the nice aluminium windows, with the super glass

Fig. 3: The electricity meter - gets pretty warm in there. It would be interesting to compare it to an old fashioned one.

Fig. 4: The CNY70 doing the gas metering

Fig. 5: Heating pipes when starting to warm up, the inflow is pretty warm , as the return is still cold. That is the best case.

Fig. 6: Old cast iron radiator warming up.

Fig. 7: GU10 spots - This one is a kind of CFL

Fig. 8: GU10 spots - this one is a standard halogen.

Fig. 9: GU10 spots - this one is a 3.5W LED

Fig. 10: Just a funny picture of a plug with a switch that I use in the computer to have it completely off when not in use.

Thursday, March 31, 2011

Garage door fix

This past weekend I went to dump a lot of the stuff I collect in my garden into the garage. It opened, I dumped all the stuff, and then, when I pressed the button on the remote to close the door, it did not close. Since the door is a bit rusty, I thought that it could be stuck. It wasn't. I tried to force some the movement, it did not move. I released it from the rail, and tried to get the carrier on the rail to move, no success. My neighbor, who is a part time mechanic in the local shop, was passing by, so I asked him, he looked at it, heard it, and suggested that the gears might be worn out. Conclusion, I probably needed a new machine to open and close the door.

So, since there was nothing to loose, I decided to open it up and check if there was something that could be blocking the mechanics of the thing.

Started to take it apart, removed the cover, the motor, a 220V asynchronous I believe (winding in the stator), looked great. Here is a picture of the machine without the cover, sorry for the quality of the pictures, goes to reinforce my disbelieve in mobile phone camera quality...

Fig. 1 - Machine with the cover out, the electronics are still in on the left, where the open cover is

I then saw the electronics compartment, which could be removed by disconnecting the cable headers, so I took it out to have a look, at least out of curiosity.

Then I started looking at it, and realized that there were 2 relays, luckily transparent, which looked a bit dirty, and started to trace how the circuit worked to control the motor.

Fig. 2 - Dirty relays, you can clearly see the sooth, and although the lower one is dirtier, the malfunctioning one was the top one

Fig. 3 - Another view. The machine was tested (geprueft) in March 1990, that is 21 years ago, I hope it will last another 21!

I replugged the electronics and pressed the buttons to see what happened. When the electronics were in the "door opening" mode, all looked well, when in the "closing door" mode, there was a lot of sparking in the relay. So I knew there was a problem there.
I ran to my favorite local electronics supplier - I am lucky to have a nice little shop literally around the corner (3 minutes on the bike) where the guys have all the necessary electronics components, and know their stuff!

So I went there, and after a discussion on the behavior of the relays, which could indicate other failures, we agreed that it could only be the burned contacts. He then disassembled the board to check the pinout, and gave me two new compatible relays!

I came home, removed the old ones, soldered in the new ones, and ran to the garage to try it out.
The result, a nice working door again!

Fig. 4 - Two old relays, one of the legs is missing, so I had to do the same to the new relays.

Fig. 5 - The PCB without the relays. The power adapter is 2x9V, so the relays are being driven at 18V instead of 24V, that might also not be good for the lifetime of the relays (me complaining about something that lasted 21 years)

Fig. 6 - The new beautiful baby blue relays in place and ready for action. Now with blue relays instead of the boring beige transparent ones, the machine looks like something from this decade! maybe I should change the green LED by a blue one to really bring it into the 21st century!

I then decided to change the lock as well, since I did not know where the real key to the garage was (never used the real key since we bought the house) and if the machine would fail with the door closed, I would be in trouble. So that included a late minute run on the bike again to another nice little locksmith, which knows me by now, and always has the right supplies! Of that fix I did not take any pictures...sorry...

I was very proud of my fix, finally the electronics practice with the little projects around the house payed off! 11 euro to fix the garage opener, instead of a new expensive one! Furthermore, I now found the user manual of the machine, a Marantec 100 confort, which, since it is german and from the early 90's, it is complete with a circuit diagram, which enables me to build a new controller if I so wish, maybe one with JeeNodes and solid state relays for reliability (more on that when it comes to the RFID lock!)

Saturday, February 26, 2011


The last post about the lamps, made me realise I have an older project, which I think was successfull, but never made it into here, so here it goes!

We have a small niche in one corner of the living room, and that had some shelves when we moved in, but they were not great, and besides, we had to completely renew the walls and so we took them out.

Original shelves (and wall color)

During the renovation process

We wanted some thick shelves, and thought of multiplex, 3 or 4 cm thick, so we went to the shop, and found a nice thick kitchen counter. We had it cut into the proper sizes, to the surprise of the operator there, that asked 3 times if we knew that that was a kitchen top.

I then routed a groove on the sides of the shelves, attached a small guide to the wall and sliped the shelves in. I am too lazy to take pictures while making it, so sorry for the lack of those.
This is the result.

That angled piece of wood is a bottle holder, also my own creation, very very simple. I might make a post about it soon! In the first picture you can see it with 3 bottles!

Tuesday, February 22, 2011

Ikea lamp

I still didn't manage to install the RFID door lock - still cold around here - so I have to do stuff inside the house!
Last year we redid the bathroom and toilets, and that included the corridor upstairs, which got a place for 3 wall lamps, instead of the hanging lamp that did not illuminate much.
So we spent lots of time looking for lamps (more than 6 months) and never found anything we liked. Even the painter, with whom we have a subscription (he should pass by every month to fix this and that), complains with us that we still did not get lamps...

To put an end to that, during a visit to Ikea, my wife had an Idea(TM - ideas from Ikea) for making a lamp...using a fruit bowl.

So we got one, and I started devising a way of installing it in the very small junction box. The final solution was a very simple 2 long M4x40 screws, on which the lamp then hangs. I installed a white lamp holder, and here is the result:

You can see the two screws on the top - I want to dip them in tippex or white paint to make them white... - there is actually just one place of all the flowers where it is possible to secure it like that.
You can also see the black hole of the junction box - that is to be covered with a piece of white rigid plastic.
What you can also see, are the 3 little rubber feet of the fruit bowl...I did not take them out as I am afraid the paint will come out...but they will have to come out sooner or later.

As for the effect when the lights are on:

It is difficult to photograph the real effect, but I can assure you that it looks very nice!
I must get some weaker lamps though...I have now 7W CFLs and with 3 of them it is a lot for such a small corridor...