current measuring using controller
CONTENTS
1. PROJECT DESCRIPTION
2. Microcontroller AT89C51
3. MCS-51 Family Instruction Set
4. ATMEL Series of microcontroller
5. Hardware Description
7. Working Principle
8. Circuit Diagram
9. Program
10. List of Components
11. Data Sheets
12. Bibliography
PROJECT DESCRIPTION
The project Current detector cum controller is very much useful for controlling the load in any industry. In this project we are measuring the current consumed by all the loads connected in a house. If the load current exceed the set value of current the load will be disconnected immediately. The heart of the project is microcontroller AT89S51 and current sensing transformer. The current sensing transformer is used to sense the current consumed by load. The current sensed by the current sensor is converted into voltage and feed to the ADC0804 for analog to digital conversion. The digital equivalent of the current is read by microcontroller AT89S51 from the ADC0804. The digital value of current is processed my microcontroller and displayed on LCD. We have provided a 16×2 LCD display for displaying the value of load current and set current. For changing the value of set current there are two keys called UP/DOWN keys. The UP/DOWN Keys can be used to increase or decrease the value of set current. One key is provided to reset the load supply after an over current trip. Five different loads are connected for testing purpose. The load supply can be can be switched ON/OFF through a relay controlled by microcontroller. We have used 5V regulated supply for microcontroller AT89S51, ADC0804, LCD and 12V unregulated supply for relay circuit.
MICROCONTROLLER AT89C51
Features
• Compatible with MCS-51™ Products
• 4K Bytes of In-System Reprogrammable Flash Memory
– Endurance: 1,000 Write/Erase Cycles
• Fully Static Operation: 0 Hz to 24 MHz
• Three-Level Program Memory Lock
• 128 x 8-Bit Internal RAM
• 32 Programmable I/O Lines
• Two 16-Bit Timer/Counters
• Six Interrupt Sources
• Programmable Serial Channel
• Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash Programmable and Erasable Read Only Memory (PEROM). The device is manufactured using Atmel’s high density nonvolatile memory technology and is compatible with the industry standard MCS-51™ instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highly flexible and cost effective solution to many embedded control applications. The AT89C51 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, five vector two-level interrupt architecture, a full duplex serial port, and on-chip oscillator and clock circuitry.
HARDWARE DESCRIPTION
- Block Diagram of the System:-
WORKING OF CIRCUIT:-
POWER SUPPLY:-
In the power supply section we use one step down transformer with two diode as a full wave rectifier. Output of the rectifier is further converted into smooth dc with the help of the filter capacitor. Output of the capacitor is further connected to the ic regulator to provide a stable voltage to the microcontroller. Microcontroller requires a regulated 5 volt dc power supply for smooth operation. Here we use ic 7805 as a positive regulator to provide a 5 volt dc power supply.
Rectifier and regulator
In this lab you will construct and analyze a full wave rectifier and a shunt voltage regulator. All component types in the example circuit are available in OrCAD – Capture libraries for simulation.
I. Introduction
1.1 The Full Wave Rectifier
The first building block in the dc power supply is the full wave rectifier. The purpose of the full wave rectifier (FWR) is to create a rectified ac output from a sinusoidal ac input signal. It does this by using the nonlinear conductivity characteristics of diodes to direct the path of the current.
Figure 1. Common four-diode bridge configuration for the FWR
Diode Currents
Consider the current path in the diode bridge rectifier. In the positive half cycle of Vin, diodes D4 and D3 will conduct. During the negative half cycle, diodes D2 and D1 will conduct. As a result, the load will pass current in the same direction in each half cycle of the input.
Design Concerns
- Reverse current does not exceed the breakdown value
- Power dissipation limit P = Vd Id is not exceeded
Diode Voltages
- Forward Bias
- If we consider a simple, piece-wise linear model for the diode IV curve, the diode forward current is zero until Vbias >= Vthreshold, where Vthreshold is 0.6 V to 0.8 V. The current increases abruptly as Vbias increases further. Due to this turn-on or threshold voltage associated with the diode in forward bias, we should expect a 0.6 to 0.8 V voltage drop across each forward biased diode in the rectifier bridge. In the case of the full wave rectifier diode bridge, there are two forward biased diodes in series with the load in each half cycle of the input signal.
- The maximum output voltage (across load) will be Vin – 2 Vthreshold, or ~ Vin – 1.4 V.
- Since some current does flow for voltage bias below Vthreshold and the current rise around is Vthreshold is more gradual than the piece-wise model, the actual diode performance will differ from the simple model.
- Reverse Bias
- In reverse bias (and neglecting reverse voltage breakdown), the current through the diode is approximately the reverse saturation current, Io. The voltage across the load during reverse bias will be Vout = Io Rload.
- In specifying a diode for use in a circuit, you must take care that the limits for forward and reverse voltage and current are not exceeded.
1.2 Filtered Full Wave Rectifier
The filtered full wave rectifier is created from the FWR by adding a capacitor across the output.
Figure 2. Filtered full wave rectifier
The result of the addition of a capacitor is a smoothing of the FWR output. The output is now a pulsating dc, with a peak to peak variation called ripple. The magnitude of the ripple depends on the input voltage magnitude a
Input Sensitivity and Load Sensitivity
Assume the input to the shunt regulator is Vdc +/- Vripple. For Vin = Vin(max) = Vdc + Vripple, additional current is available from the source. To keep Vo = IL RL constant, some of that current must be shunted through the zener diode. As long as Iz < Iz(max), as defined by the maximum power dissipation for the zener, the circuit will safely regulate. Choose R to prevent the zener from exceeding its maximum current limit.
For Vin = Vin(min) = Vdc – Vripple, current drops. To keep Vo = IL*RL constant, the current through the zener diode must be reduced. To maintain regulation, Iz must not be reduced below the knee current. Choose R to maintain sufficient current through the zener:
The shunt regulator has several major problems which prevent its common use as the sole pre-regulation stage in dc power supplies:
- When the load is open circuit, all current is shunted through the zener diode. This requires an expensive, high power device.
- The line and load regulations values are high (~ 10 % or more).
- The energy efficiency is low.
For an improved design, the shunt regulator is used in conjunction with a series pass element with gain, usually a transistor, between the unregulated supply and the load.
Current Sensor/Transformer:-
Current transformers can perform circuit control, measure current for power measurement and control, and perform roles for safety protection and current limiting. They can also cause circuit events to occur when the monitored current reaches a specified level. Current monitoring is necessary at frequencies from the 50 Hz/60 Hz power line to the higher frequencies of switchmode transformers that range into the hundreds of kilohertz.
The object with current transformers is to think in terms of current transformation rather than voltage ratios. Current ratios are the inverse of voltage ratios. The thing to remember about transformers is that Pout = (Pin — transformer power losses). With this in mind, let’s assume we had an ideal loss-less transformer in which Pout = Pin. Since power is voltage times current, this product must be the same on the output as it is on the input. This implies that a 1:10 step-up transformer with the voltage stepped up by a factor of 10 results in an output current reduced by a factor of 10. This is what happens on a current transformer. If a transformer had a one-turn primary and a ten-turn secondary, each amp in the primary results in 0.1A in the secondary, or a 10:1 current ratio. It’s exactly the inverse of the voltage ratio — preserving volt times current product.
How can we use this transformer and knowledge to produce something useful? Normally, an engineer wants to produce an output on the secondary proportional to the primary current. Quite often, this output is in volts output per amp of primary current. The device that monitors this output voltage can be calibrated to produce the desired results when the voltage reaches a specified level.
A burden resistor connected across the secondary produces an output voltage proportional to the resistor value, based on the amount of current flowing through it. With our 1:10 turns ratio transformer that produces a 10:1 current ratio, a burden resistor can be selected to produce the voltage we want. If 1A on the primary produces 0.1A on the secondary, then by Ohm’s law, 0.1 times the burden resistor will result in an output voltage per amp.
Many voltage transformers have adjusted ratios that produce the desired output voltage and compensate for losses. The turns-ratios or actual turns aren’t the primary concern of the end-user. Only the voltage output and possibly regulation and other loss parameters may be of concern. With current transformers, the user must know the current ratio to use the transformer. The knowledge of amps in per amps out is the basis for use of the current transformer. Quite often, the end users provide the primary with a wire through the center of the transformer. They must know what secondary turns are to determine what their output current will be. Generally, in catalogues, the turns of the transformers are provided as a specification for use.
.
Component List
Designator | Description | Comment | Value |
1 | |||
230VAC | |||
C1 | Electro Cap (Radial) | 1000uF/35V | |
C2 | Electro Cap (Radial) | 470uF/25V | |
C3 | Ceramic Capacitor | 0.22uF/50V | |
C4 | Ceramic Cap | 0.1uF/50 | |
C5 | Ceramic Cap | 0.1uF/50 | |
C6 | Ceramic Cap | 0.1uF/50 | |
C7 | Ceramic Cap | 22pF | |
C8 | Ceramic Cap | 22pF | |
C9 | Electro Cap (Radial) | 10uF/16V | |
CT1 | Transformer (Equivalent Circuit Model) | ||
D1 | General Purpose Diode | 1N4007 | |
D2 | General Purpose Diode | 1N4007 | |
D3 | General Purpose Diode | 1N4007 | |
D4 | General Purpose Diode | 1N4007 | |
D5 | General Purpose Diode | 1N4007 | |
D6 | General Purpose Diode | 1N4007 | |
D7 | Switching Diode | 1N4148 | |
D8 | Switching Diode | 1N4148 | |
D9 | Switching Diode | 1N4148 | |
D10 | Switching Diode | 1N4148 | |
K1 | SPDT Relay | Relay | |
LCD1 | LCD_162A | ||
LED1 | Typical GaAs LED | ||
LED2 | Typical GaAs LED | ||
LOAD1 | |||
LOAD2 | |||
LOAD3 | |||
LOAD4 | |||
LOAD5 | |||
Q1 | PNP General Purpose Amplifier 25V/1.5A | S8550 | |
Q2 | NPN General Purpose Amplifier 25V/1.5A | S8050 | |
R1 | Resistor | 1K | |
R2 | Resistor | 1K | |
R3 | Resistor | 1K | |
R4 | Resistor | 1K | |
R5 | Resistor | 10K | |
R6 | Resistor | 1K | |
R7 | Resistor | 2.2K | |
R8 | Resistor | 2.2K | |
R9 | 10K | ||
REG1 | Voltage Regulator | LM7805 | |
SW1 | Switch | ||
SW2 | Switch | ||
SW3 | Switch | ||
SW4 | Switch | ||
TF1 | Common Mode Choke | 230/12VAC/0.5A | |
U1 | 8-Bit µP-Compatible A/D Converter | ADC0804LCN | |
U2 | AT89S51 | ||
VR1 | Potentiometer | 10K | |
VR2 | Potentiometer | 1K | |
Y1 | Crystal Oscillator |
Bibliography:
These website helped us in searching idea of projects
www. Atmel.com
8051 Ali Mazidi
Myke predko- embedded system