Published:2011/7/27 22:20:00 Author:Li xiao na From:SeekIC
by K. Heiden
Construction
The simplest way to construct the interface circuit is to use matrix stripboard. The components are all widely available and so should be easy to obtain. A suitable latching relay for RE1 is available for example from Conrad Electronics (order code 50 40 60). For RE2 practically any small 12 V relay can be used.
As can be seen from the circuit diagram of the parallel port interface and from the photographs, a few connections need to be made to the remote control transmitter using short lengths of insulated wire. The connection points are easy to find: they are simply the contacts of the pushbuttons. The circuitry inside the transmitter can be quite tightly packed, and so soldering can be a little fiddly. Things are not too difficult with the FS 10 remote control system available from the German company ELV that we used in our prototype: as soon as the enclosure of the transmitter (part code FS 10 S8-2: see Figure 1) is opened up and the caps of the pushbuttons removed, the contact points of the pushbuttons are visible (Figure 4). It is very easy to solder wires to these contacts, connecting the transmitter to the optocouplers (points A to D in the circuit). The pushbuttons can no longer be used.
The completed assembly can be protected by a plastic enclosure (Figure 5, which shows a slightly modified version of the interface).
The Software
The control software is as straightforward as the interface circuit. All it has to do is set the individual bits of the parallel port high for a period of about one second, and then low again. We do this using a COM file, which is created in advance with the aid of a VB (Visual BASIC) script. First type in the program Mk_COM.vbs shown in the text box using any suitable text editor (such as WordPad or Notepad), and save it under this name in any directory on the hard disk. Now run the program by double-clicking on the filename: this will create the file SETLPT.COM in the same directory. The VB script can now be deleted.
The various switching actions can be carried out using the following commands:
SETLPT 1:01 switches the latching relay on.
SETLPT 1:02 switches the latching relay off.
SETLPT 1:08 switches the non-latching relay (briefly) on.
SETLPT 1:10 switches remotely-controlled mains socket 2 on.
SETLPT 1:20 switches remotely-controlled mains socket 2 off.
SETLPT 1:40 switches remotely-controlled mains socket 3 on.
SETLPT 1:80 switches remotely-controlled mains socket 3 off.
The space after ’SETLPT’ must not be omitted. The digit ’1’ after ’SETLPT’ and the space refer to parallel port LPT1. The characters after the colon are hexadecimal digits which define the value which will be sent to the parallel port: two digits must always be specified. The assembler routine sets the parallel port to the value given after the colon for about 1 s, and then sets it back to zero again so that only a brief positive pulse will appear on the data line. If you have a second parallel port (’LPT2’) on your computer which you wish to use with the interface, then the command should read ’SETLPT 2:XX’. A note for PC experts: the I/O base address used for LPT1 is 0378 hex, that for LPT2 is 0278 hex.
You can create a shortcut to the file SETLPT.COM with parameter ’1:08’ on the desktop, and call it ’ Open Door’. Then, when someone rings the doorbell while you are busy at the computer, just double click on the icon and the door opener will be activated. To prevent the DOS window appearing, right-click on the icon and select ’Properties’. Then, under ’Shortcut’ select ’Run minimised’ and ’Close window on exit’.
Conclusion
The author has been using the circuit for many months without any problems, mainly in conjunction with an SMS remote control circuit previously published in Elektor Electronics.
If you prefer to control the interfaces using Windows, there are small programs available on the Internet which allow the parallel port signals to be set high or low. Simple parallel port interfaces using Windows software have also been published in the past in Elektor Electronics, and that software can be adapted for the interface presented here. Examples include the ’Universal Parallel Input/Output for PCs’ on page 20 of the April 2000 issue and ’Centronics Interface’ on page 28 of the April 1996 issue. The book ’PC Interfaces under Windows’ is also recommended.
Reprinted Url Of This Article: http://www.seekic.com/blog/project_solutions/2011/07/27/Parallel_Port_Mains_Switching_Interface__switch_radio_controlled_mains_sockets_on_and_off_from_a_PC_(3).html
Print this Page | Comments | Reading(551)
Author:Ecco Reading(30180)
Author:Ecco Reading(3461)
Author:Ecco Reading(3181)
Author:Ecco Reading(3661)
Author:Ecco Reading(5231)
Author:Ecco Reading(3248)
Author:Ecco Reading(3390)
Author:Ecco Reading(3530)
Author:Ecco Reading(3935)
Author:Ecco Reading(3707)
Author:Ecco Reading(3677)
Author:Ecco Reading(3714)
Author:Ecco Reading(6028)
Author:Ecco Reading(3692)
Author:Ecco Reading(4478)