Acorn User
1st December 1986
Author: Bruce Smith
Publisher: General Information Systems
Machine: BBC Model B
Published in Acorn User #053
A system for remote control of devices via the mains is tested by Bruce Smith
Red Box
Most readers have at some time imagined plugging something into their micro to control an electrical device. However, very few people actually get around to doing it. I made a few vain attempts with my Atom years ago, which I had bought to control a telescope in the garden. I can say with all certainly the reason this grand project was never completed was the complexity and effort involved in wiring and soldering - not to forget programming. And, of course, your computer is tied up all the time controlling the whole thing.
General Information Systems (GIS), the brainchild of Acorn co-founder Chris Curry and staffed by many ex-Acorn employees, has launched a set of products known simply as Red Boxes.
Red Boxes allow a BBC Micro to control electrical applicances all around the house. The need for complicated wiring has been avoided by sending all control information along the house's mains cables.
Starter System
The Red Box starter system contains three devices - Red Leader, Red One and Red Two. Red Leader as its name suggests is the heart of the system, and contains a 6502 microprocessor, a 16K Basic ROM, 8K of RAM, mains transformer and mains modem circuitry.
Red One is effectively a computer controlled mains socket. Plug Red One into a mains socket and any domestic appliance rated upto 13 amps can be plugged directly into the socket on Red One. By programming Red Leader, Red One can be switched on and off as required, activating the item plugged into it.
Red Two contains a sensor which can detect movement through changes in the heat level in the area covered by its field of view. It can detect the human body up to several feet away and could be used for burglar alarms and switching on lights. It does this by sending a message to Red Leader which in turn will activate Red One to perform the task.
A single Red Leader will control any number of Red Ones, Red Twos and associated mains appliances.
A simple application of the Red Boxes kit could be to use Red Two to determine when someone enters a room and get Red Leader to cause Red One to switch on a lamp. This is very easy to do and to my great amusement, I recently spent most of a Saturday evening walking in and out of a room doing just that.
Menu Program
So now we know exactly what they are, how do they fare in proper use and how to you program them? The first thing you need to do is plug Red Leader into a suitable mains socket and then connect it to your BBC Micro via the RS423 serial port - a lead of suitable length is supplied for just this purpose. With the micro on, you type:
*FX2,1
press RETURN and switch Red Leader on and within a few seconds the Red Leader menu screen is presented and you are ready to start.
The next task is to install the other devices. Figure 1 shows the menu screen after Red One and Red Two have been installed. The process is simple: press N for New and you are asked to enter a name for the device. Suppose we had a lamp plugged into Red One, we could respond with Lamp. Now any reference to Lamp will access that particular Red One controller. As each device is entered, it is also allocated a device number.
To allow the correct device to be accessed, each Red Box has an identification number which the menu program then requests. The device is now ready for use. Red Two can be installed in the same way, and all devices can be activated directly from the menu by moving a bar up and down the list. Press S for Set and then type ON or OFF. The selected device will then be switched on or off as instructed.
The times at which devices are activated can also be programmed from the menu screen. On and off times can be specified and unless an R is inserted into the Repeat column the device will not repeat each day. The time itself is set using the C option, and works on a 24-hour clock.
With all your devices installed, pressing G for go will set all your programming into operation with Red Leader left in control - you can disconnect yourmicro and use it for other things.
All Red Boxes have a small override button, so that any applicances attached to a Red Box can still be manually operated.
Red Basic
The menu program itself is written in Red Basic and studying this gives a good insight into the sort of things possible. Red Basic is remarkably similar to the original BBC Basic, although getting to grips with the variety of new commands requires a little bit of practice. The 50-page manual accompanying the Red Boxes pack is in general quite good. However, an amazing omission is the total lack of programs written in Red Basic to demonstrate the system's potential. We'll look out for Red Basic listings from readers to carry on the yellow pages in the future. Table 1 lists the commands available in Red Basic.
Most of the menu options described in the menu program have their direct counterparts in Red Basic. Controlling devices from Red Basic is easy: if the device is called Lamp you simply use the command:
TELL ("LAMP", ON)
or:
TELL ("LAMP", OFF)
New devices can be added at any time with the install command, and removed with erase. A very interesting command which would have been worthy of inclusion in any language is every. This is followed by a number which is expressed in fiftieths of a second. When Red Basic encounters this command it will execute the instructions in the program up to the continue command every period of specified time. In short, you have a very easy-to-use interrupt-driven, multi-tasking sequence of commands. For example, the line following line will cause the current time to be displayed once a second:
EVERY 50 PRINT TIME$:CONTINUE
Similarly, the line:
EVERY 100 GOSUB update:CONTINUE
will call a subroutine called update every two seconds.
Once you have written a program in Red Basic, you can set it running and unplug it from your computer which you can then use for other tasks. Remember Red Leader has 8K of RAM in which your programs are stored. When you hook Red Leader to your micro it simply downloads a terminal program, so in effect your BBC Micro is simply a terminal! It also means that, by installing some new terminal code in the ROM, Red Boxes can be used on most home micros. A new ROM is planned for the Electron and Red Boxes will work on the Master and the Compact, though the manual omits to tell you to enter:
*CONFIG. BAUD 7
So if you have Master Compact ensure you do this first of all.
System Expansion
The Red Box pack could be considered as a starter pack - and not surprisingly GIS has a whole host of goodies on the horizon to build up your system. One of the first of these will be an analogue to digital convertor. This will give you the facility to control mechanical equipment and also read the state of analogue devices.
The hobbyist market is also being investigated and there could be kits emerging for brewing and a burglar alarms - no doubt to be christened Red Nose kit and Red Alert respectively!
To my mind one of the most useful new boxes will be the RS box. If you have more than one BBC Micro at home, plug an RS unit into each and they will be able to send data to each other via the mains at a respectable 2400baud.
Other useful applications that spring to mind include the use of an auto-answer modem. Ring up from the office and send the data down the line to switch on a light, slow-cooker, heating or whatever.
When you have devices operating in this manner, security is of the utmost importance. In flats, terraced houses and semi-detached houses it is probably that there will be a common or semi-common ring main. Therefore, if several people were using Red Boxes, it is possible that data could be intercepted, altered or trapped. A unique double random number encoding system has been built into Red Boxes that virtually rules out all possibility of this happened. To quote GIS staff, "the CIA might just be able to crack it, but no hacker could."
Recommended
There are not a lost of computer-related products that I go particularly overboard about - but this is one of them. I think I can best sum up my feelings by saying this is one of the few products I would actually go out and spend my own money on, and I am lucky enough to get a lot of kit free or very cheaply.
Red Boxes will allow you to automate your home very easily and at a modest price. The industrial applications are limited at present, but that will probably change. As educational devices for the study of control they are like Lego - easy to use and do a first rate job.
If you're not really into control then I think you would still gain a great deal of enjoyment in playing around with them.
For Mums and Dads looking for Christmas gifts, this is the present of the year - I might even buy the wife a set. I mean, she doesn't really want that mink, does she?
Red Boxes starter system, £129. Extra Red One and Red Two boxes, £34.95 each. Details from Electronic Fulfilment Services Ltd, Chesterton Mill, French's Road, Cambridge CB4 3NP.