Subscribe to our RSS Feeds

Electrical Equipment Control UsingPC

0 Comments »
Operation:

Here is a novel idea for using the printer port of a PC, for con-trol application using software and some interface hardware. The interface circuit 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.

When the program is loaded and run, the monitor will show the control panel-with the control bar at the extreme left. The bar can be moved using the right and left arrow keys. Switching on/off of bits D0-D7 is done by bringing the bar over the appropriate square and then pressing the ‘Q’ key for ON and ‘W’ key for OFF operation. The monitor will show the status of the relevant switch by indicating ‘1’ for ON and ‘0’ for OFF status of the switch. In addition, the current date and time is also displayed on the screen.

Program Listing in Basic:

CLS : SCREEN 2
KEY(1) ON: ON KEY(1) GOSUB FINIS
KEY(5) ON: ON KEY(5) GOSUB RETIRE
KEY(10) ON: ON KEY(10) GOSUB ALLON
PORT% = &H378
OUT PORT%, 0
LOCATE 8, 10: PRINT "<--- --->"
V$ = STRING$(27, "²")
LOCATE 5, 6: PRINT V$; SPC(1); "CONTROL PANEL"; SPC(2); V$
LINE (40, 31)-(600, 180), 1, B
LINE (40, 40)-(600, 180), 1, B
LINE (40, 100)-(600, 120), 1, BF
LINE (140, 40)-(460, 110), 1, B
LOCATE 8, 65: PRINT "ON-----Q"
LOCATE 12, 65: PRINT "OFF----W"
LOCATE 19, 15: PRINT "F1"; SPC(24); "F5"; SPC(27); "F10"
LOCATE 21, 10: PRINT "EMERGENCY OFF"; SPC(16); "LOGOUT"; SPC(24); "ALLON"
D$ = DATE$
J$ = MID$(D$, 1, 3)
K$ = MID$(D$, 4, 3)
L$ = MID$(D$, 9, 2) LOCATE 5, 7: PRINT SPC(1); K$; J$; L$; SPC(1); ""
STAT:
PSET (145, 85): DRAW "R20U10L20D10"
PSET (185, 85): DRAW "R20U10L20D10"
PSET (225, 85): DRAW "R20U10L20D10"
PSET (265, 85): DRAW "R20U10L20D10"
PSET (305, 85): DRAW "R20U10L20D10"
PSET (345, 85): DRAW "R20U10L20D10"
PSET (385, 85): DRAW "R20U10L20D10"
PSET (425, 85): DRAW "R20U10L20D10"
T$ = TIME$
Y$ = MID$(T$, 1, 2)
Y = VAL(Y$)
IF Y < 12 THEN PP$ = "AM" ELSE PP$ = "PM"
IF Y > 12 THEN Y = Y - 12
U$ = MID$(T$, 3, 3)
LOCATE 5, 64: PRINT SPC(1); Y; U$; PP$; SPC(1); ""
LOCATE 9, 20: PRINT "1"; SPC(4); "2"; SPC(4); "3"; SPC(4); "4"; SPC(4); "5"; SPC(4); "6"; SPC(4); "7"; SPC(4); "8"
LOCATE 12, 19: PRINT AA; SPC(2); SS; SPC(2); DD; SPC(2); FF; SPC(2); GG; SPC(1); SPC(1); HH;
SPC(2); JJ; SPC(2); KK
X$ = INKEY$
X$ = RIGHT$(X$, 1)
N = INP(PORT%)
IF X$ = "K" THEN J = J - 40
IF X$ = "M" THEN J = J + 40
PSET (J + 105, 85): DRAW
"R20U10L20D10R2U10R2D10R2U10R2D10R2U10R2D10R2U10R2D10R2U10R2D10"
FOR T = 1 TO 400: NEXT
PRESET (J + 105, 85): DRAW
"R20U10L20D10R2U10R2D10R2U10R2D10R2U10R2D10R2U10R2D10R2U10R2D10"
IF J + 105 < 105 THEN J = 0
IF J >= 360 THEN J = 360
IF (J = 40) AND (X$ = "Q" OR X$ = "q") THEN GOSUB APPLE
IF (J = 40) AND (X$ = "W" OR X$ = "w") THEN GOSUB APPLEOF
IF (J = 80) AND (X$ = "Q" OR X$ = "q") THEN GOSUB BAT
IF (J = 80) AND (X$ = "W" OR X$ = "w") THEN GOSUB BATOF
IF (J = 120) AND (X$ = "Q" OR X$ = "q") THEN GOSUB TALE
IF (J = 120) AND (X$ = "W" OR X$ = "w") THEN GOSUB TALEOF
IF (J = 160) AND (X$ = "Q" OR X$ = "q") THEN GOSUB FLAT
IF (J = 160) AND (X$ = "W" OR X$ = "w") THEN GOSUB FLATOF
IF (J = 200) AND (X$ = "Q" OR X$ = "q") THEN GOSUB FAT
IF (J = 200) AND (X$ = "W" OR X$ = "w") THEN GOSUB FATOF
IF (J = 240) AND (X$ = "Q" OR X$ = "q") THEN GOSUB SILK
IF (J = 240) AND (X$ = "W" OR X$ = "w") THEN GOSUB SILKOF
IF (J = 280) AND (X$ = "Q" OR X$ = "q") THEN GOSUB SEVEN
IF (J = 280) AND (X$ = "W" OR X$ = "w") THEN GOSUB SEVENOF
IF (J = 320) AND (X$ = "Q" OR X$ = "q") THEN GOSUB LAST
IF (J = 320) AND (X$ = "W" OR X$ = "w") THEN GOSUB LASTOF
GOTO STAT '------------ALL THE SUBROUTINES ARE BELOW--------------
APPLE: SOUND 500, 2
AA = 1
LOCATE 6, 50
Q = 1 OR N
OUT PORT%, Q
RETURN
BAT: SOUND 500, 2
SS = 1
W = 2 OR N
OUT PORT%, W
RETURN
TALE: SOUND 500, 2
DD = 1
Q = 4 OR N
OUT PORT%, Q
RETURN
FLAT: SOUND 500, 2
FF = 1
Q = 8 OR N
OUT PORT%, Q
RETURN
FAT: SOUND 500, 2
GG = 1
Q = 16 OR N
OUT PORT%, Q
RETURN
SILK: SOUND 500, 2
HH = 1
Q = 32 OR N
OUT PORT%, Q
RETURN
SEVEN: SOUND 500, 2
JJ = 1
Q = 64 OR N
OUT PORT%, Q
RETURN
LAST: SOUND 500, 2
KK = 1
Q = 128 OR N
OUT PORT%, Q
RETURN
TALEOF: SOUND 400, 1
IF DD = 0 THEN RETURN
DD = 0
IF N = 4 THEN P = 0
IF N < 4 THEN P = N
IF N > 4 THEN P = N - 4
OUT PORT%, P RETURN
APPLEOF: SOUND 400, 1
IF AA = 0 THEN RETURN
AA = 0
IF N = 1 THEN I = 0
IF N > 1 THEN I = N - 1
OUT PORT%, I
RETURN BATOF: SOUND 400, 1
IF SS = 0 THEN RETURN
SS = 0
IF N = 2 THEN U = 0
IF N > 2 THEN U = N - 2
IF N < 2 THEN U = N
OUT PORT%, U RETURN
FLATOF: SOUND 400, 1
IF FF = 0 THEN RETURN FF = 0
IF N = 8 THEN E = 0
IF N < 8 THEN E = N
IF N > 8 THEN E = N - 8
OUT PORT%, E
RETURN
FATOF: SOUND 400, 1
IF GG = 0 THEN RETURN
GG = 0
IF N = 16 THEN Y = 0
IF N < 16 THEN Y = N
IF N > 16 THEN Y = N - 16
OUT PORT%, Y
RETURN
SILKOF: SOUND 400, 1
IF HH = 0 THEN RETURN
HH = 0 IF N = 32 THEN Y = 0
IF N < 32 THEN Y = N
IF N > 32 THEN Y = N - 32
OUT PORT%, Y
RETURN
SEVENOF: SOUND 400, 1
IF JJ = 0 THEN RETURN
JJ = 0
IF N = 64 THEN U = 0
IF N < 64 THEN U = N
IF N > 64 THEN U = N - 64
OUT PORT%, U
RETURN
LASTOF: SOUND 400, 1
IF KK = 0 THEN RETURN
KK = 0
IF N = 128 THEN Z = 0
IF N < 128 THEN Z = N
IF N > 128 THEN Z = N - 128
OUT PORT%, Z
RETURN
ALLON: SOUND 500, 4
OUT PORT%, 255
AA = 1: SS = 1: DD = 1: FF = 1: GG = 1: HH = 1: JJ = 1: KK = 1
RETURN
FINIS: SOUND 400, 2
OUT PORT%, 0
AA = 0: SS = 0: DD = 0: FF = 0: GG = 0: HH = 0: JJ = 0: KK = 0
RETURN
RETIRE:
OUT PORT%, 0
END  

