Acorn User


Red Box
By General Information Systems
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.

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."

Bruce Smith