MousKey - a device to control a computer with another computer.

The project/device described in this web page is a method to control any general purpose computer using another general purpose computer, directly by the keyboard or indirectly by program control. The project is made by taking the circuit board from a keyboard and a mouse and then controlling them from the parallel printer port using serial logic.

The project may be duplicated by a medium to advanced hobbyist at a very low cost. At this time there is only 1 circuit board layout. The project is built using point to point wiring after a breadboard debugging version. Circuit board layouts will be a future addition to the web page. **** They're here ! See zip files at end of page. *****

The project has many virtues to offer such as computer security, automatic computer maintenance and a new ability for the user to control a computer and its operating system in an easy simple way. The project began as a KeyBot (keyboard robot) and grew to include a MousBot, distributor module, cable control module, disk drive handler and main power control.

The test computers used for development are a $20 salvage M571 (300 MHZ)and a discarded kiosk (ATM) computer (66 MHz). The main language used for MousKey control is Qbasic, along with DOS. You may use any language you wish to control the device as long as it can access the parallel printer port. Windows95 is the operating system. Win98 should also work because the Qbasic interpreter is DOS based. Linux should work using a Windows GUI interface.

The case for the project is merely 2 CD jewel case covers bolted together by 2 ) #6 screws on a doubled piece of a paint stirring stick. The wired modules will have cases made by several coatings of Goop adhesive. The wire is a scrap of 8 conductor telephone cable with approximately 22 gauge wires. The electronic parts and the breadboard came from Mouser.com.

If you would like to duplicate this project it is suggested that you build and debug each section before building the next section. The job will be a whole lot easier that way. Diagnostic and testing programs are included in the program package of this web page. A high quality power supply is needed and fortunately you can get one for free from a scrapped computer. Be careful about short circuits though. Even old small computer power supplies can deliver a lot of amperage. A light bulb for a fuse might be a good idea. It's ok to burn up a 20 cent IC but you don't want to burn a pin location on your $35 IC breadboard.

Each of the 5 following sections describes a section or module of the project. That is followed by a section on the programs and then a few buttons for you to indicate what you think of this project. There are also zip files of this entire web page available.



The KeyBot_________________________________________________

The KeyBot was the beginning of this project. It was a circuit board from a TurboTrak keyboard with a CMOS switch matrix to replace the key switches. You should be able to use just about any keyboard the same way but you might have to struggle thru small design modifications. The CMOS switches are controlled by a 24 bit serial data capture circuit that is driven by the parallel printer port of the master computer.

The pictures above show the original KeyBot project. It was later determined that only the lower board was needed. The upper relay board has been removed. It was there to provide 8 low impedance switches if needed. The CMOS switches are of about 100 ohms impedance. The circuit of the keyboard has to have a lower impedance for the Alt and Ctrl keys to operate properly. Two CMOS switches in parallel were able to do the job.

The problem could have been solved by stacking a second IC package directly on top of the 3 ICs involved. Instead of that, the board was cut & jumpered so that both of the Alt CMOS switches were used to drive a single Alt input of the circuit board. The same was done for the Ctrl key. That left 2 bits of the serial data capture circuit free to control something else. One of the two shift key control bits was also taken to control other options. Those 3 bits and the 4 bits that were used to control the relay board became available to control the distributor (signal multiplexer) and the cable control circuit. It's a sort of lumpy way to grow but those spare control lines became quite valuable later on to allow a branching of the serial data capture circuit.

The small dark green circuit board in the upper pictures is the circuit board from the keyboard. An attempt was made to create an edge connector on the Keybot board using pins from an IDE connector. The nuts & bolts and the wood splicer bar were for that purpose. It worked well for a while but about the third time that a connection problem appeared all the contact fingers got soldered to the keyboard circuit board. Only soldered wires are needed to connect these circuit boards together.

The new schematic is shown below. You may wish to compare it to the original schematic of the Keybot web page

