Many computer use, not only for typing, playing games, the Internet and also for entertainment, can also serve as a tool to control some household appliances that use electricity.
Here is the circuit to use the printer port of a PC, for control application using software and some hardware interfaces. Interface circuit with the given software can be used with the printer port of any PC for controlling up to eight electrical equipment.
Interface circuit shown in images taken just one device, which is controlled by D0 bit at pin 2 of the 25-pin parallel port. Identical circuits for the remaining data bits D1 through D7 (available at pins 3 through 9) must use the same cable. The use of opto-coupler ensures complete isolation from the PC relay driver circuit.
Many ways to control the hardware can be implemented using software. In C / C + + one can use the outportb (portno, value) function is the address where portno parallel port (usually 378hex to LPT1) and 'value' is the data to be sent to the port. For value = 0 all outputs (D0-D7) is not active. For value = 1 D0 ON, value = 2 D1 ON, value = 4, D2 is ON and so on. eg. If the decimal value = 29 () = 00011101 (binary) -> D0, D2, D3, D4 are ON and the rest OFF.
Here is the circuit to use the printer port of a PC, for control application using software and some hardware interfaces. Interface circuit with the given software can be used with the printer port of any PC for controlling up to eight electrical equipment.
Interface circuit shown in images taken just one device, which is controlled by D0 bit at pin 2 of the 25-pin parallel port. Identical circuits for the remaining data bits D1 through D7 (available at pins 3 through 9) must use the same cable. The use of opto-coupler ensures complete isolation from the PC relay driver circuit.
Many ways to control the hardware can be implemented using software. In C / C + + one can use the outportb (portno, value) function is the address where portno parallel port (usually 378hex to LPT1) and 'value' is the data to be sent to the port. For value = 0 all outputs (D0-D7) is not active. For value = 1 D0 ON, value = 2 D1 ON, value = 4, D2 is ON and so on. eg. If the decimal value = 29 () = 00011101 (binary) -> D0, D2, D3, D4 are ON and the rest OFF.
No comments:
Post a Comment