Guest techie Paul Gardner takes a look at what could be the ultimate add-on for your Spectrum. It’s all in a little Red Box from ELECTRONIC FULFILMENT SERVICES
What do you think is the ultimate add-on for your home computer? How about another computer... New from Electronic Fulfilment Services LTD is the Red Box system, a home computer specifically designed for house-hold automation and security.
The Red Box system starts as a set of three devices that you can plug into your household mains supply. Red Leader’s a small computer system with a built-in programming language. This can communicate with and control the other two boxes supplied with the starter package: Red One, effectively a mains extension lead with an enclosed remote control relay, and Red Two, a thermal movement sensor that can detect the movement of people within a room and transmit this information to Red Leader. The devices communicate with each other by transmitting radio frequency signals along the mains wiring in your house.
The system arrives neatly packed in polystyrene and each device is a self-contained unit which simply plugs into any standard three-pin mains socket. Each device is fitted with a quality moulded plug which also contains a fuse of the correct rating. Instructions are included on how to change these plugs if your house has non-standard sockets.
A slim (50 page) manual is included which gives very clear instructions on how to set up the equipment. For the Spectrum this is very simple. Power up your computer in the usual way and enter the command LOAD ""
Connect the enclosed lead, which is similar to a standard cassette lead, to your Spectrum (red plug in the EAR socket) and the other end to Red Leader, then plug in Red Leader.
The computer in Red Leader detects which type of home computer it is connected to and starts up accordingly. On the Spectrum, this means that Red Leader sends a program from itself to the Spectrum as if it were a cassette player. The program auto runs and you are presented with a menu screen like that shown in Figure 1.
I had no trouble getting this far with the system and I was quite amazed to see the signal being sent from Red Leader to the Spectrum at precisely the correct ‘volume’.
There are two ways of operating Red Leader: you can use the menu driven system or you can write programs using the built-in BASIC programming language. The Spectrum is only used from here on as a keyboard and screen for Red Leader, and as a a route for program storage — programs written in Red BASIC can be saved to tape via your Spectrum.
The menu system shown is very easy to use. It lets you tell the computer about new devices on the system and allows these devices to be turned on and off via the SET option. Each device has to be ‘installed’ by telling the computer the device’s security code and logical address. As this is a fairly tedious process to have to repeat, you can save all the current device information to tape using the KEEP option from the menu.
From this menu you can set devices to switch on and off at specific times of the day. The system has its own built-in clock which has to be set each time Red Leader is powered up.
It is also possible to make one device dependent upon another. For example, you can arrange for whatever is plugged into Red One to be switched on whenever Red Two detects a movement.
As the starter pack only contains two controllable devices, the applications are fairly limited. It is possible, for example, to have the system switch your electric blanket on and off at preset times every day — or you could use both devices to give you an ‘intelligent’ porch light... anytime someone moves close to the sensor a light can be switched on.
If you want to use the system for more complicated applications you will need to purchase some of the optional extra devices available and also learn how to program the system using the built-in BASIC.
Figure 2 is a listing of a BASIC program that I wrote to have the system perform as a simple home security device. The two devices in the program are referred to as ALARM, for the mains powered alarm bell that I plugged into Red One, SENSOR, for the thermal movement sensor and finally, SENSW, for the small reset switch which is built into the movement sensor.
10 REM SAMPLE PROGRAM FOR HOME SECURITY 20 FOR N = 1 TO DEVICES:ERASE 1:NEXT N 30 REM SET UP ALL THE DEVICES TO BE USED FOR THIS APPLICATION 50 LET NORING = 0: REM STATUS FLAG 60 READ NUMDEVICES 70 FOR N = 1 TO NUMDEVICES 80 READ N$,A,B,C,D 90 INSTALL(N$,A,B,C,D): REM THIS INSTALLS THE DEVICE 100 LET ST = TELL(N$, OFF) : REM RETURNS NON ZERO IF NOT PRESENT 110 IF ST = 0 THEN GOTO 160 120 PRINT "CANNOT COMMUNICATE WITH-";N$ 130 PRINT "PLEASE INVESTIGATE" 140 INPUT "PRESS ENTER TO CONTINUE"; A$ 150 GOTO 100 160 NEXT N 165 REM SETUP EVENT HANDLING ROUTINES 170 WHEN 2 GOSUB 210 : CONTINUE 180 WHEN 3 GOSUB 310 : CONTINUE 185 REM THERE IS NO ACTUAL PROGRAM JUST WAIT IN A LOOP 190 GOTO 190 200 END 210 REM EVENT HANDLING ROUTINE FOR THE MOVEMENT SENSOR 230 LET RING = TIME 10 240 IF TIME RING THEN GOTO 240 250 IF NORING = 1 THEN GOTO 280 260 TELL("ALARM",ON) 270 LET NORING = 0 280 TELL("SENSOR",OFF) 300 RETURN 310 REM EVENT HANDLING ROUTINE FOR SENSOR SWITCH 330 LET NORING = 1 340 LET DELAY = TIME 10 350 IF TIME DELAY THEN GOTO 350 370 RETURN 380 DATA 3 : REM 3 DEVICES 390 DATA ALARM, 1, 860849, 2, 1628250627 : REM CODES FOR RED ONE 400 DATA SENSOR, 1, 204976, 1, 781711363 : REM CODES FOR RED TWO 410 DATA SENSW, 1, 204976, 2, 781711363 : REM RED TWO SWITCH
This set up worked as follows. I would arm the system by connecting the Spectrum to Red One and running the program. The Spectrum can then be disconnected as it is no longer required. The movement sensor had a field of view that covered my front door and hall. On the way out of the house I had to walk past the sensor, so as I passed it I would press the small switch located on the sensor, thus gaining 10 seconds to leave its field of view . The program is written so that I can gain entry to my house without setting the alarm bell clanging. When I return to the house the sensor detects my movement, but gives me a delay of 10 seconds during which I can press the small switch on Red Two to disable the sensor for a further 10 seconds. This gives me time to leave the sensor’s field of view. Then I can leisurely stroll upstairs, reconnect the Spectrum and stop the program. Unfortunately, the sensor is so sensitive to thermal movement that one of my cats was sufficient to set the alarm off!
Red Leader is a fully functional computer with a 6502 processor, a 6220 VIA, 16K Bytes of ROM (an EPROM in the review model) and 8K Bytes of RAM used for program and data storage. You need to connect another home computer to it to provide you with a keyboard and screen.
In all three devices there is one chip which is the heart of the communications system, an LM1893N. This is a mains transceiver which transmits serial data on a radio frequency carrier wave along the household Earth and Neutral wires. The range of communication mainly depends on the amount of outside interference, but I tested the review model along the length of a long suite of offices — certainly, you should have no problem in a standard size house.
Red One contains a mains socket which is connected to its mains input via a 16 amp relay. This relay is controlled by Red Leader but the setting can be switched locally by using a small reset switch on the side of the box. This small switch is set flush to the surface and is unlikely to be pressed accidentally.
Red Two contains a thermal detector, the fluctuating output of which is used to detect thermal movement. This detector is housed at the centre of a crude plastic lens system to give it an extended field of view. If Red Two is mounted in the corner of a room it can detect movement almost anywhere in the room except directly below the unit when it is mounted above head height. The detector is particularly sensitive to movement from side to side across its field of view, but I could approach Red Two without it detecting my presence providing I approached head-on. It ignored me until I was less than two feet away.
The devices communicate very reliably with each other and seem to be fairly insensitive to the household appliances that usually generate interference (drills, washing machines and so on.)
Red Leader supports a powerful programming language which has the feature of being ‘event driven’ by the external devices. That means that you can have a program running, and whenever one of the devices sends a signal to Red Leader it stops what it is doing and executes a subroutine relevant to that device.
You program the subroutines for each device and can activate or deactivate ‘interrupts’ from these devices at any time.
The language is very similar to BBC BASIC but it is an Integer only version of BASIC. Various commands utilise the screen handling capabilities of the computer you are using as the keyboard and screen for Red Leader.
The BASIC supports long variable names and is fairly fast — it also has some element of structured programming support by having REPEAT-UNTIL loops and event-driven interrupts, but for reasons I shall explain, I don’t think many Spectrum users would attempt any ‘serious’ programming on it.
The review model I received was supposed to be a full production version and not a pre-release model, but inside Red Leader there were some fairly messy hand-wired ‘patches’ on the circuit board. The first Red Leader I was sent stopped working after one day of intermittent use, and investigation showed that the main capacitor on the low voltage power supply was not actually soldered in place, but simply rested in the lead holes in the board! However, a replacement was sent within a day (well done GPO) and the new one worked fine.
The circuit boards in Red One and Red Two are very neatly done and don’t appear to have any last-minute fixes on them.
In practical use, the most frustrating aspect of the whole system is the Spectrum. (Don’t complain yet!) The problems lie not with Spectrum but with the machine code program that has the Spectrum act as the Red One terminal. Apparently, an ex-Sinclair programmer wrote most of this code and then left it unfinished for some other unfortunate programmer to complete.
It is quite an appalling piece of code. Judging by its operation the keyboard appears to have been so thoroughly ‘de-bounced’ that you cannot type faster than four characters per second on it. If you want to repeat a key, the auto repeat occurs almost a full second after the first key press and repeats at about half-second intervals. So it takes about four seconds to back-space over an eight character spelling mistake!
I talked to one of the technical bods on the Red Box team who explained some of the reasons behind these problems. He assured me that they would be sorted out in a later model.
The Spectrum implementation also does not let you send anything to the printer (a programming language that doesn’t let you list the program on paper!) and when you try and save a program written in Red BASIC to your cassette (Microdrives not supported) the Red Box downloads the program into the Spectrum memory and then prompts you to swap the Red Box leads over with your cassette leads before supplying the prompt ‘press any key to continue’. However, it doesn’t wait for you to ‘press any key’. It just starts the tone immediately. So you have about half a second to swap the leads over and release the pause button on your cassette recorder.
I was so amazed at how bad the practical aspects of using the Spectrum were that I had a go using the Red Boxes on another computer, the BBC (Hiss!). Not surprisingly, it worked beautifully — keyboard type-ahead, printer, disks — everything you would expect.
Suspicious characters might be tempted to think that the Red Box system was developed for the BBC and had been hurriedly amended to support other machines in order to capture a wider market.
When speaking to some of the designers of the system, I learned that they intend to release another two versions of Red Leader to overcome some of these problems. The next version will have a 32K Byte ROM and should be able to contain some better terminal routines for the machines supported.
Yet another version is intended to have a straightforward RS232 interface and so be able to communicate with any computer that supports a simple ASCII terminal program.
As the original system is clearly limited in scope the designers have several new Red Boxes planned which can be add to the basic ‘starter’ system.
Red Alert is intended to be a fully-functional burglar alarm control system, which will be battery backed and capable of communication with Red Leader, providing inputs from simple window and door switches.
An RS232 unit is envisaged to allow you to let different home computers communicate with each other or devices like printers along the house wiring at a speed of 2400 baud.
Finally a 2 channel A/D converter unit under development will take inputs from simple analogue devices like temperature sensors and communicate the information to Red Leader.
Clearly the Red Box system is under development. At £130 for the 3 unit starter pack I don’t think it has much to recommend it to Spectrum users until the problems with the terminal emulation program are sorted out. When the manufacturers take the Spectrum seriously enough, and when there are a few more devices available, we’ll take another look.
Red Box starter system: £129 including Red Leader, Red One and Red
Extra Units: Red One and Red Two £35 each
New Units: prices to be announced