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:

https://github.com/amvv/ArduinoOpenTherm

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, is...it 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 server...my 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.