Gas usage totally wrong

Nice. No, actually it’s not nice at all! But it’s good I found out. What? That my gas usage sensor was not functioning properly anymore! What a bummer.

Looking at the gas usage charts of December of this year, I just couldn’t explain why it kept on getting lower and lower. Why… It took some days before I realized something was going wrong here. I started to doubt the amount of gas usage being reported. Only 0,05 m3 for a shower in the morning? That’s not what I recall; 0,20 m3 at least! Why is the gas usage more than 15 m3 on the 2nd of December , but less than 6 m3 on December 28th? That can’t be right. Something’s definitely wrong here.

So I wrote down the counter values of my RFXMeter and the ‘official’ gas meter and compared those two – totally wrong! 1.6 m3 vs. 2.5 m3 ??? Oh no…

Yesterday I sat down in front of the gas meter and watched the LED on the RFXMeter that blinks every 10 dm3 (L). It did blink, but not enough! I don’t know what has happened, but somehow the combination of RFXMeter/RFXPulse/CNY70 wasn’t accurate anymore.

Fixing this was not that hard.  2 potentiometers allow you to adjust trigger level as well as the brightness of the CNY70 IR beam, so after 30 minutes everything looked OK again. After writing down both gas usage values again and comparing them after 24 hours, confirmed the sensor was back on track…

So now I can start all over again; all the data of December is useless; I’ll have to wait at least a week before I can have a look and try to find patterns…

Plugging into a ‘smart meter’ would solve these kind of problems I guess, but having those in your house will likely create new problems…

Gas consumption under the microscope

I’m not really satisfied with how our Central Heating is functioning. Not that we have technical problems, but the way our house is heated isn’t satisfactory anymore. Maybe it has to do with the floor heating we installed earlier this year; I don’t know for sure – I guess it does, but to make the right conclusions, I need more information.

For example, here’s the chart for the central heating of December 24th & 25th, where you can see at what times and for how long it’s heating the house:

Why is there such a big heating interval in the afternoons? What’s the most important factor, outside temperature or the amount of sunlight? (the latter is definitely of influence cause the living room has a window on the south, measuring 2 x 3 meters…)

Looking at the right side of the chart below, we see the temperature in the living room (the red line) rising to 21.7 °C without any heating (green = thermostat setback):

Free energy from the sun; that’s very nice, but not good for keeping the rest of the house warm.. 🙁

I really need to create some more insight on all of the factors that influence the behavior of the central heating system.

So that’s what I am doing right now. I’ve added some virtual devices to my Domotica system to calculate some additional values from all the sensors I have.

  1. Break down total gas usage into 2 parts: gas usage for CH (Central Heating) and for DHW (Domestic Hot Water). I can do this cause my Remeha Calenta tells me whether there is DHW demand or not. This should give me a clearer picture of the amount of gas used for heating; ‘noise’ by someone taking a bath or a shower will be filtered out.
  2. Average Outside Temperature per day. For this I compared measurements from the nearest KNMI weather station (12 km) with my own outside temperature sensor and didn’t see a need to collect the weather data from KNMI, saving me some additional work. I’m going to use my own sensor for this. This sensor is probably not located at the right height, it’s mounted to a wall of the garage etc. which will result in an offset, but it should be good enough to use.
  3. Average light intensity in the living room; I have a Lux sensor in the living room and I’m going to use this one to monitor the average amount of light there.

These values should give me a more detailed view of what is happening and how much the influence of both outside temperature and sunlight really is; I know they do, but not how much..

With this I want to be able to explain the behavior of the central heating and explain the gas usage that comes with it.

I started  a webpage to do just that. It’s not finished yet; more information will be added like the weighted average of the thermostat setback during a day, average temperatures in the ‘other’ rooms and things like that.

What I really want, is being able to control the temperature per room: the bedrooms, bathroom, my office and the living room. That’s a total of 6 rooms. Looking at how much sunlight influences the central heating, I need a way to deal with that influence; but how? I will probably need to control the amount of heat flowing through the floor heating based on the temperature in the living room, cause when another room is demanding heat, I don’t want heat pumped into the living room when it’s already warm enough!

And I probably also need to control the radiators in the other rooms to get the right temperatures over there, cause I have the feeling that too much heat is going to the living room right now, leaving too little for the other rooms. But first, that feeling has to become a conclusion before I can move forward!

Merry Christmas!

The kids are having a good time with all the snow, and I think there’s still more to come. Winter has just begun! A white Christmas doesn’t happen that often, so let’s enjoy it while we can and forget about the ‘problems’ it causes for some of us. I mean, it’s always either too hot or too cold, too much rain, too much snow.. we humans do have an influence on the weather, but we can’t control it yet.. 🙂

