Tuesday, January 24, 2012

HCS II & DollHouse

As I said the other day, my thoughts on home automation have brought me back to the 1988 HCS II. At a high level view, the HCS II is a relatively simple system to understand. At the center is the z180 based Supervisory controller (SC). It has a RTOS and user language called XPRESS. XPRESS is basically a loop that supports if/then/else logic. There's support for 16 bit, signed, integer math and access to the devices. The SC's directly connected hardware supports analog input, digital I/O, a realtime clock, a system bus for expansion, RS485 for remote I/O (Comm-Links) & a RS232 user interface. The I/O attached directly to the SC is the fast I/O and the I/O attached to the remote Comm-links is a little slower but more flexible. Of course I want to update the system to take advantage of modern technology, like access to information on the internet and to have a nice web based GUI.

The first part of my project entails writing an Arduino based comm-link. This should make it pretty easy for various folks (hardware and software types) to get started. . I can then plug in my Linux box (with a USB RS485 dongle) to the existing HCS II system and the Linux Comm-Link software can emulate any of the comm-links. I can extend that to also be a sniffer without too much trouble (always a useful tool in diagnostics). Using high level languages makes getting the logic down pat before the harder, tighter code for the actual comm-links. I'll write the code in such a way that it should be mostly portable to the comm-link microcontroller. Worse comes to worse, it's portable at a psuedo code level.

Next I have a few new PIC32 chips waiting for something to do so I might as well take advantage of them. The 28 pin DIP version is pretty hacker friendly and would make for a very powerful comm-link. A bread board, the Chipkit Arduino-like setup, some simple IO and you're on your way. I've got a couple of the MX220 family (32K Flash,8K of RAM, they have support for USB also). I may attempt to get FreeRTOS running on the PIC32. Might be overkill for use with a comm-link but I'd like to learn about using a RTOS. The RTOS would replace the Arduino-like environment so that will be for more advanced users.

Yes, these technologies are not necessary but I want to learn about new things, which really is the point of me doing this. Then jumping ahead I'd like to get FreeRTOS & LWIP running on a top end PIC32 (has Ethernet too). This could be a replacement for the HCS II's SC. Then I'll attempt to get an SC emulator running under Linux. The top end PIC32 has the advantage of having support for a RTOS (FreeRTOS) but limited memory. An embedded system running Linux has a few advantages of its own such has access to tons of applications, libraries and languages. I haven't tried working with RT Linux so I don't know its capabilities. My end goal is to have the embedded Linux as the main SC, while the PIC32 based SCs act as remote SC to manage a network of comm-links. The disadvantage of Linux is the immediate loss of the direct/fast I/O. I could add a PCI board to handle that but that's a bit expensive (in one shot). I'd rather add IP nodes or, less prefereably USB modules for direct I/O. The IP & USB will suffer some form of latency whereas a PCI board shouldn't.

Well, many roads to venture down, only time limiting our travels.

Thursday, January 05, 2012

Open Source HA

I've decided not to do my Home Automation Presentation this year at the 2012 - Trenton Computer Festival as I'm still trying to deal with my new work load. I'm not very happy about it but I think I've learned enough over the last year to know that until I get a handle on my work load my spare time is reserved for eating and sleeping. It's gotten so bad that I've barely had time to code anything! I've managed a few quick Perl & shell scripts for work but that's pretty much it. That doesn't mean I haven't given a lot of thought to home automation, because I have. But I've come full circle and returned to resurrecting the HCS II. I've decided to go the Linux route as opposed to the FPGA route.

One of the issues I ran into with the Open Source HCS II was that even though some folks wanted to get involved they wanted more of the ready-made route. Building and programming these boards is a daunting task. Many were scared off by the thought of soldering, others the thought of the heavy embedded programming. Still others had little precious time to spare to their hobbies (now where have I heard that before? ;-) ). I need to somehow work around those limitations. Making easy entry into the HA market would allow people to become gradually involved. On that front, some really interesting developments have occured in the last few years to make that a reality. The most evident is the Arduino. The Arduino is an open-source electronics prototyping platform intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. A home is definitely an interative environment. For the central processing (Supervisory Controller) I'll use Linux on a small embedded board.

The good news is that the industry has stepped up to the challenge and there are plenty of Arduino like boards with enough bang-for-the-buck. I've picked up a few PIC32 Chipkit boards and intend to build a small Arduino like board based on the hacker friendly, 28 pin, PIC32 chips. Of course if I can't beat the price of the Pinguino PIC32 boards I'll just use them. I also know about the Leaflabs Maple. Like I said, interesting developments.

Monday, January 02, 2012

Happy New Year!

Well last year was not a good year (but it wasn't a bad year either). A lot of stress and change. I'm hoping this year will be a lot better. So far it looks like it's following the same roller coaster ride as last year. Let's see if I can get off this ride before it wrecks.

My wife picked out some very nice Christmas presents this year. I received man Dr. Who related gifts. One that sticks out is a Tardis USB hub. When you plug in a USB powered USB device it makes the Tardis noises and flashes the light on top. I took a look inside and found it has a GL850G - USB 2.0 Low-Power HUB Controller inside along with another board that controls the light and sounds. The second board is connected via 4 wires. I can guess 2 are power and ground but I'm not certain what the other 2 are for. I doubt it's USB as no ID shows up for the extra device when I plug it in. I'm also playing with the Microchip PIC32 so I think I'll drop one into the Tardis and see if I can get the Tardis to do more than just play the sounds and flash the light. :-)