Sunday, 4 November 2012

Current Transformers


Current transformers are used extensively for measuring current and monitoring the operation of the power grid. Along with voltage leads, revenue-grade CTs drive the electrical utility's watt-hour meter on virtually every building with three-phase service and single-phase services greater than 200 amps.
The CT is typically described by its current ratio from primary to secondary. Often, multiple CTs are installed as a "stack" for various uses. For example, protection devices and revenue metering may use separate CTs to provide isolation between metering and protection circuits, and allows current transformers with different characteristics (accuracy, overload performance) to be used for the devices.


Picture above is the type of current transformer. This current transformer is to measure a current and the output will send to the microcontroller.

Omron Relay for the automatic trip

A relay is an electrically operated switch. Relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits, repeating the signal coming in from one circuit and re-transmitting it to another. 

A type of relay that can handle the high power required to directly control an electric motor or other loads is called a contactor. A contactor is a very heavy-duty relay used for switching electric motors and lighting loads, although contactors are not generally called relays. Continuous current ratings for common contactors range from 10 amps to several hundred amps. High-current contacts are made with alloys containing silver. The unavoidable arcing causes the contacts to oxidize; however, silver oxide is still a good conductor. Such devices are often used for motor starters. A motor starter is a contactor with overload protection devices attached. The overload sensing devices are a form of heat operated relay where a coil heats a bi-metal strip, or where a solder pot melts, releasing a spring to operate auxiliary contacts. These auxiliary contacts are in series with the coil. If the overload senses excess current in the load, the coil is de-energized. Contactor relays can be extremely loud to operate, making them unfit for use where noise is a chief concern.

This relay is use to give an automatic trip to the circuit breaker by sending the signal from the micro controller circuit.

Miature Circuit Breaker (MCB)


       


       Circuit breakers are electrical switching devices for protecting and controlling the electricity supply to respective electrical circuits. Circuit breakers protect electrical circuitry from damage due to an overcurrent condition, such as an overload condition or a relatively high level short circuit or fault condition. Electrical systems in residential, commercial and industrial applications usually include a panelboard for receiving electrical power from a utility source. The electrical power is then delivered from the panelboard to designated branch circuits supplying one or more loads.

        Overload protection is provided by a thermal element which, when heated by the increased current, will cause the circuit breaker to trip and interrupt the power. Use of circuit breakers is widespread in modern-day residential, commercial and industrial electric systems, and they constitute an indispensable component of such systems toward providing protection against over-current conditions. Various circuit breaker mechanisms have evolved and have been perfected over time on the basis of application-specific factors such as current capacity, response time, and the type of reset (manual or remote) function desired of the breaker.
           Typically, various types of circuit interrupters are connected to the branch circuits to reduce the risk of injury, damage or fires. Circuit interrupters include, for example, circuit breakers, contactors, motor starters, motor controllers, other load controllers and receptacles having a trip mechanism. In the event an overcurrent condition occurs, electrical contacts within the circuit breaker will open, stopping the flow of electrical current through the circuit breaker to the equipment. Circuit breakers have an operating mechanism and trip means, such as a thermal trip assembly and/or magnetic trip assembly, which are automatically releasable to effect tripping operations and manually resettable following tripping operations.


The components inside the circuit breaker:
  1. Actuator lever - used to manually trip and reset the circuit breaker. Also indicates the status of the circuit breaker (On or Off/tripped). Most breakers are designed so they can still trip even if the lever is held or locked in the "on" position. This is sometimes referred to as "free trip" or "positive trip" operation.
  2. Actuator mechanism - forces the contacts together or apart.
  3. Contacts - Allow current when touching and break the current when moved apart.
  4. Terminals
  5. Bimetallic strip.
  6. Calibration screw - allows the manufacturer to precisely adjust the trip current of the device after assembly.
  7. Solenoid
  8. Arc divider/extinguisher

           

Monday, 29 October 2012

Liquid Crystal Display (LCD)

