Home appliance control using PC’s Parallel Port and Water Alarm

I made these two projects in the 2nd year of my engineering. They were not original ideas, as in, I copied the circuits from the net :-). This was more of an introductory exercise for me than anything else. My main aim was to get a hang of the things like wires and soldering irons 😛 while making something that has some serious practical application.

While searching for something worth making on the net, I went for these two projects because they had the potential of being put to practical use in my home. Imagine the excitement of turning on/off bulbs, tube-lights, fans etc. while relaxing in front of the PC! Water alarm was more of a necessity in my three storied home though. Every evening somebody (that somebody’s me 😛 :-D) had to walk all the way up to the roof to check if the tank is filled or not. This was not only a waste of time and energy but also it led to a heavy water wastage almost everyday because that ‘somebody’ was a bit too lazy at times :-).

Currently, water alarm has been put to excellent use in my home and I am proud that through such a simple circuitry, we have been able to save thousands of liters of water in the last three and a half years or so. Unfortunately, the home appliance control circuit, though functional, couldn’t be implemented because it required some serious tweaking with electrical lines in the house. Watching the relay ‘twitch’ when the key was pressed was fun nevertheless!

Below is the description of the circuits involved and the simple software for the home appliance control project. Build them yourself and have fun!


Home Appliance Control using PC’s parallel port

The interface circuit given below along with the given software can be used with the printer port of any PC for controlling up to eight equipment .
The interface circuit shown in the figure is drawn for only one device, being 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) have to be similarly wired. The use of opto-coupler ensures complete isolation of the PC from the relay driver circuitry.
Lots of ways to control the hardware can be implemented using software. In C/C++ one can use the outportb(portno,value) function where portno is the parallel port address (usually 0x378 for LPT1) and ‘value’ is the data that is to be sent to the port. For a value = 0 all the outputs (D0-D7) are off. For value=1 D0 is ON, value=2 D1 is ON, value=4, D2 is ON and so on. For example,

If value=29(decimal) = 00011101(binary) → D0,D2,D3,D4 are ON and the rest are OFF.


Simple Enough!!!



Water Alarm

It should be noted that the circuit below not only indicates the amount of water present in the overhead tank but also gives an alarm when the tank is full. I kept things simple by using only one LED and the buzzer to show that the tank is filled up. You can implement the full circuit if you want.

The circuit uses the widely available CD4066, bilateral switch CMOS IC to indicate the water level through LEDs.

When the water is empty the wires in the tank are open circuited and the 180K resistors pulls the switch low hence opening the switch and LEDs are OFF. As the water starts filling up, first the wire in the tank connected to S1 and the + supply are shorted by water. This closes the switch S1 and turns the LED1 ON. As the water continues to fill the tank, the LEDs 2 , 3 and 4 light up gradually.
The number of levels of indication can be increased to 8 if 2 CD4066 ICs are used in a similar fashion.

When the water is full, the base of the transistor BC148 is pulled high by the water and this saturates the transistor, turning the buzzer ON. The SPST switch has to be opened to turn the buzzer OFF.
Remember to turn the switch ON while pumping water otherwise the buzzer will not sound!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s