The 3 control lines originally came directly from the printer port of the master computer. In the MousKey project they now come from the cable control circuit. The cable control circuit decides whether the master or the slave computer has control of the Keybot. It was the last addition to this project.

In operation the master computer sends data out thru the parallel port and into the shift registers. When the Output Register Clock was activated, the shift registers would convey the data to the CMOS switches. The CMOS switches would then control the keyboard circuit board as if a key had been pressed. This circuit will allow a Ctrl-Alt-Del combination to be sent as well as 1 or 2 key combinations.



The MousBot____________________________________________________

The MousBot (mouse robot) was a simple addition to the KeyBot. A fourth shift register was added to the data capture circuit and 6 of its 8 outputs were connected directly to the mouse circuit board using 10 K resistors instead of CMOS switches or relays. The 2 spare bits of the shift register were later used to control the distributor circuit. The mouse used was a $1 eMouse from the Family Dollar store. Other $1 mice were bought just to get ready made cables and plugs for the project..

The mouse circuit board gets its power from the slave computer. It has to because when the computer is first turned on the operating system has to initialize the mouse before using it. The operating system also disables the mouse when it shuts down. The Cable Control circuit prevents that from happening.



The Distributor__________________________________________________

The distributor is a signal channel multiplexor that determines whether the real keyboard output goes to the master or the slave computer. It also determines whether the robot keyboard & mouse go to the master or slave computer, It has 5 leftover channels for computer connection. It is eight 8 bit multiplexors with separate address lines for both groups of 4 ICs. Both address busses have 3 LEDs to help figure out what it's doing. Additionally, an input signal called Slave Override can tristate the robot mouse.

The address bus for the real keyboard & mouse uses 3 of the 4 bits that used to go to the relay board of the KeyBot. The 4th bit and 2 unused bits from the shift register on the mouse are the address bus for the robot keyboard & mouse.

The D module___________________________________________________

The D module is another collection of shift registers and CMOS switches & relays. Each computer has one installed internally. It controls utility functions like turning the computer on and off, controlling how many disk drives the power supply has to carry and configuring the drives.

The D module is controlled in a unique way. It's Output Register Clock is a spare bit from the KeyBot shift registers. This is done for speed of operation. If both D modules had been put in series with the KeyBot & MousBot the computer would have to put out a 64 bit serial word to talk to any of the devices. The KeyBot requires 5 to 8 words for each character that it types. That would mean up to 512 bits to be output for a single character.

Instead of that, the D modules both receive serial data from the MousBot simultaneously. The Output Register Clock of each module is controlled separately so that they may be operated separately. Those output control lines are the spare ALT and Ctrl lines from the KeyBot. Because of that, the normal word length only has to be 32 bits long instead of 64.

In exchange for speeding up the KeyBot & MousBot operation the D modules get slowed done. Three words of 48 bit length are required for each D module command. However, the D modules are for slow moving utility purposes, Their tasks take several minutes to execute and adding a few micro seconds to that time doesn't matter.

Each D module has two shift registers. One is unmodified and the other latches on to whatever the serial line has at the moment the computer is turned on. This is done so that you don't accidently power up an unauthorized disk drive during a computer session. That prevents the power supply from overloading and destroying the computer because of bad command. The latching register has 4 leftover unused command lines.

The non latching shift register is used for turning the main computer power on and off. There is a second option to simulated a solid state on/off button. If that is used the first relay may be used to control the monitor power instead. There are 6 leftover unused serial lines on this register. They could branch even further to operate other slow serial data circuits..

The first relay is an AC power relay. It is outside the computer on the power cord. Its driver circuit is a part of the wiring harness..

The power cords (left pic) for master and slave computer are identical. The driver circuits (center pic) are not. The driver circuit for the master computer has a third transistor added to act as an inverter. It defaults to the power on condition for the master computer. The slave computer defaults to the power off condition. The right picture shows an end of the harness. A 6 pin mini DIN plug resting on the breadboard in the upper right corner plugs into the D module. The 2 foot coil of wire goes from the driver circuit in the center picture to the relay in the left picture.