Liquid Crystal Display (LCD)



This LCD is 2x16 character is use in this project to  display everything such as energy usage in kWh unit and the bill need to pay in RM unit.  This system is already convert from energy usage kWh to a billing in ringgit Malaysia (RM) by refer a tariff domestic from TNB. It also will display the set and preset the amount (RM) for the budget system

Proteus PCB Design



Proteus PCB Design Packages



 

Proteus PCB design combines the ISIS schematic capture and ARES PCB layout programs to provide a powerful, integrated and easy to use suite of tools for professional PCB Design..
All Proteus PCB design products include an integrated shape based auto router and a basic SPICE simulation capability as standard. More advanced routing modes are included in Proteus PCB Design Level 2 and higher whilst simulation capabilities can be enhanced by purchasing the Advanced Simulation option and/or micro-controller simulation capabilities.

Proteus PCB design is used to create a circuit of the microcontroller or project and interfacing with hi tech c compiler in MPLAB for the c code

Create PIC16F series project and program the PIC using MPLAB IDE



MPLAB IDE v8



The current version of MPLAB IDE is version 8.63. It is a 32-bit application on Microsoft Windows and includes several free software components for application development, hardware emulationand debugging. MPLAB IDE also serves as a single, unified graphical user interface for additional Microchip and third-party software and hardware development tools.
Both Assembly and C programming languages can be used with MPLAB IDE v8. Others may be supported through the use of third-party programs.

HI-TECH C



HI-TECH C compiler for PIC16 MCU implements the optimizations of Omniscient Code Generation™ (OCG). Whole program compilation technology to provide denser code and better performance for development on PIC16 MCU.
HI-TECH C compiler is use in MPLAB to create a C programming to the PIC16 series microcontroller unit.

Monday, 1 October 2012

Microcontroller


Introduction:
          This section is the control unit of the whole project. It basically consists of a Micro controller with its associated circuitry like Crystal with capacitors, Reset circuitry, Pull up resistors (if needed) and so on. The Micro controller forms the heart of the project because it controls the devices being interfaced and communicates with the devices according to the program being written.  
   
A Micro controller consists of a powerful CPU tightly coupled with memory RAM, ROM or EPROM), various I / O features such as Serial ports, Parallel Ports, Timer/Counters, Interrupt Controller, Data Acquisition interfaces-Analog to Digital Converter (ADC), Digital to Analog Converter (ADC), everything integrated onto a single Silicon Chip.
          Micro controller has  memory such as RAM, ROM or EPROM and peripherals on a single chip so development of a similar system with a micro controller reduces PCB size and cost of the design.

Micro controller use in the project.

PIC16f877A

 This devices are available in 40-pin packages is shown as picture below.

PIC16f877a

Device features.


Port Function.


In this project each PORT of pin have it own function.

PORT A = Analog to Digital input.

Measurement of analogue variables such as voltage and current must be converted to digital signals in order to be processed by the microcontroller. This microcontrollers have built in analogue to digital converters (ADC), enabling the analogue signals to be fed directly into the input pins of the microcontroller.


PORT B = It use as keypad interface and interrupt function.
PORT C = additional input/output
PORT D =  Use as interfacing LCD










Monday, 17 September 2012

Heat Sink


In use, a regulator IC will get quite hot, so a heatsink will need to be attached to it to dissipate the heat.  The type of heatsink you choose depends on the regulator's case style, the amount of heat it must dissipate, and the way in which you wish to mount it.

The examples shown below all suit the 78xx, 78Mxx, and 78Sxx regulator series TO-220 case style. It has a mounting hole for the regulator, and also has a mounting hole for fixing to a board.  

Choosing a heat sink.
Heatsinks are rated by their 'thermal resistance' (Rth) given in °C/W.  For example, a rating of 2°C/W means the heatsink (and therefore the regulator attached to it) will be 2°C hotter than the surrounding air for every 1W of heat it is dissipating.  Note that a lower thermal resistance means a better heatsink.

