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.