The lump on the left side of the white cable is a junction point. An enlarged picture is shown below.

The insulation from the 20 gauge wire made perfect insulators for the 22 gauge solder connections. The bits of insulation had to be rolled between 2 metal plates with a piece of solid wire still inside it to cause a temporary size increase for installation. The junction point and the relay drive circuit will be completed by several coatings of Goop adhesive as a final coating.

The CMOS On/Off switches are a last minute addition and have not been tested. It may be a good idea to replace them with two reed relay circuits from the KeyBot relay board. The reason is because if any of the four lines for the On/Off switch go above 5 volts or below the common ground there will be an electrical interface problem. The reed relays will be safe to use because of their electrical isolation.





The Cable Control________________________________________________

The Cable Control circuit decides which computer gets to use the MousBot. The MousBot has several control lines connected to the parallel printer port of both computers. These are thought of a 'cable functions' and are not the same as what the distributor does. Some cable functions are to recognize when a computer has finished POST and tell the other computer, disable a computer input to the robots if the computer is not ready to send data to them and to tristate the robot mouse when needed.

Yep, the cable control circuit is still on the breadboard. The right column of ICs and the lowest IC on the left column are not part of the circuit. Those are the serial data capture circuit left over from the KeyBot prototyping. It was handy to have around during MousBot and D module development.

The circuit has quite a few LEDs because trying to figure out what it was doing while connected to two out-of-control computers became rather difficult. The only significant signal line that does not have an LED is Bit16. It is a companion to the Slave Override signal.

WinActive is a name given to the output of the parallel port from a computer that has just finished booting up. It is when Bit 2 is on and all other bits are off. The circuit latches on to it and reports the status to the other computer. When the MousKey program is operating WinActive is not valid. The program can issue a WinActive output by command. The WinActive latch can be reset by the other computer using Slave Override and Bit16 simultaneously. Slave Override by itself disables the master computer from having cable control and blocks any input to the mouse circuit board.

The Programs_________________________________________________

The main program in named 7MKbot.bas. It is about 17 pages long and has another 8 pages of subroutines. The same program is used for the master and the slave computer. It has internal commands, external commands, scripting ability and numerous command options. It was written to include each of the circuits as they were added. There is plenty of commentary in it and also includes a bit map of the 32 bit serial word. The schematic of the KeyBot is not exactly correct. The lines from the shift registers are rearranged to make the schematic easy to understand. The bit map shows which bit actually controls what function. The program may be relocated to a virtual drive.

When the MousKey project is complete most of the commands are not needed. Only a few of the command scripts (and any new ones added) are still important. They are made from strings of the small commands. However, if your building any of the circuits the small commands help you diagnose problems.

When writing a script it's a good idea to have the script start and finish from the KeyBot Command Mode. The reason is so that when you add scripts together each consecutive script will start its operation from a common location and not get lost in an incorrect command screen. There are some scripts that finish in whatever command screen they started from though.

The program folder should be located in the root directory. The program itself is located on the desktop and must have the number 7 as the first character of its name so that a script running on another computer can find and activate it. The program has several timing loops in it to wait for differing things to happen. Those may be shortened or lengthened if you are using a faster computer.

In general, the program causes the computer to act as a controller circuit for the KeyBot circuit. It must therefore use several output words for each letter it generates. The first one contains data, the second one contains data and latch command, the third one contains data, latch command and enable output command etc. etc.

When one computer is re booting another computer the program will find the twin of itself on the other computer, start it operating and then run commands and/or scripts to complete the boot up procedure.

__________________________