To determine the heatsink rating required, follow these steps:
  1. Work out the thermal power to be dissipated (P)
    To do this, use the following formula...

    [Equation]

    where P is the power to be dissipated, Vs is the input voltage to the regulator, Vr is the regulated voltage, and I is the current being supplied to the connected circuit.  For example, a 5V regulator supplying 0.5A and powered by 12V supply, would dissipate,

    [Equation]

    Note the use of (12 - 5) = 7V which is the voltage difference across the regulator.  Clearly, lower supply voltages are better so long as they are a few volts above the regulated output.
     
  2. Find out the maximum operating temperature of the regulator (Tmax)
    This can be found from a catalogue or datasheet.  For a typical 78xx series regulator, Tmax = 125°C.
     
  3. Estimate the maximum ambient (surrounding air) temperature (Tair)
    If heatsink is not in a case, Tair = 30°C is reasonable, but inside a case it will be higher (perhaps 40 or 50°C) allowing for everything to warm up in operation.
     
  4. Work out the maximum thermal resistance for heatsink (Rth)
    Use the following formula...

    [Equation]

    where Rth is the thermal resistance, Tmax is the operating temperature from (2) above, Tair is the ambient temperature from (3) above, and P is the power to be dissipated from (1) above.

    So with the example figures given above...

    [Equation]
     
  5. Choose a heatsink with a thermal resistance which is LESS than the value calculated above (remember a lower value means better heatsinking!)  In this case, 10°C/W would be a sensible choice to allow a safety margin.  A 10°C/W heatsink dissipating 3.5W will have a temperature difference of 10 x 3.5 = 35°C so the temperature of the regulator will rise to 30°C + 35°C = 65°C which is safely less than the 125°C maximum.
The heatsink shown on the far right above can dissipate 9.5°C/W and so would be ideal for use in this example.


For Regulation


There are many types of regulator IC and each type will have different pin-outs and will need to be connected up slightly differently.  Therefore, this article will only look at one of the common ranges of regulator, the 78xx series.

There are seven regulators in the 78xx series, and each can pass up to 1A to any connected circuit.  There are also regulators with similar type numbers that can pass a higher or lower current, as shown in the table below.  In addition, variable regulators are available, as are regulators that can provide negative regulation voltages for circuits that require them.

Type Number  Regulation Voltage  Maximum Current  Minimum Input Voltage
78L05+5V0.1A+7V
78L12+12V0.1A+14.5V
78L15+15V0.1A+17.5V

78M05+5V0.5A+7V
78M12+12V0.5A+14.5V
78M15+15V0.5A+17.5V

7805+5V1A+7V
7806+6V1A+8V
7808+8V1A+10.5V
7812+12V1A+14.5V
7815+15V1A+17.5V
7824+24V1A+26V

78S05+5V2A+8V
78S09+9V2A+12V
78S12+12V2A+15V
78S15+15V2A+18V
Ripple voltage.

If using a regulator after the smoothing block of the power supply,then not need to worry about the ripple voltage, since the whole point of using a regulator is to get a stable, accurate, known voltage for your circuits. However, if the ripple voltage is too large and the input voltage to the regulator falls below the regulated voltage of the regulator, then of course the regulator will not be able to produce the correct regulated voltage.  In fact, the input voltage to a regulator should usually be at least 2V above the regulated voltage.  In our power supply circuit, the input to the 7805 regulator is around 12V, and the regulation voltage is 5V, so there is plenty of headroom.  The maximum input voltage to any 78xx regulator is 30V.

Filtering is performed by a large value electrolytic capacitor connected across the DC supply to act as a reservoir, supplying current to the output when the varying DC voltage from the rectifier is falling. The capacitor charges quickly near the peak of the varying DC, and then discharges as it supplies current to the output. Filtering significantly increases the average DC voltage to almost the peak value (1.4 × RMS value).



