The first customized hardware module I am developing for The Asia House’s home control system is the current measurement module. I chose to develop this one before the more critical local controller mainly because a good friend is working on similar application right now.
The idea is simple: monitor the current supplied to each electric circuit in the house, using a split-core current transformer clipped onto the input line at each circuit breaker in the main panel board.
The house has four panels with a total of about 90 circuits, including lots of spares. So the plan is to mount two current measurement modules in a separate panel, and wire them up to the current transformers at the other four panels. Each module will have 48 inputs going to multiplexers and signal conditioning circuits, subsequently connecting to the eight A/D inputs of the RCM4200 RabbitCore module. Each current transformer will induce about 2Vac across a 200Ω resistor at a 30A current.
This simple module is not a 48-channel power meter. To accurately measure power, we would have to monitor the voltage and current at each circuit and do a four-quadrant multiplication in real-time. However, by sampling and averaging the current we will be able to answer questions such as:
- Is the washing machine running?
- For how long are the water heaters turned on per day?
- Did the children turn off the lights upstairs?
- Is the sump pump still working?
The module will be connected to the house server via the LAN. I will also use the built-in master/slave feature of the RabbitCore modules such that a second module can easily be connected to the first one with a minimum of overhead processing and with a single LAN connection.
Today I played a little more with the SLCD Graphics Touch Terminal from Reach Technology. I’ve written about this screen in a previous post. The demo kit I bought has been sitting on my desk for months, and since the concrete walls are being finished in The Asia House now it’s come to a point where I have no choice but to make a final decision on whether or not to buy two more of these screens and install them in the house. So I decided to make a mockup of the actual user interface in order to get a better feel for the capabilities of this terminal.
The first thing I did was to try to improve the main screen image. Unfortunately, since The Asia House is not constructed yet I do not have an actual picture of it. I had to use the next best thing: one of the perspective drawings that the architect did.
The original version of my UI main screen was always flickering on this touch screen, and I always wondered why. I thought it was because of a low refresh rate on the screen, which was not very encouraging. But now I know better: I was using a non-standard palette. The SLCD only supports a single standard palette, and if you use a different palette in your .BMP file I guess it converts the image on the fly. So I converted my main screen using the standard palette, and now it doesn’t flicker anymore.
Unfortunately, the drawing is not optimized for this palette, so parts of it look terrible. I tried to clean it up a little, but it needs an overhaul by somebody more artistically inclined than I. In the screen above I also added a few push buttons, to see what it might look like in the final installation. I didn’t use the standard type of buttons that came with the demo kit, but decided to implement a (in my opinion) better-looking "floating" style of button. This also means that every button that "floats" above a bitmap needs custom bitmaps generated, which will be quite time-consuming to do for the final installation. At some point I’ll probably develop a software utility to ease the task.
I should add that so far I am quite disappointed with the quality of the development tools from Reach Technology. It took me half a day of trial and error to debug problems with macros. There does not appear to be any easy way to debug them, other than to upload, reset, and hope for the best. In the end the problems seemed to have been related to extra space and tab characters I had inadvertently added to the end of a few lines of code. Another thing I don’t like about the display is the time it takes to draw a new screen - painting a full screen from memory takes over a second, which is an uncomfortable length of time. Here’s a video mockup of a sequence where I simulate turning off the aircon in the Master’s Bedroom upstairs:
I have decided to stick with this SLCD Graphics Touch Terminal from Reach Technology, but I won’t be using its macro language since it is too awkward and time-consuming to debug. Instead I will be using the attached RabbitCore module to drive the display. There is a pretty good application note here that describes how to do it. All bitmaps will still be stored in the Flash memory of the SLCD. When I have the time, I plan to set it up such that I can remotely ftp all bitmaps to the RabbitCore module, which will then upload the images to the SLCD’s Flash memory.