If you are having problems with the KeyBot, the program named KeyID2.bas may be useful. It reports what a computer sees at the keyboard input thru the eyes of the Qbasic interpreter. If you are using a different keyboard to make the KeyBot with it will help you to re map the key lines. Those new values will have to be put in the Char2Mtx subroutine of the 7MKbot.bas program.

__________________________

If you are developing the MousBot, the program MousBot.bas may help. It is the MousKey main program with everything removed that the MousBot doesn't use. The MousBot must be found at the 4th shift register of the serial data capture circuit.

___________________________

The program Sdiag1.bas is to help with basic KeyBot programming. The KeyBot must have its circuit board designed with short wide lines. Convenient logical layouts don't work. Determining what bit controls what line on each chip can be difficult. The program allows specific outputs to be sent and held so that electrical measurements at the chip can verify that things are working as they should.

__________________________

The program BootBat.bas and BootBat.bat are just to demonstrate the a boot up program can be placed in the AutoExec.bat file. The program will run and terminate before Windows starts up. Linux users might use this as a method to cause a WinActive signal to be created.

___________________________

The program VTcmnd.bas is a simple monitor and control program for the parallel port. It may also be used as a logic chip tester. Some shift registers don't function as they should. You may connect every line of a shift register IC (including power supply) to lines of the parallel port to explore what you have. Use the output mode for the port and get the inputs from the printer status lines. Some of those lines are monitored by the computer and it will try to get involved with your testing. The Online status line appears to be a good choice to use. Fairchild brand shift registers are recommended.



Miscellaneous__________________________________________________

If you want to try to duplicate this project you'd better be pretty good at soldering. A section on making circuit boards and on soldering is planned but it isn't ready now. Here's a few tips.

Electronic components are made to withstand 10 seconds of soldering. That only means at the tip of the legs. For this project the legs are cut off and the wires are soldered onto the shoulders of the ICs. A maximum of 1 second is all the heat that the IC or transistor can stand.

Pre tin the shoulders and the wires. Hold them together and complete the solder joint with a momentary touch of the iron. If you melt the vinyl off the wire you probably burned up the component too. It's ok to tin a circuit by melting large blobs of solder onto the shoulders, letting it cool down and then draining the excess solder off. The best joints are also made that way.

Don't breath even the slightest amount of soldering fumes. They are cumulative and can cause you extreme physical & mental problems later in life. A direct exhaust vent of fumes to the outdoors is strongly recommended.

Before you start the project you'd better be prepared to deal with problems. Computers vary in small ways and so do operating systems. On one computer a space can be recognized and used to start a remark line in a script and on another computer it cannot. A ' for a remark line has been added. 'Your milage will probably vary'. All I can tell you is that the project is complete and working perfectly in every way on the two computers used at my place.

The project became temperature sensitive towards the end of development. If the temperature is not above 65 F degrees the slave computer starts up in the safe mode and only the MousBot works. Don't know if the KeyBot or the slave computer is at fault.



Zip Files_____________________________________________________

Zip file of this web page including all programs & the Keybot web page

I would like to have included an email address but as soon as the KeyBot web page got posted some obnoxious so & so sent me an e-something that prevents me from receiving email at the server level. I'll add some buttons with hit counters in the future so you may vote on whether you liked the project and would like to have a parts kit of it available.



These are not included in the first zip file.



Progress report________________________________________________

The circuit board layouts took an enormous amount of time to create. They have not been tested yet. I've posted them ASAP just in case there's somebody trying to create their own layouts. They were moderately hard to do. You should double check them before you go to the trouble to make a circuit board.

Looking back I see that this entire web page need a thorough going over to correct errors in grammar, HTML and technical blunders. That's going to take a long time and may not get done this year. Simply writing this much has taken far longer than creating the project. My disk drive has become quite a mess from all of the thrashing around with this publishing effort.

If you're seriously considering this project you should have a look at the next page of dreadfully boring details to know what sort of problems you might have to deal with.

That's all for today...

WYSIWYG