To calculate the value of capacitor(C),

                                    C = ¼*√3*f*r*Rl
              Where,
                              f = supply frequency,
                              r = ripple factor,
                             Rl = load resistance


78xx pin-out.

The 78xx, 78Mxx, and 78Sxx regulators all have the pin-out shown in the left of figure 1. The 78Lxx series, shown in the right of figure 1. The connection circuit of regulator 78xx, as shown in figure 2. For this project, it use 7805 because give regulated output is 5V and the micro controller only need 5V of source.




IC regulator LM7805



Filtering

This is why the 'smoothing' block is required. Its because the output come from bridge rectifier is not suitable for power supply. So to give the output more smooth we use filtering circuit by using only one capacitor as shown in figure 1 below.



The output waveform in figure 2 shows how smoothing works.  During the first half of the voltage peaks from the rectifier, when the voltage increases, the capacitor charges up.  Then, while the voltage decreases to zero in the second half of the peaks, the capacitor releases its stored energy to keep the output voltage as constant as possible.  Such a capacitor is called a 'smoothing' or 'reservoir' capacitor when it is used in this application.


If the voltage peaks from the rectifier were not continually charging up the capacitor, it would eventually discharge and the output voltage would decrease all the way down to 0V.  The discharging that does occur between peaks gives rise to a small 'ripple' voltage.  The amount of ripple is affected by a combination of three factors:
  • The value of the capacitor.  The larger the capacitor value, the more charge it can store, and the slower it will discharge.  Therefore, smoothing capacitors are normally electrolytic capacitors with values over 470μF.
  • The amount of current used by the circuit.  If the circuit connected to the power supply takes a lot of current, the capacitor will discharge more quickly and there will be a higher ripple voltage.
  • The frequency of the peaks.  The more frequent the voltage peaks from the rectifier, the more often the capacitor will be charged, and the lower the ripple voltage will be.
To calculate the ripple voltage, it will use this formula below.
[Equation]

 Vr = the ripple voltage in Volts
 I = the current taken by the circuit in Amps
 C = the value of the smoothing capacitor in Farads
 F =the frequency of the peaks from the full-wave rectifier, in Hertz.


The ripple voltage should not be more than 10% of Vs - if it is, increase the value of the smoothing capacitor.

So in this project, the value capacitor for filter circuit is 470uF ( as picture below ).


capacitor 470uF



Bridge Rectifier

A Bridge Rectifier ( Full wave Rectifier )

The circuit in figure 3 addresses the second of these problems since at no time is the output voltage 0V.  This time four diodes are arranged so that both the positive and negative parts of the AC waveform are converted to DC.  The resulting waveform is shown in figure 4.





When the AC input is positive, diodes A and B are forward-biased, while diodes C and D are reverse-biased.  When the AC input is negative, the opposite is true - diodes C and D are forward-biased, while diodes A and B are reverse-biased.

One disadvantage of the full-wave rectifier is that there is a voltage loss of 1.4V across the diodes.  Why not 2.8V as there are four diodes, that is because there is only two of the diodes are passing current at any one time.

While the full-wave rectifier is an improvement on the half-wave rectifier, its output still is not suitable as a power supply for most circuits since the output voltage still varies between 0V and Vs-1.4V.  So, if you put 12V AC in, you will 10.6V DC out.


The formula Bridge full wave Rectifier is,


 Full wave   Bridge
Number of   diodes


4

PIV of diodes


Vm


D.C output voltage

2Vm/phi


Vdc,at
no-load                 

0.636Vm


Ripple factor

0.482

    Ripple     
   frequency

2f

  Rectification
   efficiency

0.812

  Transformer
   Utilization
   Factor(TUF)  

0.812

RMS voltage Vrms
Vm/√2



 
A bridge rectifier makes use of four diodes in a bridge arrangement to achieve full-wave rectification. This is a widely used configuration, both with individual diodes wired as shown and with single component bridges where the diode bridge is wired internally. So, in this project it will use 4 x 1N4001 diode (as picture below).