Circuit diagram:



2:39 PM

Simple battery charger

0 Comments »
Operation:


A simple battery charger based on SCR is shown here.Here the SCR rectifies the AC mains voltage to charge the battery.When the battery connected to the charger gets discharged the battery voltage gets dropped.This inhibits the forward biasing voltage from reaching the base of the transistor Q1 through R4 and D2.This switches off the transistor.When the transistor is turned OFF,the gate of SCR (H1) gets the triggering voltage via R1 & D3.This makes the SCR to conduct and it starts to rectify the AC input voltage.The rectified voltage is given to the battery through the resistor R6(5W).This starts charging of the  battery.
When the battery is completely charged the base of Q1 gets the forward bias signal through the voltage divider circuit made of R3,R4,R5 and D2.This turns the transistor ON.When the Q1 is turned ON the trigger voltage at the gate of SCR is cut off and the SCR is turned OFF.In this condition a very small amount of charge reaches the battery via R2 and D4 for trickle charging.Since the charging voltage is only half wave rectified ,this type of charger is suitable only for slow charging.For fast charging full wave rectified charging voltage is needed.
Tips: 
  * Assemble the circuit on a good quality PCB or common board. 
  * The transformer T1 can be 230V primary, 18V /3A secondary step down transformer.
  *  The voltage of the battery at which the charging should stop can be set by  the POT R4.
  *  The battery can be connected to the charger circuit by using crocodile clips.