Live with it; have fun with it!

Do it before you have to…

I have 5 VM’s running on a Microsoft Windows Server 2008 with Hyper-V. This homebrew ‘server’ has been running flawlessly since June 2008, but last week, after being “up” since May this year, I had some problems and I couldn’t find what caused them.

The first issue I had was that MS Outlook was very slow, especially when moving from one email folder to another; it took multiple seconds, really terribly slow.  Update KB2412171 was the cause of this, as I found out here. After removing the update from my system everything was back to normal; well, part of it.

I was also experiencing performance issues with my file manager; not on local drives but only on network drives. The cause of this was something else, which didn’t take long to find either: my Hyper-V server was almost out of memory, 7.99 GB of 8 GB used! 🙁 That can’t be good for performance, so it was time to reboot the thing and do some updating on the VM’s.

I never look at the Hyper-V host because it’s always running fine, but after 7 months of uptime it needed some attention. But unfortunately, in this condition, starting the windows update process on 2 VM’s  was not a good idea. Both of them had multiple large .NET updates in the queue which always take a long time, but now it took much much longer; 3 hours in total! Bye-bye to all other plans I had for my Saturday evening…

So from now on I’ll keep a closer eye on the Hyper-V host and update & reboot before I really have to…

Half-way there?

Today I changed some things on my previous setup, after testing & concluding that XBee IO Change detection doesn’t work during sleep, which I already anticipated.

I changed some settings in the XBee and I added a wire to Pin 9, the Pin Sleep Control Line. The XBee is now in Sleep Mode 5 (Cyclic Sleep Pin-Awake), which means the XBee wakes on timer expiration or when Pin 9 changes from high to low state. The latter (Pin 9 change) is what the extra wire is for; it connects the output of the Hall-effect sensor to Pin 9, so that when the sensor output changes, the state of Pin 9 changes also.

Now the Xbee sends an IO Data Sample frame each 28 seconds based on the sleep settings, but also when the magnet is being moved towards the sensor – because the XBee Pin 9 becomes low, the XBee wakes up and starts to send an IO Data Sample Frame. Great! So now I know instantly when the magnet comes close to the sensor; exactly what I need.

But that’s only half of what I need of course, because when the magnet is being moved away from the sensor, the sensor output (and XBee pin 9) changes back to high, but that’s not triggering a wake up of the XBee… hmm.

So I started searching the net and read about all kinds of latches, NOT gates, flipflops, and saw more circuits than I’ve never seen before in my life. I haven’t found what I’m looking for yet – I don’t even know if it can be done – but I’ll continue my search for a way to shortly ground the XBee pin 9 whenever the sensor output changes from high to low or vice versa.

Yeah I know, an ATMega, duh.

Preparing the software side

Watching bits and bytes scrolling over my screen is OK for a while, but when I want to do some serious analysis of what is going on, I need to write some software. I could create a very small app that would identify the ZigBee IO Data Sample frames and show me the relevant data in a human readable way; but actually, the simplest way is to extend my Domotica system; all I need is available in there. So I did just that. With a few lines of code I was able to extend my XBeeRadio class to support this new Frame Type – the rest (logging, database, historical data, GUI, remote control of outputs) becomes available for free. So I did:

A few lines of code

Running a second (development) instance of my Domotica system on my PC resulted in the following grid on my website:

XBee I/O pins exposed

I’m ready to do some testing…

MCU-less experiments

Some days ago I was reminded of the fact that the Hall-effect sensor I’m currently testing, could very well do without a JeeNode; a combination of this sensor with a XBee could maybe suffice as a wireless sensor. Right; so I made this breadboard setup:

A3214 sensor with XBee

It looks like it’s working, although I haven’t spent that much time on this yet. Yes, I do see incoming “IO Data Sample” packets, I see differences in the bits for “open” and “closed”, but I also see multiple packets (3, 5) where 1 packet would be perfect.

Another big issue is that in this setup the XBee is working in “No Sleep” mode, and that’s a no-go of course when this is going to be battery-powered. Do I want to use cyclic sleep and have IO samples sent at a regular interval? No!, that’s always too late…

Does the XBee Digital IO Change Detection work while it’s asleep? Probably not, although I haven’t tested that yet. But the manual doesn’t give any clue that this will work, so chances are small that it will.

Maybe I can do something with the “Cyclic Sleep Pin-Wake” Sleep mode? Never used that one before…

Or, use a different approach; use “a” circuit, triggered by the sensor, that will wake up the XBee, make the XBee send a IO Data Sample (this can be done with some specific XBee settings) and put it back to sleep after the XBee has finished sending the sample. That’s where I have used a JeeNode for so far .. 🙂 ; but maybe there’s a simpler solution?