Diode type 1N4001


Step down transformers


A transformer consists of two coils (often called 'windings') linked by an iron core, as shown in figure below. There is no electrical connection between the coils, instead they are linked by a magnetic field created in the core.
Step-down transformers



Step down transformers is to reduce a voltage. Most power supplies use a step-down transformer to reduce the dangerously high mains voltage to a safer low voltage.   The input coil is called the primary and the output coil is called the secondary. 

For this project, it will use a step down transformers that give output 9V or 12V as picture below.






The ratio of the number of turns on each coil, called the turn’s ratio, determines the ratio of the voltages. A step-down transformer has a large number of turns on its primary (input) coil which is connected to the high voltage mains supply, and a small number of turns on its secondary (output) coil to give a low output voltage.

Below are transformers formula,

Turns ratio = Vp/ VS = Np/NS

Power Out= Power In

VS X IS=VP X IP

Vp = primary (input) voltage
Np = number of turns on primary coil
Ip  = primary (input) current     



Transformers have two great advantages over other methods of changing voltage:
  1. They provide total electrical isolation between the input and output, so they can be safely used to reduce the high voltage of the mains supply.
  1. Almost no power is wasted in a transformer. They have a high efficiency (power out / power in) of 95% or more.

For Regulated Power Supply


Regulated Power Supply:


1)       Step Down Transformer
2)      Bridge Rectifier
3)      Filter Circuit (Smoothing )
4)      Regulator  section









Sunday, 16 September 2012

Methodology


            
a)      Power Supply
-          Transformer to step down voltage from 240V to 9V.
-          Bridge rectifier to convert from AC to DC voltage.
-          IC Regulated (LM7805) to regulate the voltage 5V to supply to Microcontroller.

b)      Microcontroller PIC16f877a
-          Using MPLAB program to write a C language to program to microcontroller.
-          Using a Proteus program to design a circuit.

c)      EEPROM
-          To store the data

d)     Buzzer
-          To produce a sound on the certain operation.

e)      LCD
-          To display a digital energy meter and the electric bill (RM) in digital.

f)       Voltage and Current sensor
-          To sense the energy usage.

g)      Miniature Circuit Breaker

-          To trip the connection

Literature Review


After doing a research, there have many information and project that have connected to the purposed project. In a present day there already change from the analog energy meter to a digital energy meter in a certain place and the other places still have using the analog energy meter. Now, according to Md. Mejbaul Haque project that I have research. He creates a single phase digital prepaid energy meter based on two microcontrollers and a single phase energy meter IC. This digital prepaid energy meter does not have any rotating parts. The energy consumption is calculated using the output pulses of the energy meter chip and the internal counter of microcontroller (ATmega32). A microcontroller (ATtiny13) is used as a smart card and the numbers of units recharged by the consumers are written in it. A relay system has been used which either isolates or establishes the connection between the electrical load and energy meter through the supply mains depending upon the units present in the smart card. Energy consumption (kWh), maximum demand (kW), total unit recharged (kWh) and rest of the units (kWh) are stored in the ATmega32 to ensure the accurate measurement even in the event of an electrical power outage that can be easily read from a 20×4 LCD. As soon as the supply is restored, energy meter restarts with the stored values. A single phase prepaid energy meter prototype has been implemented to provide measurement up to 40A load current and 230V line to neutral voltage.Necessary program for microcontrollers are written in c-language and compiled by Win-AVR libc compiler.

            For my opinion, using a card reader is hard for us to reload the prepaid card if the card is empty. Need to make sure the card has credit, if we want use an electrical. For my project, the most important contributions of other related projects/findings for my project is to make sure the consumer know how much they use the energy, besides this project is already convert from energy usage (kWh) to Ringgit Malaysia (RM),so the consumer will know how much for electric bill in a month that need to pay. Other than that, this project have saving system, so they set the amount if they want to budget in an electric bill by set how much they want to pay into the system.