centralized power monitoring system report
TRANSCRIPT
-
7/30/2019 Centralized Power Monitoring System Report
1/45
CENTRALIZED POWER MONITORING SYSTEM
1 | P a g e N I L O T P A L M R I N A L
CHAPTER-1
INTRODUCTION
-
7/30/2019 Centralized Power Monitoring System Report
2/45
CENTRALIZED POWER MONITORING SYSTEM
2 | P a g e N I L O T P A L M R I N A L
INTRODUCTION
In this project an attempt has been made to observe consumption of Electrical energy b
means of an energy meter and the data is sent to a computer. Energy meter is generally o
the electro-dynamic type. An electronic type of energy meter is used. The calculation circuis a PCB which calculates the power consumption of each appliance which is connected
explicitly. CALCULATION CIRCUIT would be installed at the back of switch boxes.
Two transformers a voltage and a current transformer each samples current and voltage i
used to deliver voltage and current to calculate energy consumed in KWH. The circuit ca
handle up to 20A current. The meter converts energy consumed to pulses of resolution 6.4
Imp/Wh. The pulses converted are then transmitted to modulator and communicated via
non-linear channel to the demodulator circuit.
At demodulator circuit, connected to personal computer, signal is demodulated and using
microcontroller sent to personal computer via LPT. A VB6 program reads port and saves th
received data to an .dat file.
A power supply unit delivers the power required by the I Cs at demodulator circuit. Powe
supply unit consists of a transformer and 78XX series voltage regulators for regulated suppl
at +5V.
Demodulation Circuit would be at back side of PC and DATA COLLECTION SOFTWARE i
PC. Altogether the energy consumption at switches will be recorded on PC.
-
7/30/2019 Centralized Power Monitoring System Report
3/45
CENTRALIZED POWER MONITORING SYSTEM
3 | P a g e N I L O T P A L M R I N A L
CHAPTER-2
BLOCK DIAGRAM
-
7/30/2019 Centralized Power Monitoring System Report
4/45
CENTRALIZED POWER MONITORING SYSTEM
4 | P a g e N I L O T P A L M R I N A L
In this chapter the idea and conceptual block diagram will be demonstrated to provide clea
understandings of the project.
2.1CONCEPT
CALCULATION CIRCUIT is installed at the back side of switch boxes, and DAT
COLLECTION SOFTWARE at PC. The calculation circuit is a PCB which will calculate th
energy consumed by each appliance which is connected. The calculation circuit is in paralle
with every switch and is to be assembled behind switch box.
Figure 2.1: Conceptual Diagram
-
7/30/2019 Centralized Power Monitoring System Report
5/45
CENTRALIZED POWER MONITORING SYSTEM
5 | P a g e N I L O T P A L M R I N A L
2.2 BLOCK DIAGRAM
The transmission media to be used is selected as telephone cable because it is economica
and has minimum loss. Demodulator is connected to PC with less than 3ft D25 connecto
cable.
The Block diagram is shown in Figure 2.2.
Figure 2.2: Block Diagram
-
7/30/2019 Centralized Power Monitoring System Report
6/45
CENTRALIZED POWER MONITORING SYSTEM
6 | P a g e N I L O T P A L M R I N A L
2.2.1 Calculation Circuit
Two transformers a voltage and a current transformer each samples current and voltage i
used to deliver voltage and current to calculate energy consumed in KWh. The circuit ca
handle up to 20A current. The meter converts energy consumed to pulses of resolution 6.4
Imp/Wh. The pulses converted are then transmitted to modulator and communicated via a
non-linear channel to the demodulator circuit.
2.2.2 Transmission Media
The transmission media to be used is selected as telephone cable because it is economica
and has minimum loss over distance.
2.2.3 Demodulator Circuit
At demodulator circuit (connected to PC), first ASK is demodulated to get the same analo
signal at the output of watt meter. Using 89C4051 the analog signal is converted and
interfaced to parallel port of PC.
2.2.4 Computer
A simple PC is used with Windows Platform installed with Pratham v7.1, a VB6 program t
control and receive data from parallel port of computer. Demodulator is connected to PC wit
less than 3ft D25 connector cable. Pratham v7.1, program reads port automatically an
saves the received data to an .ini file.
2.2.5 Power Supply unit (PSU)
Power Supply Unit consists of a Transformer (15-0-15), 7815, 7805 and 7915 voltag
regulators. It provides required power for the I Cs.
-
7/30/2019 Centralized Power Monitoring System Report
7/45
CENTRALIZED POWER MONITORING SYSTEM
7 | P a g e N I L O T P A L M R I N A L
CHAPTER-3
WORKING
-
7/30/2019 Centralized Power Monitoring System Report
8/45
CENTRALIZED POWER MONITORING SYSTEM
8 | P a g e N I L O T P A L M R I N A L
In this chapter the circuit diagrams will be explained for all of the constituent circuits. First is
calculation circuit.
3.1CALCULATION CIRCUIT
The circuit diagram of calculation circuit is shown in Figure 3.1.
Figure 3.1: Calculation Circuit
A potential and a current transformer is used to sample current and a microcontroller base
energy kit CD2299 is used to convert energy usage into pulses of resolution 6.4Im/Wh. A
electro mechanical interface shows the traditional readings. An analog MUX converts pulse
into ASK. The ASK is then transmitted to demodulator circuit that is remote to the calculatio
-
7/30/2019 Centralized Power Monitoring System Report
9/45
CENTRALIZED POWER MONITORING SYSTEM
9 | P a g e N I L O T P A L M R I N A L
circuit. An oscillator using LM353 creates sine wave at frequency 43.3 KHz. This sine wave is
used as carrier for ASK message signal.
Due to most of the transmission lines are non linear the ASK is best suited for no
synchronous modulation. However the error in ASK generation and detection results i
change of pulse width but the relevant change in pulse width does not affect the outcome
The frequency of pulse is too small, in order of few hertz hence, practically the outcome o
project merely depends upon the number of pulses which on the later circuit will be counted
after demodulation inside microcontroller programmed to perform interfacing with computer.
Error in modulation scheme is hence avoided by using microcontroller based counter.
3.2 DEMODULATOR CIRCUIT
The circuit diagram of demodulation circuit is shown in Figure 3.2.
Figure 3.2: Demodulator Circuit
-
7/30/2019 Centralized Power Monitoring System Report
10/45
CENTRALIZED POWER MONITORING SYSTEM
10 | P a g e N I L O T P A L M R I N A L
The output of calculation circuit is provided to opto-coupler which provides electric isolatio
between circuits. The output of opto-coupler is fed to an comparator using uA741 whic
demodulates ASK. A microcontroller AT89C4051 is used to count pulses and convert th
count to hexadecimal.
The hexadecimal number represents the energy consumed in resolution of 10 Wh/uni
74244 buffer is used to interface the output data of microcontroller to computers parallel po
using D25 connector. The buffer provides reading of output nibble-wise. i.e. The hexadecima
output is read one nibble at a time by VB program. The program then joins the data an
makes byte form nibbles.
3.3 POWER SUPPLY UNIT
The circuit diagram of Power Supply Unit is shown in Figure 5.
Figure 3.3: Power Supply Unit Circuit
-
7/30/2019 Centralized Power Monitoring System Report
11/45
CENTRALIZED POWER MONITORING SYSTEM
11 | P a g e N I L O T P A L M R I N A L
Power Supply Unit consists of a Transformer rated 15-0-15, three 78XX series voltag
regulators and it provide required power for the circuitry.
First a Bridge Rectifier converts AC into DC. The rectified output from bridge rectifier is then
regulated and filtered using 78XX series voltage regulators. 7815 produces +15V, 7915
produces -15V and 7805 produces +5V. Altogether the constituents provide a stable and
reliable power supply unit for I Cs. Transformer chosen is a 15-0-15, 1 Amp type. For inpu
and output filtering capacitors are used so that the ripple in output can be reduced. All diodes
are 1N4001/1N4007.
3.4 SOFTWARE
A simple PC is used with Windows Platform installed with Pratham v7.1, a VB6 program t
control and receive data from parallel port of computer. Demodulator is connected to PC wit
less than 3ft D25 connector cable. Pratham, program reads port and saves the received dat
to a .dat file.
Snapshot of the program is depicted in Figure 6.
Figure 3.4 : Main Window (Pratham v7.1)
-
7/30/2019 Centralized Power Monitoring System Report
12/45
CENTRALIZED POWER MONITORING SYSTEM
12 | P a g e N I L O T P A L M R I N A L
The software can work in two modes one is automatic another is manual. The software itse
is capable of logging data with date and time. It converts the data received to Watt-Hour and
logs it in a file at application directory under name of data.dat. It reads output nibble b
nibble and then by using a function joins nibbles to form a complete byte.
-
7/30/2019 Centralized Power Monitoring System Report
13/45
CENTRALIZED POWER MONITORING SYSTEM
13 | P a g e N I L O T P A L M R I N A L
CHAPTER 4
Components and Their Configurations
-
7/30/2019 Centralized Power Monitoring System Report
14/45
CENTRALIZED POWER MONITORING SYSTEM
14 | P a g e N I L O T P A L M R I N A L
4.1 OPERATIONAL AMPLIFIER
4.1.1 LM741
The LM741 series are general purpose operational amplifiers which feature improve
performance over industry standards like the LM709. The amplifiers offer many feature
which make their application nearly fool proof, over load protection on the input and outpu
no latch up when the common mode range is exceeded as well as freedom from oscillations.
The LM741 has their performance guaranteed over a zero degree Celsius to seventy degre
Celsius temperature range, instead of minus fifty five degree Celsius to one hundred an
twenty five degree Celsius.
Pin Diagram:
Figure 4.1: uA741 Pin Detail
LM741 is used as same as non inverting summer and for demodulation of PWM and ASK.
4.1.2 LF353
The LF353 is a JFET input operational amplifier with an internally compensated input offse
voltage. The JFET input device provides with bandwidth, low input bias currents and offse
currents.
-
7/30/2019 Centralized Power Monitoring System Report
15/45
CENTRALIZED POWER MONITORING SYSTEM
15 | P a g e N I L O T P A L M R I N A L
Pin Details:
Figure 4.2: LF353 Pin Detail
LF353 is used in differential amplifier and sine wave oscillator used in ASK. It has a high slewrate for around 30V/us, that is why it is used in sine wave generation. The circuit diagram fo
sine wave generator is depicted below if Figure 15.
Oscillation Circuit :
Figure 4.3: Oscillation Circuit Diagram
We need Vout = +/5 V thus Vcc = +/- 5V. To limit the output we use diodes so that forward
current is assumed to be 1mA.
-
7/30/2019 Centralized Power Monitoring System Report
16/45
CENTRALIZED POWER MONITORING SYSTEM
16 | P a g e N I L O T P A L M R I N A L
Design:
Requirement, Vcc = +/- 15V, Vout = +/- 5V, f = 43.3 KHz
Assume, R = 170E , C = 1 / ( 2 * pi * 2.44 * 43.3K) ...Equation 5
Therefore, chosen C = 0.1uF.
For Vout = +/- 5V,
Assume, Id = 1mA, R1 = 3V / (29 * 1mA) ......Equation 6
R3 = 2 * Vf / Id = 2 * 0.7V / 1mA, R3 = 1k4 ..Equation 7
Therefore, R4 = R2R3 = 3k6. Diodes used are OA79.
4.2 VOLTAGE REGULATOR (78XX series)
The LM 7805 series of three positive regulators are available in the TO -220 package an
with several fixed output voltages making them useful in a wide range of applications. Eac
type employs internal circuit limiting, thermal shut down and safe operating area protection
making it essentially in destructible. If adequate heat sinking is provided, they can delive
over one ampere output current. Although the design is primarily as fixed voltage regulator
this device can be used with external components to obtain adjustable voltages and currents
The LM7915 series of three terminal regulators is available with fixed output voltages of -
volt, -8 volt, -12 volt and -15 volt. This device needs only one external component
compensation capacitor at the output. The LM7915 series is packed in the TO-220 powe
package and is capable of supplying 1.5 ampere of output current.
This regulator employs internal current limiting safe area protection and thermal shut down
for protection against virtually all over load conditions.
-
7/30/2019 Centralized Power Monitoring System Report
17/45
CENTRALIZED POWER MONITORING SYSTEM
17 | P a g e N I L O T P A L M R I N A L
Pin Diagram:
Figure 4.4: 78XX Voltage Regulators
4.3 BUFFERS (74LS244)
Three state outputs drive bus lines or buffer memory address resistors, PNP inputs reduce
DC loading, hysteresis at inputs improves noise margin. This octal buffers and line driver
are designed specifically to improve both the performance and density of three state memory
address driver, clock drivers and bus oriented receivers and transmitters. The designer has
choice of selected combinations of inverting and non-inverting outputs, symmetrical G inputs
and complementary G and G^ inputs. These devices feature high fan out, improved fan in
and 400mV noise margin. The pin detail of 74244 buffer is depicted in Figure 20.
-
7/30/2019 Centralized Power Monitoring System Report
18/45
CENTRALIZED POWER MONITORING SYSTEM
18 | P a g e N I L O T P A L M R I N A L
Schematic Diagram:
Figure 4.4: 74LS244 Pin Detail
4.4 TRANSFORMER
A transformer is a static or stationary device which transfers electrical power from one circu
to another without change of frequency. The principle of working of transformer is mutua
induction between two circuits linked by a common magnetic flux.
It consists of two separate coils placed on a laminated core. These coils are electricall
separated and magnetically linked through a path of low reluctance. The two coils possesse
high mutual inductance. If any one of the two coils called primary is connected to a source o
alternating voltage, and alternating flux with the same frequency of as that of supply voltageswill set up in the wave. Most of alternating flux will be linked with the other coil called
secondary and have mutually induced EMF is produced in it. According to the faradays law
of electromagnetic induction, if the secondary circuit is closed with a load, impedance then a
current flows through it. Hence electrical power is transferred from primary to secondar
without change of frequency. In an ideal transformer, the induced voltage in secondar
-
7/30/2019 Centralized Power Monitoring System Report
19/45
CENTRALIZED POWER MONITORING SYSTEM
19 | P a g e N I L O T P A L M R I N A L
winding (Vs) is in proportion to the primary voltage (Vp), and is given by the ratio of th
number of turns in the secondary (Ns) to the number of turns in the primary (Np) as follows:
Vs/Vp=Ns/Np
Figure 21 :
Figure 4.5: Transformer Winding
Based on voltage transformation ratio or turns ratio, a transformer may be Step-u
transformer for which number of turns on secondary is greater than number of turns o
primary and in Step-down transformer, the number of turns on secondary is less than that o
primary.
-
7/30/2019 Centralized Power Monitoring System Report
20/45
CENTRALIZED POWER MONITORING SYSTEM
20 | P a g e N I L O T P A L M R I N A L
CHAPTER 5
MICROCONTROLLER AND PROGRAMMING
-
7/30/2019 Centralized Power Monitoring System Report
21/45
CENTRALIZED POWER MONITORING SYSTEM
21 | P a g e N I L O T P A L M R I N A L
5.1 MICROCONTROLLER (AT89C4051)
The AT89C4051 is a low-voltage, high-performance CMOS 8-bit microcontroller with 4K
bytes of Flash programmable and erasable read-only memory. This device is made usin
Atmels high-density nonvolatile memory technology and is compatible with the industry
standard MCS-51 instruction set. By combining a versa-tile 8-bit CPU with Flash on
monolithic chip, the Atmel AT89C4051 is a powerful microcontroller which provides a highly
flexible and cost-effective solution to many embedded control applications. The AT89C405
provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 15 I/O lines
two 16-bit timer/counters, a five-vector, two-level interrupt architecture, a full duplex seria
port, a precision analog comparator, on-chip oscillator and clock circuitry. In addition, th
AT89C4051 is designed with static logic for operation down to zero frequency and support
two software-selectable power saving modes. The Idle Mode stops the CPU while allowin
the RAM, timer/counters, serial port and interrupt system to continue functioning. The powe
down mode saves the RAM contents but freezes the oscillator disabling all other chi
functions until the next hardware reset.
RESTRICTION ON CERTAIN INSTRUCTIONS
The AT89C4051 is an economical and cost-effective member of Atmels growing family o
micro-controllers. It contains 4K bytes of Flash program memory. It is fully compatible with
the MCS-51 architecture, and can be programmed using the MCS-51 instruction se
However, there are a few considerations one must keep in mind when utilizing certai
instructions to program this device. All the instructions related to jumping or branching shoul
be restricted such that the destination address falls within the physical program memor
space of the device, which is 4K for the AT89C4051. This should be the responsibility of the
software programmer. For example, LJMP 0FE0H would be a valid instruction for th
AT89C4051 (with 4K of memory), whereas LJMP 1000H would not.
LCALL, LJMP, ACALL, AJMP, SJMP, JMP @A+DPTR. These unconditional branchin
instructions will execute correctly as long as the program keeps the destination branchin
address within the physical boundaries of the program memory size (locations 00H to FFFH
for the 89C4051). Violating the physical space limits may cause unknown program behavior.
-
7/30/2019 Centralized Power Monitoring System Report
22/45
CENTRALIZED POWER MONITORING SYSTEM
22 | P a g e N I L O T P A L M R I N A L
CJNE, DJNZ, JB, JNB, JC, JNC, JBC, JZ, JNZ. With these conditional branching instruction
the same rule above applies. Again, violating the memory boundaries may cause errati
execution. For applications involving interrupts, the normal interrupt service routine addres
locations of the 80C51 family architecture have been preserved.
POWER-DOWN MODE
In the power-down mode the oscillator is stopped and the instruction that invokes power
down is the last instruction executed. The on-chip RAM and Special Function Register
retain their values until the power-down mode is terminated. The only exit from power-dow
is a hardware reset. Reset redefines the SFRs but does not change the on-chip RAM. Th
reset should not be activated before VCC is restored to its normal operating level and mus
be held active long enough to allow the oscillator to restart and stabilize.
Pin Diagram:
Figure 5.1: AT89C4051Pin Detail
-
7/30/2019 Centralized Power Monitoring System Report
23/45
CENTRALIZED POWER MONITORING SYSTEM
23 | P a g e N I L O T P A L M R I N A L
5.2 PROGRAM
The program for microcontroller is written in C. The reg51.h header file is included fo
embedded C for Atmel series microcontroller operations. At P3.4 the pulses are detected an
counter is initialized to count up to 64. Then at 65th
pulse P1 is incremented. AT80C4051 i
20 pin I C with only two ports P1 and P3. An interrupt service routine is used as subroutin
for incrementing P1.
CODE:
#include
unsigned char i=0;
void incrii() interrupt 1
{
i++ ;
}
void main ()
{
P1=00; TMOD=0x06; TL0=-64; TH0=-64; TR0=1;
T0=1; TF0=0; IE=0x82; i=0;
while(1)
{
P1=i;
}
}
-
7/30/2019 Centralized Power Monitoring System Report
24/45
CENTRALIZED POWER MONITORING SYSTEM
24 | P a g e N I L O T P A L M R I N A L
In this program T0 is set as up counter to count 64. P3.4 is chosen to receive pulses from
demodulator output. After receiving 64 pulses P1 i.e. port 1 is incremented by 1. An interrup
service routine is called for incrementing P1. Using an ISR makes it possible fo
microcontroller to work in multitasking mode The objective of counting 64 is to change the
resolution to 10WH. Later the transmitted data is received at parallel port and converted tKWh.
-
7/30/2019 Centralized Power Monitoring System Report
25/45
CENTRALIZED POWER MONITORING SYSTEM
25 | P a g e N I L O T P A L M R I N A L
CHAPTER 6
Modulation and Demodulation
-
7/30/2019 Centralized Power Monitoring System Report
26/45
CENTRALIZED POWER MONITORING SYSTEM
26 | P a g e N I L O T P A L M R I N A L
ASK (Amplitude Shift Keying)
Amplitude-shift keying (ASK) is a form ofmodulation that represents digital data as variation
in the amplitude of a carrier wave. The amplitude of an analog carrier signal varies i
accordance with the bit stream (modulating signal), keeping frequency and phase constan
The level of amplitude can be used to represents binary logic 0s and 1s. We can think of
carrier signal as an ON or OFF switch. In the modulated signal, logic 0 is represented by the
absence of a carrier, thus giving OFF/ON keying operation and hence the name given. Lik
AM, ASK is also linear and sensitive to atmospheric noise, distortions, propagatio
conditions on different routes in PSTN, etc. Both ASK modulation and demodulatio
processes are relatively inexpensive. The ASK technique is also commonly used to transm
digital data over optical fiber. For LED transmitters, binary 1 is represented by a short pulse o
light and binary 0 by the absence of light. Laser transmitters normally have a fixed bias
current that causes the device to emit a low light level. This low level represents binary 0
while a higher-amplitude light wave represents binary 1.
6.1 MODULATION
CD4051 is used to generate ASK. CD4051 is analog MUX. Select lines is connected so tha
S2 at pin 11 and S1 at pin10 is connected to ground. S0 at pin 9 is connected to output o
PWM. The signal when high gives output of sine wave of 43.3 KHz at pin as I1 at pin is fed
with output of LF353 oscillator. The circuit diagram of ASK generation is shown in Figure 23.
CIRCUIT DIAGRAM:
Figure 6.1: ASK Generation
http://localhost/var/www/apps/conversion/tmp/scratch_3/wiki/Modulationhttp://localhost/var/www/apps/conversion/tmp/scratch_3/wiki/Signal_(electrical_engineering)http://localhost/var/www/apps/conversion/tmp/scratch_3/wiki/Frequencyhttp://localhost/var/www/apps/conversion/tmp/scratch_3/wiki/Phase_(waves)http://localhost/var/www/apps/conversion/tmp/scratch_3/wiki/Binary_numeral_systemhttp://localhost/var/www/apps/conversion/tmp/scratch_3/wiki/Binary_numeral_systemhttp://localhost/var/www/apps/conversion/tmp/scratch_3/wiki/Phase_(waves)http://localhost/var/www/apps/conversion/tmp/scratch_3/wiki/Frequencyhttp://localhost/var/www/apps/conversion/tmp/scratch_3/wiki/Signal_(electrical_engineering)http://localhost/var/www/apps/conversion/tmp/scratch_3/wiki/Modulation -
7/30/2019 Centralized Power Monitoring System Report
27/45
CENTRALIZED POWER MONITORING SYSTEM
27 | P a g e N I L O T P A L M R I N A L
6.2 Demodulation
Demodulation is done using uA741 in comparator mode. The output swings between +/-15V
for +/- Vsat. The output of comparator gives back the PWM. The circuit diagram o
demodulator is shown in Figure 23.
CIRCUIT DIAGRAM:
Figure 6.2: ASK Demodulation using Comparator
-
7/30/2019 Centralized Power Monitoring System Report
28/45
CENTRALIZED POWER MONITORING SYSTEM
28 | P a g e N I L O T P A L M R I N A L
CHAPTER 7
APPLICATION AND SCOPE
-
7/30/2019 Centralized Power Monitoring System Report
29/45
CENTRALIZED POWER MONITORING SYSTEM
29 | P a g e N I L O T P A L M R I N A L
7.1 APPLICATION
The project can be used in large malls and commercial building where monitoring i
impossible by inspection.
In large area of installation we can easily set it up by use of amplification circuit o
lines.
Safe house monitoring.
Warehouse energy monitoring.
7.2 SPECIAL FEATURE
It is affordable because software to be used can be made on any platform suiting an
operating system.
A personal computer can be designed in such a way that with minimum configuration
can handle the system in unique.
Project itself can be enhanced in such a way that it administers the complete switchin
in applied area.
Low power consumption and easy to maintain and repair.
Once the information is received at computer, it can be transmitted over a lon
distance via internet and can be administered remotely by executives of company.
7.3 SCOPE FOR FUTURE WORK
The project in total can send the power consumption of a switch to computer and hence the
power consumption can be remotely monitored. The transmission media to be used i
telephone cable and it could transmit data over a large distance without significant loss
economically.
It can be further translated into a circuit which administers the power and every household i
remote areas. It can be used for automatic lighting system when the beholders of house o
-
7/30/2019 Centralized Power Monitoring System Report
30/45
CENTRALIZED POWER MONITORING SYSTEM
30 | P a g e N I L O T P A L M R I N A L
company are not home.
A website supporting java platform can be part of centralized power monitoring system. Suc
as Gmail when password is entered it will let to decide which switch to close/open an
when?. So a simple idea can be turned into industry.
-
7/30/2019 Centralized Power Monitoring System Report
31/45
CENTRALIZED POWER MONITORING SYSTEM
31 | P a g e N I L O T P A L M R I N A L
CHAPTER 8
RESULT AND CONCLUSION
-
7/30/2019 Centralized Power Monitoring System Report
32/45
CENTRALIZED POWER MONITORING SYSTEM
32 | P a g e N I L O T P A L M R I N A L
CONCLUSION
In this project work an attempt has been made and succeeded in monitoring powe
consumption remotely via telephone cable. The PC can be designed in such a way that wit
minimum configuration it can handle the system only.
RESULT
Rating of
Complex
Load
(Watt)
Observed
Reading on
PC
Conversion
Constant
Time
(sec)
Energy
Measured
(Watt-Hour)
Time
(sec)
1000 10
2000 10
Table 1: Result
-
7/30/2019 Centralized Power Monitoring System Report
33/45
CENTRALIZED POWER MONITORING SYSTEM
33 | P a g e N I L O T P A L M R I N A L
BIBLIOGRAPHY
References:
David A Bell, Op-Amps and Linear I Cs, Fourth Edition, 2006, Prentice Hall India,New Delhi.
K Sam Shamugham, Digital and Analog Communication, Fourth Edition, 2006,
John Wiley and Sons, New York.
Jan Axelson, Parallel Port Complete, First Edition, Lakeview Research, Madison
(USA).
-
7/30/2019 Centralized Power Monitoring System Report
34/45
CENTRALIZED POWER MONITORING SYSTEM
34 | P a g e N I L O T P A L M R I N A L
Appendix I
SOFTWARE
-
7/30/2019 Centralized Power Monitoring System Report
35/45
CENTRALIZED POWER MONITORING SYSTEM
35 | P a g e N I L O T P A L M R I N A L
a. Pratham v7.0
Pratham v7.0 is installed on PC with windows operating system. This software is mad
in VB 6. It can be used on any port and baud rate. This software uses an active x
control in VB6. It is for mere illustration and test of the circuit. The user friendly and
more compatible version can be made using C. The software is so simple that it can
be made free source. Further it can be used to put a switch on and off thus, creating
powerful tool. The same can be used to communicate data over the internet.
b. Code
FRMMAIN.FRM
Option Explicit
Const Start% = 8
Const HighNibbleSelect% = &H10
Dim DataIn%(0 To 7)
Dim ChannelNumber%
Dim LowNibble%
Dim HighNibble%
Private Sub cmdReadPorts_Click()
Dim EOC%
For ChannelNumber = 0 To 7
'Select the channel.
DataPortWrite BaseAddress, ChannelNumber
-
7/30/2019 Centralized Power Monitoring System Report
36/45
CENTRALIZED POWER MONITORING SYSTEM
36 | P a g e N I L O T P A L M R I N A L
'Pulse Start to begin a conversion.
DataPortWrite BaseAddress, ChannelNumber + Start
DataPortWrite BaseAddress, ChannelNumber
'Wait for EOC
Do
DoEvents
LowNibble = StatusPortRead(BaseAddress)
EOC = BitRead(LowNibble, 6)
Loop Until EOC = 1
'Read the byte in 2 nibbles.
DataPortWrite BaseAddress, ChannelNumber + HighNibbleSelect
HighNibble = StatusPortRead(BaseAddress)
DataIn(ChannelNumber) = MakeByteFromNibbles()
Next ChannelNumber
DisplayResult
End Sub
Private Sub DisplayResult()
For ChannelNumber = 0 To 7
lblADC(ChannelNumber).Caption = Hex$(DataIn(ChannelNumber)) & "h"
Next ChannelNumber
End Sub
Private Sub Form_Load()
StartUp
-
7/30/2019 Centralized Power Monitoring System Report
37/45
CENTRALIZED POWER MONITORING SYSTEM
37 | P a g e N I L O T P A L M R I N A L
End Sub
Private Sub Form_Unload(Cancel%)
ShutDown
End Sub
Private Function MakeByteFromNibbles%()
Dim S0%, S1%, S2%, S3%, S4%, S5%, S6%, S7%
S0 = (LowNibble And 8) \ 8
S1 = (LowNibble And &H10) \ 8
S2 = (LowNibble And &H20) \ 8
S3 = (LowNibble And &H80) \ &H10
S4 = (HighNibble And 8) * 2
S5 = (HighNibble And &H10) * 2
S6 = (HighNibble And &H20) * 2
S7 = HighNibble And &H80
MakeByteFromNibbles = S0 + S1 + S2 + S3 + S4 + S5 + S6 + S7
End Function
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub mnuPort_Click(Index%)
frmSelectPort.Show
End Sub
-
7/30/2019 Centralized Power Monitoring System Report
38/45
CENTRALIZED POWER MONITORING SYSTEM
38 | P a g e N I L O T P A L M R I N A L
Frmnewportaddress.frm
Option Explicit
Private Sub cmdCancel_Click()
frmNewPortAddress.Hide
End Sub
Private Sub cmdOK_Click()
Dim NewPortAddress%
Dim IndexOfNewPort%
Dim Character$
Dim ValidEntry%
ValidEntry = True
IndexOfNewPort = 3
'Read the port address entered by the user.
'If the address is within the accepted range, hide this form,
'enable the port's option button, and display the address.
'If the address is out of range, display a message.
'If the text box is empty, disable the port's option button.
Select Case txtAddressOfNonStandardPort.Text
Case ""
NewPortAddress = 0
Port(IndexOfNewPort).Address = 0
-
7/30/2019 Centralized Power Monitoring System Report
39/45
CENTRALIZED POWER MONITORING SYSTEM
39 | P a g e N I L O T P A L M R I N A L
Port(IndexOfNewPort).PortType = ""
Port(IndexOfNewPort).Enabled = False
frmSelectPort.optPortName(0).Value = True
frmNewPortAddress.Hide
UpdateLabels
Case Else
NewPortAddress = CInt(Val("&h" & txtAddressOfNonStandardPort.Text))
If NewPortAddress > 0 And NewPortAddress < &H800 Then
Port(IndexOfNewPort).Address = NewPortAddress
Port(IndexOfNewPort).Enabled = True
frmSelectPort.optPortName(IndexOfNewPort).Value = True
frmNewPortAddress.Hide
UpdateLabels
Else
MsgBox "The port address must be between 0 and 7FFF. Leave the address blank if
there is no port."
End If
End Select
End Sub
Private Sub Form_Load()
Left = (Screen.Width - Width) / 2
Top = (Screen.Height - Height) / 2
End Sub
-
7/30/2019 Centralized Power Monitoring System Report
40/45
CENTRALIZED POWER MONITORING SYSTEM
40 | P a g e N I L O T P A L M R I N A L
Frmselectport.frm
Option Explicit
Private Sub cboEcpMode_Click(Index As Integer)
SetEcpMode (cboEcpMode(Index).ListIndex)
End Sub
Private Sub cmdAddPort_Click()
'Display a text box to enable user to add a port
'at a nonstandard address.
frmNewPortAddress.Show
End Sub
Private Sub cmdFindPorts_Click()
'Test the port at each of the standard addresses,
'and at the non-standard address, if the user has entered one.
Dim Index%
Dim PortExists%
Dim Count%
Index = 0
'First, test address 3BCh
Port(Index).Address = &H3BC
PortExists = TestPort(Index)
'If there is a port at 3BCh, increment the index.
-
7/30/2019 Centralized Power Monitoring System Report
41/45
CENTRALIZED POWER MONITORING SYSTEM
41 | P a g e N I L O T P A L M R I N A L
If Not (Port(Index).Address) = 0 Then
Index = Index + 1
End If
'Test address 378h
Port(Index).Address = &H378
PortExists = TestPort(Index)
'If the port exists, increment the index.
If Not (Port(Index).Address) = 0 Then
Index = Index + 1
End If
'Test address 278h
Port(Index).Address = &H278
PortExists = TestPort(Index)
'Disable option buttons of unused LPT ports
For Count = Index + 1 To 2
optPortName(Count).Enabled = False
Port(Count).Enabled = False
Next Count
If Not (Port(3).Address = 0) Then
PortExists = TestPort(Index)
Else
optPortName(3).Enabled = False
End If
End Sub
-
7/30/2019 Centralized Power Monitoring System Report
42/45
CENTRALIZED POWER MONITORING SYSTEM
42 | P a g e N I L O T P A L M R I N A L
Private Sub cmdOK_Click()
frmSelectPort.Hide
End Sub
Private Sub cmdTestPort_Click()
Dim PortExists%
Dim Index%
'Get the address of the selected port
Index = -1
Do
Index = Index + 1
Loop Until optPortName(Index).Value = True
PortExists = TestPort(Index)
Select Case PortExists
Case True
MsgBox "Passed: Port " + Hex$(BaseAddress) + "h is " + Port(Index).PortType + ".", 0
"Test Result:"
Case False
MsgBox "Failed port test. ", 0, "Test Result:"
End Select
End Sub
Private Sub Form_Load()
Dim Index%
Left = (Screen.Width - Width) / 2
-
7/30/2019 Centralized Power Monitoring System Report
43/45
CENTRALIZED POWER MONITORING SYSTEM
43 | P a g e N I L O T P A L M R I N A L
Top = (Screen.Height - Height) / 2
'Load the combo boxes with the ECP modes.
For Index = 0 To 3
cboEcpMode(Index).AddItem "SPP (original)"
Next Index
For Index = 0 To 3
cboEcpMode(Index).AddItem "bidirectional"
Next Index
For Index = 0 To 3
cboEcpMode(Index).AddItem "Fast Centronics"
Next Index
For Index = 0 To 3
cboEcpMode(Index).AddItem "ECP"
Next Index
For Index = 0 To 3
cboEcpMode(Index).AddItem "EPP"
Next Index
For Index = 0 To 3
cboEcpMode(Index).AddItem "reserved"
Next Index
For Index = 0 To 3
cboEcpMode(Index).AddItem "reserved"
Next Index
For Index = 0 To 3
cboEcpMode(Index).AddItem "test"
-
7/30/2019 Centralized Power Monitoring System Report
44/45
CENTRALIZED POWER MONITORING SYSTEM
44 | P a g e N I L O T P A L M R I N A L
Next Index
For Index = 0 To 3
cboEcpMode(Index).AddItem "configuration"
Next Index
'Enable the option buttons for existing ports.
For Index = 0 To 3
optPortName(Index).Enabled = Port(Index).Enabled
Next Index
UpdateLabels
End Sub
Private Sub optPortName_Click(Index As Integer)
'Store the address and index of the selected port.
Dim Count%
BaseAddress = Port(Index).Address
IndexOfSelectedPort = Index
EcpDataPortAddress = BaseAddress + &H400
EcrAddress = BaseAddress + &H402
For Count = 0 To 3
cboEcpMode(Count).Enabled = False
Next Count
cboEcpMode(Index).Enabled = True
End Sub
The code above is only VB6 code for Pratham v7.0. The required dlls can be found o
windows website. There are three forms in application as depicted before. Modules can be
added to fulfill the port logic control using microprocessor of PC itself.
-
7/30/2019 Centralized Power Monitoring System Report
45/45
CENTRALIZED POWER MONITORING SYSTEM
Thanks to,
Texas Instruments and National semiconductors for online support.
Watt-hour meter is original idea from National Data Handbook, Prentice HallUSA, 1993.
Google Images.
Department of Electrical and Electronics Engineering, SIT, Tumkur.