Circuit diagram: 





 

2:25 PM

Water Level Indicator With Alarm

0 Comments »
Operation:

Here is a simple circuit which indicates the water level in a tank. This circuit produces alarm when water level is below the lowest level L1 and also when water just touches the highest level L12. The circuit is designed to display 12 different levels. However, these display levels can be increased or decreased depending upon the level resolution required. This can be done by increasing or decreasing the number of level detector metal strips (L1 to L12) and their associated components. In the circuit, diodes D1, D2 and D13 form half-wave rectifiers. The rectified output is filtered using capacitors C1 through C3 respectively. Initially, when water level is below strip L1, the mains supply frequency oscillations are not transferred to diode D1. Thus its output is low and LED1 does not glow. Also, since base voltage of transister T1 is low, it is in cut-off state and its collector voltage is high, which enables tone generating IC1 (UM66) and alarm is sounded. When water just touches level detector strip L1, the supply frequency oscillations are transferred to diode D1. It rectifies the supply voltage and a positive DC voltage develops across capacitor C1, which lights up LED1. At the same time base voltage for transistor T1 becomes high, which makes it forward biased and its collector voltage falls to near-ground potential. This disables IC1 (UM66) and alarm cannot be sounded. Depending upon quantity of water present in the tank, corresponding level indicating LEDs glow. It thus displays intermediate water levels in the tank in bar-graph style. When water in the tank just touches the highest level detector strip L12, the DC voltage is developed across capacitor C2. This enables tone generating IC1 (UM66) and alarm is again sounded.

Circuit diagram:


2:04 PM

Automatic Emergency Torch

1 Comments »


Operation:

In the power supply section, capacitors C1 and C2 function as non-dissipating, reactive impedance which limit the current to a safe value. With the values of capacitors as shown, the maximum current that can be drawn is limited to about 70 mA at 230V AC. Resistor R2 limits the initial surge current and resistor R1 assists in discharging the capacitors after switch off. Diodes D1 through D4 form a conventional bridge rectifier while capacitor C3 is the filter capacitor. Fuse F1 is for protection and is very helpful in the event of any component giving up the ghost. This supply charges the battery as long as mains is present. In the 'switchover' section, transistor T1 is used as switch. Normally, when AC mains supply is present, the rectifier output charges the battery through resistor R4 and LED D4 combination at about 50mA rate. The glowing LED (D5) also gives an indication of mains presence. Further, due to the LED, base of transistor T1 is about 1.6V (drop across D5) more positive than its emitter. This voltage is more than sufficient to keep the transistor at cut-off. As soon as the mains voltage fails, the base of transistor T1 is pulled low through resistor R3 which drives transistor T1 to saturation thereby turning the bulb 'on'. Since the transistor is in its saturated state, the voltage drop across it is very low. Hence the bulb glows with full brilliance. The bulb can be switched off by the ON/OFF switch, when not required. With this bulb (2.2V, 250mA) the torch can work continuously for about two hours. The batteries should be charged for about 14 hours after they are discharged. Here is a word of caution now. Since the circuit is not isolated from AC mains, it may be hazardous to touch any component when the mains supply is on, especially if the supply wires (live and neutral) get interchanged. It is strongly recommended to use an all-plastic enclosure (including the reflector for the bulb) for the circuit. Also the on/off switch used should have a plastic lever. Take proper care and precautions while building, testing and using the circuit, and never ever allow the supply wires to interchange. It is advisable to provide a plug for the mains input on the box itself so that it can be plugged directly into a mains outlet. This reduces the chances of mains supply wires getting interchanged. With proper precautions and little care, it is hoped that this small circuit will help make life a bit more comfortable.

Features:

* Very reliable operation.
* As transformer is used, it is compact and cost-effective.
* The torch bulb glows automatically at power off and goes out on restoration of power.
* Since Ni-Cd battery is used, no maintenance is required. 


Circuit diagram: 




  



2:01 PM

Energy Conservation

1 Comments »

Energy conservation is One of the hottest topics at the moment regards our impact on the environment.With rising energy costs and depleting fossil fuels becoming more apparent, as well as the increased impact of global warming, many people are starting to look for ways to reduce energy usage.While some things, such as turning off appliances when not in use, are standard knowledge, there are many other things that can be implemented in our life.
Go to energy management centre-kerala