Time to find out!

First test with the Mantis

After coming home from work yesterday, I had a couple of options to spend my time. I chose the Mantis, cause I really wanted to see how it would perform. I had already ordered 2 160×100 mm Copper Clad boards (learning new words all the time) some weeks ago, but…

Neh, the first try was done with pencil and paper; I wanted to see if all went well without the chance of breaking something.

This went well. Next – the real deal! I attached the board to the bed with a screw in each of the four corners (this MDF bed won’t live long cause i need one that’s a bit thicker) and homed the Z-axis with a ‘trick‘: when the cutter touches the copper plate, you could regard this as a “switch” closing, right? So I put the cutter and copper plate in parallel with the Z- end-stop as a 2nd switch! Now I could just move the cutter down to the copper plate and it would stop all by itself. That’s easy.. That’s a good idea for X- and Y- homing too I guess: a vertical metal plate and cutter both connected to the respective end-stop inputs. I’m gonna build something for that soon! The position of the cutter above the board is very important to achieve the right cutting depth; the copper clad board is 1.6 mm thick and cutting to deep would make it too fragile.

Back to the milling! Here’s picture of the milling process after 10 minutes. I chose a feed rate of 50 mm/min cause I had no idea what to expect. On this picture the cutting process looks OK, but you haven’t seen what it looked like after the next pass, and the next… there was a point where I began to doubt if any copper would be left on the board! I’m going to put the result on my flatbed scanner so I can analyze the result better.

First milling!

Some conclusions and ideas on how I’m going to try to achieve a better result next time:

  • The X-axis still needs some adjustment;
  • I think I need a better cutter (where to buy?) cause the edges of the cuts are rough;
  • The depth of the cut is constant in the area (40 x 60 mm) that has been cut;
  • I have to ‘tune’ the Eagle DRC settings to better match the cutter size;
  • The same goes for pcb-gcode.

Still lots to do, but the result of this not-so-well-prepared first try is encouraging enough to go on! 🙂

Added the end-stops

Last weekend  I spent some time on my Mantis again. The additional end-stops had arrived, so I mounted them:

Y+ end-stop

Y- end-stop

X+ end-stop

Fun

After that, I was busy doing all kinds of things, but none of them Mantis related: a X-Mas tree, some ‘experiments‘ with LEDs and LEGO, repairing a laptop and 2 movies later, the weekend was over. But I do get very close now to some serious testing! I saw the X-axis needs some more adjusting cause it’s fitted too loose to be accurate, but apart from that, I’m almost ready to go!

Now the software part gets important; I’ll have to read a bit more about G-Code and the most important codes, so that I can ‘read’ the G-Code myself and understand what it all means. And once I’ve created a G-Code file that works, the first test run will probably be with a pen or pencil instead of the rotary tool and a piece of paper on the bed, just to make sure the Mantis doesn’t make any sudden movements that can be damaging.

Would I manage to create something useful before the end of this year?

Timeouts result in new work

With several items out of stock and waiting for new deliveries, I don’t have that much to do the last couple of days. Well, that’s not whole truth, really… birthday parties and other social things can also consume a lot of time. This sounds a bit negative, as if social things don’t matter, but that’s not what I mean of course. It’s just that there’s less time left for all those other things I like to do. Most of the times this just leads to shorter nights… but not in December.

Another factor why I’m not that productive in December is that this month has always been one of the busiest months of the year for me as long as I can remember since I work for a ERP software house. New customers going live, starting a new financial year, doing inventory, starting up with new software etc. etc. always make those last weeks of the year very busy. Holidays between Christmas and New year? Not for me, but I don’t care if all goes well in the first week of January.

So there are a few good reasons to slow down my evening activities a bit during this month. Yep, I admit, I even watched 2 soccer games on TV this week. Normally, I hear my wife shouting “goal!” from the living-room, which makes me rush there and if I’m quick enough, I can watch the replay.. 🙂 OK, so I’m spending more time in the living-room these days. But this also has some side-effects; I’m suddenly behaving more like a “user” than a “creator” of my own Domotica system. And sometimes, that’s not such a bad thing at all.

For example, I am really missing some things on my Pronto! Picture this: I am sitting in the living-room, watching TV and I hear a “click” coming from my cell phone. This “click” tells me I have a new email, but since the phone is too far away to pick it up (about 5 steps), I can’t see what this new email is about.

And I really don’t like that; knowing that I’ve got unread email. But I don’t want to stand up and walk to my cell phone (or my PC or laptop) to check it either!

Aha.. a new item for my to-do list. I’m going to add email support to my Pronto, that’s what I’m going to work on from now, instead of watching something I can very well do without!