Anda di halaman 1dari 76




Power is most important requirement for all of us. We know that due to large demand of
electricity and due to limit capacity of power plant at generating station, power cut off is
common for all us. Due to limited amount of power generation at power station and due to
shortage of nonrenewable continuous supply source it beings a biggest challenge in whole world.
If you see all around us you will observe that due to discontinuity of power supply, many
problems have been faced by people in their everyday use. This type of power failure create
problem for data centers, hospitals and some research work. This is a biggest reason that every
countries are researching for the work to supply a continuous power with good efficiency and
with good regulation. In this project we can combine the renewable and non-renewable energy
sources to get the continuous power supply such as mains, solar, generator, wind power
generator. The power cut of these sources can be automatically done by microcontroller. The
continuous supply to load can be given by automatic operation of relay, relay driver with the
help of PIC microcontroller.

In India the requirement and availability of energy for power supply is 11,14408 million
units and 10,90850 million units for 2015-16 and we also know that the human activities is
mostly dependent on electrical power supply. The above fact clearly shows that the supply is not
meeting the demand. As a result frequent power-cut is done and interrupted power supply is
provided. The alternative for this problem is to switch towards renewable energy resources.

Four different sources i.e. mains, generator, solar and wind power are used to provide
uninterrupted power supply. Using the solar energy as one of the power source provides the
solution for low energy resources since it is a non-renewable source of energy. The second
objective of work is to provide automation which make the work faster, reliable, efficient, and
reduce human efforts. Microcontroller (PIC16F8) is used to provide automation in the switching
between four different sources. The automation system used for switching requires separate
source to provide an output signal which will operate the four different relays connected to
sources respectively.

The main objective of this project is to provide uninterrupted power supply to a load, by
selecting the supply source automatically from any available one out of 4 such as: mains,
generator, wind power and solar in the absence of power supply. The demand for electricity is
increasing every day and frequent power cut is causing many problems in various areas like
industries, hospitals and houses. An alternative arrangement for power source is thus desirable.

A microcontroller of the PIC16F8 family is used. The output of the microcontroller is

given to the relay driver IC, which switches appropriate relay to maintain uninterrupted supply to
the load. Output is observed using a lamp drawing power from the mains initially. On the failure
of the mains supply the load gets supply from the next available source i.e. an inverter. If the
inverter also fails, it switches over to the next available source, and so on. The current status, like
which source is supplying power to the load is also displayed on an LCD. As it is not feasible to
provide all 4 different sources of supply, one source with an alternate parallel arrangement is
provided to get the same function for demo purposes. However 4 different sources if available
they can be used.

In every home, office or industries, this device plays a vital role, that is, it provide auto
power supply control from 4 different sources such as mains, generator, solar and wind power
automatically by selecting the supply from any source. This project has been improved on the
existing types of electromechanical device that has being in use over the years.

 Difficulty in troubleshooting with circuit without the circuit diagram.

 Difficulty in connecting the output without the three phases short-circuiting, until
a multiplexing circuit was gotten.
 Difficulty in wiring because of the strong wiring the project required.


The conventional electrical system in Maharashtra by M.S.E.B. is based on only one

source placed at consumers end. This system demands to appoint a person to note the continuity.
This is exhaustive procedure, which involves a lot of human time effort but still does not produce
accurate results. There is lot of complaints regarding to continuation in supply.

Our aim is to solve this problem and provide uninterrupted power supply. The electrical
parameters supplied by the various state electricity boards for domestic use as well as to the
industrial sector is of great importance from the point view of proper monitoring of the power
generated on one end and power consumed on other end.

Also another important factor is revenue generated through sale of electric power, which
has to be in tune with investments made for proper generation and distribution. These factors
have been of great concern, not only in meeting with the everyday power demands, but also of
optimum utilization of electric power.


The main objective of the project is to design a device that will provide uninterrupted power
supply to a load, by selecting the supply source automatically from any available one out of 4
such as: mains, generator, solar or wind power in the absence of the power supply. This is done
by using microcontroller, relay and LCD. At the end of this work student will understand:

 Operation and description of the 4 different supply.

 Operation of relays and their connections.
 How to connect LCD display with microcontroller.

The purpose of this project is to provide auto power supply control from 4 different
sources such as mains, generator, solar and wind power automatically by selecting the supply
from any source.


This project provides an effective solution to provide an alternative power supply during
frequent power cuts.


The main reason behind to selects this work is there are lot of industries and domestic
appliances which work on high voltage supply and are high costly. And some electrical devices
need regular or uninterrupted or continuous power supply to work well for longer life span.
Many electrical systems are highly sensitive which can be affected by a minute interruption in
the power supply line. In the power supply system there are many chances of interruption to take
places at any times like power fail/cut off, faults etc. To avoid such types of problems these
project system are best which take power supply via four different sources and alternate between
them using microcontroller. The merit of this work is that they are reliable and economical.

Hardware Requirements:

 PIC16F8 series Microcontroller.

 Relays.
 LCD.
 Lamp.
 Push Buttons.
 Transformer.
 Diodes.
 Voltage Regulator.
 Crystal.
 Capacitors.
 Resistors.

Block Diagram Description:

The above diagram represents the architecture of the present work includes all major
blocks used in the system. Microcontroller is the main component of the system. This
microcontroller acts as a brain of the system and controls the function of the system.

This uninterrupted power supply control system works on the principle of auto selection
for switch over the load to other available source without interruption or switch off the load. This
work uses 4 different sources of supply which drive the load and provide uninterrupted power
supply. All the four sources are connected parallel to each other as shown in the block diagram.
The sequence of power sources is mains, solar, inverter and generator respectively i.e. highest
priority is given to mains and least priority to generator.

Microcontroller PIC 16F877A: In this auto power supply control system, the PIC
18F877A microcontroller is used for the auto selection of the available source. It shifted the load
to the other power supply source automatically without any interruption and is powered up with
5V dc voltages. It is interfaced with LCD display and relay driver IC.

Transistor as a Relay Driver: In this auto power supply control system, the relay driver
i.e. a transistor is used for driving the load relays. This relay receives the signal from
microcontroller for shifting the load on another supply source. It is powered up with 5V dc and
interfaced with microcontroller.

Transformer: The transformer is used for connecting this system directly to 220V AC. It
steps down 220V into 12V.

Voltage Regulator: The voltage regulator is used for regulating 12V DC into 5V DC
voltages for supplying the power to the LED, microcontroller and other components. IC LM
7805 voltage regulator is used for regulating voltages.

LCD Display: LCD display is used for displaying the source of supply on which the
whole system is working.

FILTERS: Capacitive filters are used in this work. It removes the ripples from output of
the rectifier. The DC output received from this filter is constant until the mains voltage and load
is maintained constant but if either one of the quantities is vary; the DC output received at this
point changes. To overcome this drawback a regulator is applied at the output stage of the filter.

RECTIFIER: In this work bridge rectifier is used due to its merits like full wave
rectification and high stability. For a single half of the cycle only two diodes will be in forward
bias condition.

LCD Display: this display is used to display the present sources and also which source is
currently used for supply to the load.
Circuit Diagram:
1 2 3 4 5 6

T1 1 3
Vin Vout
230V AC


C1 C2 D5

D4 16X2 LCD

16X2 Charactor LCD









180K 1 32
11 VR1
20K Vdd
4 40
180K RA2/AN2/Vref- RB7/PGD
5 39
6 38
7 37
8 35 RLY1
180K RE0/RD/AN5 RB2/INT2
9 34
10 33 NC SOLAR
K 1
V- 2
16 30 RLY2
17 29
20K RC2/CCP1/P1A RD6/SPP6 V+
18 28 Q1 NC MSEB
23 27 NPN COM
24 22 NO
25 21
26 20
13 COM
Crystal 12 NO
VSS V- 2
14 31 Q2
C3 C4
K 1
V- 2





Size Number Revision

Date: 14-Jan-2018 Sheet of
File: C:\Users\Lenovo\Downloads\Circuit 2018 (1).DdbDrawn By:
1 2 3 4 5 6

Circuit Diagram Description:

Auto supply switching is basically selection of supply from multiple available power
sources automatically by using microcontroller concept that is to check the availability of the
source and switching to that available source to ensure uninterrupted power supply to load. In
case of the electrical appliance control using automation causes more safety.

Auto supply switching is a prototype for the same which is auto change to other source
when main supply fails without human interaction in this system we are designing an embedded
circuit to control and ensure auto supply switching. In case all 4 phases are available, then the
switching will be in the default phase. Four relays are there to control the switching. As it is not
feasible to provide all 4 different sources of supply, one source with alternate switches are
provided to get the same function.

In this project we are having 4 switches which we consider as 4 different source of

supply. When we press any of the switches it shows the absence of that particular source which
is connected to microcontroller as input signals. Here we are using 8051 family microcontroller.
The output of microcontroller is given to the ULN2803 this acts as a relay driver. The current
phase working is displayed on LCD also.
This project uses an arrangement of 4 different sources of supply which are channelized
to a load so as to have an uninterrupted operation of the load. As it is not practicable to get 4
sources of supply such as mains supply, generator supply, inverter supply and solar supply, we
used one source and a set of relays. We have taken first source with mains supply and assumed
as if being fed from 4 different sources by connecting all the 4 incoming sources in parallel. The
ac source to the lamp is connected to four relays by making the entire normally open contacts
parallel and all the common contacts in parallel. 4 push button switches are used which
represent failure of corresponding supply respectively and are interfaced to the controller.
Initially we have given high input signal to the microcontroller, so as a result the controller
generates a low output to activate the first relay driver which will result in the relay being
energized and the lamp glows.

While the push button for mains is pressed that represents failure of mains supply as a
result the supply is provided from the next source and the microcontroller receive high input and
generates low output to activate the second relay driver which will result in the second relay
being energized and the lamp glows . When we press the generator button, it indicates the
generator fails to operate and the supply comes from the next source and the next source will
supply high input to the controller and which will provide low signal to the third relay and the
lamp switches ON and when we press the third push button the supply will chose next source
now the fourth source will provide input to the microcontroller and controller activates the fourth
relay and the load will get the supply and the lamp continues to glow.

When all the relays are off leaving no supply to the lamp, the lamp is switched off. One
16 x 2 lines LCD is used to display the condition of the supply sources and the load on real time

Working of Auto Power Supply Control System from 4 Different Sources Using PIC

When the supply from all the sources (Solar, Wind, Mains and Generator) are ready, the
load will be driven by the solar power supply. If solar get failed, the supply automatically shifts
to wind. To proceed further, if the wind get failed, the supply is provided from generator and so
on. Priority is assigned to each power source in the order of Solar, Wind, Generator and Mains.
In case the solar power fails, the supply should automatically shift to wind but if wind also fails
at the moment then the supply will automatically shift to next priority source. Above figure
explains the working and construction of the Auto power supply from four different sources. As
shown in the diagram the four sources are Solar, Wind, Mains and Generator, four relays are
used to provide protection at each respective output. This output can be used to drive any load
such as a lamp or motor. LEDs are used to display the source of supply. Other case is when the
power switches from one source to another source, say wind fails and supply shifts to generator,
if the solar come back then the supply will automatically reach back to solar power instead of
switching to mains. At the output of microcontroller, each output port is connected to positive dc
voltage. Relays are used in contact with the output port to provide switching at the output.

The project uses an arrangement where 4 different sources of supply are provided to a
load so as to have an uninterrupted operation of the load. The source of 12v supply is used from
four different sources. The ac source to the fan is connected to relay 1 to relay 2 to relay 3 and
relay 4 by making the entire “NO” (normally open) contacts parallel and all the common
contacts in parallel.

Hardware Description:
A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer on a
single integrated circuit containing a processor core, memory, and programmable input/output
peripherals. Program memory in the form of NOR flash or OTP ROM is also often included on
chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded
applications, in contrast to the microprocessors used in personal computers or other general
purpose applications.
Microcontrollers are used in automatically controlled products and devices, such as
automobile engine control systems, implantable medical devices, remote controls, office
machines, appliances, power tools, toys and other embedded systems. By reducing the size and
cost compared to a design that uses a separate microprocessor, memory, and input/output
devices, microcontrollers make it economical to digitally control even more devices and
processes. Mixed signal microcontrollers are common, integrating analog components needed to
control non-digital electronic systems.
Some microcontrollers may use four-bit words and operate at clock rate frequencies as
low as 4 kHz, for low power consumption (single-digit milliwatts or microwatts). They will
generally have the ability to retain functionality while waiting for an event such as a button press
or other interrupt; power consumption while sleeping (CPU clock and most peripherals off) may
be just nanowatts, making many of them well suited for long lasting battery applications. Other
microcontrollers may serve performance-critical roles, where they may need to act more like
a digital signal processor (DSP), with higher clock speeds and power consumption. The first
microprocessor was the 4-bit Intel 4004 released in 1971, with the Intel 8008 and other more
capable microprocessors becoming available over the next several years. However, both
processors required external chips to implement a working system, raising total system cost, and
making it impossible to economically computerize appliances.
The Smithsonian Institution says TI engineers Gary Boone and Michael Cochran
succeeded in creating the first microcontroller in 1971. The result of their work was the TMS
1000, which became commercially available in 1974. It combined read-only memory, read/write
memory, processor and clock on one chip and was targeted at embedded systems.
Partly in response to the existence of the single-chip TMS 1000, Intel developed a
computer system on a chip optimized for control applications, the Intel 8048, with commercial
parts first shipping in 1977. It combined RAM and ROM on the same chip. This chip would
find its way into over one billion PC keyboards, and other numerous applications. At that time
Intel's President, Luke J. Valenter, stated that the microcontroller was one of the most successful
in the company's history, and expanded the division's budget over 25%.
Most microcontrollers at this time had two variants. One had an
erasable EPROM program memory, with a transparent quartz window in the lid of the package to
allow it to be erased by exposure to ultraviolet light. The other was a PROM variant which was
only programmable once; sometimes this was signified with the designation OTP, standing for
"one-time programmable". The PROM was actually exactly the same type of memory as the
EPROM, but because there was no way to expose it to ultraviolet light, it could not be erased.
The erasable versions required ceramic packages with quartz windows, making them
significantly more expensive than the OTP versions, which could be made in lower-cost opaque
plastic packages. For the erasable variants, quartz was required, instead of less expensive glass,
for its transparency to ultraviolet—glass is largely opaque to UV—but the main cost
differentiator was the ceramic package itself.
In 1993, the introduction of EEPROM memory allowed microcontrollers (beginning with
the Microchip PIC16x84) to be electrically erased quickly without an expensive package as
required for EPROM, allowing both rapid prototyping, and In System Programming. (EEPROM
technology had been available prior to this time, but the earlier EEPROM was more expensive
and less durable, making it unsuitable for low-cost mass-produced microcontrollers.) The same
year, Atmel introduced the first microcontroller using Flash memory, a special type of
EEPROM. Other companies rapidly followed suit, with both memory types.
Cost has plummeted over time, with the cheapest 8-bit microcontrollers being available
for under 0.25 USD in quantity (thousands) in 2009, and some 32-bit microcontrollers around 1
USD for similar quantities.
Nowadays microcontrollers are cheap and readily available for hobbyists, with large
online communities around certain processors.
In the future, MRAM could potentially be used in microcontrollers as it has infinite
endurance and its incremental semiconductor wafer process cost is relatively low
Microcontrollers usually contain from several to dozens of general purpose input/output pins
(GPIO). GPIO pins are software configurable to either an input or an output state. When GPIO
pins are configured to an input state, they are often used to read sensors or external signals.
Configured to the output state, GPIO pins can drive external devices such as LEDs or motors.
Many embedded systems need to read sensors that produce analog signals. This is the purpose of
the analog-to-digital converter (ADC). Since processors are built to interpret and process digital
data, i.e. 1s and 0s, they are not able to do anything with the analog signals that may be sent to it
by a device. So the analog to digital converter is used to convert the incoming data into a form
that the processor can recognize. A less common feature on some microcontrollers is a digital-to-
analog converter (DAC) that allows the processor to output analog signals or voltage levels.
In addition to the converters, many embedded microprocessors include a variety of timers
as well. One of the most common types of timers is the Programmable Interval Timer(PIT). A
PIT may either count down from some value to zero, or up to the capacity of the count register,
overflowing to zero. Once it reaches zero, it sends an interrupt to the processor indicating that it
has finished counting. This is useful for devices such as thermostats, which periodically test the
temperature around them to see if they need to turn the air conditioner on, the heater on, etc.
A dedicated Pulse Width Modulation (PWM) block makes it possible for the CPU to
control power converters , resistive loads, motors, etc., without using lots of CPU resources in
tight timer loops.
Universal Asynchronous Receiver/Transmitter (UART) block makes it possible to
receive and transmit data over a serial line with very little load on the CPU. Dedicated on-chip
hardware also often includes capabilities to communicate with other devices (chips) in digital
formats such as I²C and Serial Peripheral Interface (SPI).
Microchip manufacture a series of microcontrollers called PIC. There are many different
flavours available, some basic low memory types, going right up through to ones that have
Analogue - To- Digital converters and even PWM built in. We are going to concentrate on the
16F877A PIC. Once you have learnt how to program one type of PIC, learning the rest is easy.
There are several ways of programming the PIC - using BASIC, C, or Assembly Language. We
are going to use the assembly language There are only 35 instructions to learn, and it is the
cheapest way to program the PICs, as you do not need any extra software other than the freebies.

Name Pin No. Description
MCLR/Vpp 1 MCLR: Reset pin. Low logic level on this
pin resets microcontroller.
Vpp: Programming voltage.
RA0/AN0 2 RA0: General purpose I/O port A
AN0: A/D channel 0 input
RA1/AN1 3 RA1: General purpose I/O port A
AN1: A/D channel 1
RA2/AN2/Vref-/CVref 4 RA2: General purpose I/O port A
AN2: A/D channel 2
Vref-: A/D Negative Voltage Reference
CVref: Comparator Voltage Reference
RA3/AN3/Vref+ 5 RA3:General purpose I/O port A
AN3: A/D channel 3
Vref+:A/D Positive Voltage Reference
RA4/T0CKI/C1OUT 6 RA4:General purpose I/O port A
T0CKI: Timer T0 Clock input
C1OUT: Comparator C1 output
RA5/AN4/SS/C2OUT 7 RA5: General purpose I/O port A
AN4:A/D channel 4
SS: SPI module input (Slave Select)
C2OUT: Comparator C2 output
RE0/RD/AN5 8 RE0: General purpose I/O port E
AN5: A/D channel 5
RE1/WR/AN6 9 RE1: General purpose I/O port E
AN6: A/D channel 6
RE2/CS/AN7 10 RE2: General purpose I/O port E
AN7: A/D channel 7
Vdd 11 Positive Supply
Vss 12 Ground (GND)
OSC1/CLKI 13 OSC1: Crystal Oscillator input
CLKIN: External Clock input
OSC2/CLKO 14 OSC2: Crystal Oscillator output
CLKOUT: Fosc/4 output
RC0/T1OSO/T1CKI 15 T1OSO: Timer T1 Oscillator Output
T1CKI: Timer T1 Clock input
RC1/T1OSI/CCP2 16 RC1: General purpose I/O port C
T1OSI: Timer T1 Oscillator Input
CCP2: CCP1 and PWM1 module I/O
RC2/CCP1 17 RC2:General purpose I/O port C
CCP1:CCP1 and PWM1 module I/O
RC3/SCK/SCL 18 RC3: General purpose I/O port D
SCK: MSSP module Clock I/O in SPI mode
SCL: MSSP module Clock I/O in 1²C mode
RD0/PSP0 19 RD0: General purpose I/O port D
RD1/PSP1 20 RD1: General purpose I/O port D
RD2/PSP2 21 RD2: General purpose I/O port D
RD3/PSP3 22 RD3: General purpose I/O port D
RC4/SDI/SDA 23 RC4: General purpose I/O port A
SDI: MSSP module Data input in SPI mode
SDA: MSSP module Data I/O in 1²C mode
RC5/SDO 24 RC5: General purpose I/O port C
SDO:MSSP module Data output in SPI
RC6/TX/CK 25 RC6: General purpose I/O port C
TX: USART Asynchronous output
CK: USART Synchronous clock
RC7/RX/DT 26 RC7: General purpose I/O port C
RX: USART Asynchronous input
DT: USART Synchronous Data
RD4/PSP4 27 RD4: General purpose I/O port D
RD5/PSP5 28 RD5: General purpose I/O port D
RD6/PSP6 29 RD6: General purpose I/O port D

RD7/PSP7 30 RD7: General purpose I/O port D

Vss 31 Vss: Ground (GND)

Vdd 32 Vdd: Positive supply

RB0/INT 33 RB0: General purpose I/O port B

INT: External Interrupt
RB1 34 RB1: General purpose I/O port B
RB2 35 RB2: General purpose I/O port B

RB3/PGM 36 RB3: General purpose I/O port B

PGM: Programming Enable pin
RB4 37 RB4: General purpose I/O port B

RB5 38 RB5: General purpose I/O port B

RB6/PGC 39 RB6: General purpose I/O port B

RB7/PGD 40 RB7: General purpose I/O port B

How To Program:-
Apart from learning the assembly code instructions, how do you go about actually
programming the information in? Well, there are two ways – the easy way, and the DIY way.
The easy way is to buy a PIC programmer which will connect to your PC and you can program
your PIC using the software provided. The DIY way is to build your own programmer and use
free software from the Internet and program it that way.
The next thing you will need is an assembler. This converts the program that you write
into a format that the PIC understands. The best one around is from Microchip themselves, called
MPLAB. It is windows based, and includes an editor, simulator, and assembler. This is the de-
facto software, as it is written by the manufacturers of the PIC.

1.2 PIC Basic Instruction Set:

 ASM..ENDASM - Insert assembly language code section.*
 BRANCH - Computed GOTO (equivalent to ON..GOTO).
 BUTTON – De bounce and auto-repeat input on specified pin.
 CALL - Call assembly language subroutine.*
 EEPROM - Define initial contents of on-chip EEPROM.
 END - Stop execution and enter low power mode.
 FOR..NEXT - Repeatedly execute statement(s).
 GOSUB - Call BASIC subroutine at specified label.
 GOTO - Continue execution at specified label.
 HIGH - Make pin output high.
 I2CIN - Read bytes from I2C device.*
 I2COUT - Send bytes to I2C device.*
 IF..THEN - GOTO if specified condition is true.
 INPUT - Make pin an input.
 [LET] - Assign result of an expression to a variable.
 LOOKDOWN - Search table for value.
 LOOKUP - Fetch value from table.
 LOW - Make pin output low.
 NAP - Power down processor for short period of time.
 OUTPUT - Make pin an output.
 PAUSE - Delay (1mSec resolution).
 PEEK - Read byte from register.*
 POKE - Write byte to register.*
 POT - Read potentiometer on specified pin.
 PULSIN - Measure pulse width (10us resolution).
 PULSOUT - Generate pulse (10us resolution).
 PWM - Output pulse width modulated pulse train to pin.
 RANDOM - Generate pseudo-random number.
 READ - Read byte from on-chip EEPROM.
 RETURN - Continue execution at statement following last executed GOSUB.
 REVERSE - Make output pin an input or an input pin an output.
 SERIN - Asynchronous serial input (8N1).
 SEROUT - Asynchronous serial output (8N1).
 SLEEP - Power down processor for a period of time (1 Sec resolution).
 SOUND - Generate tone or white-noise on specified pin.
 TOGGLE - Make pin output and toggle state.
 WRITE - Write byte to on-chip EEPROM.
1.3 Microcontroller features:-
High-performance RISC CPU
All single cycle instructions except for program branches which are 2 cycle
Operating speed: DC - 20 MHz clock input DC - 200 ns instruction cycle
Up to 8K x 14 words of Flash Program Memory,
Up to 256 x 8 bytes of EEPROM data memory
Pin out compatible to the PIC16C73/74/76/77
Interrupt capability -up to 14 internal/external
Eight level deep hardware stack
Direct, indirect, and relative addressing modes
Power-on Reset (POR)
Power-up Timer (PWRT) and Oscillator Start-up Timer (OST)
Watchdog Timer (WDT) with its own on-chip RC Oscillator for reliable operation
Programmable code-protection
Power saving SLEEP mode
Selectable oscillator options
Low-power, high-speed CMOS EPROM/EEPROM technology
Fully static design
In-Circuit Serial Programming (ICSP) via two pins
Only single 5V source needed for programming capability
In-Circuit Debugging via two pins
Processor read/write access to program memory
Wide operating voltage range: 2.5V to 5.5V
High Sink/Source Current: 25 mA
Commercial and Industrial temperature ranges

Microcontrollers from different manufacturers have different architectures and different

capabilities. Some may suit a particular application while others may be totally unsuitable for the
same application. The hardware features of micro controllers in general are described in this
1.3.1 Supply voltage
Most microcontrollers operate with the standard logic voltage of _5V. A voltage regulator circuit
is usually used to obtain the required power supply voltage when the device is to be operated
from a mains adaptor or batteries.

1.3.2 The clock

All microcontrollers require a clock (or an oscillator) to operate. The clock is
usually provided by connecting external timing devices to the microcontroller. An instruction is
executed by fetching it from the memory and then decoding it. This usually takes several clock
cycles and is known as the instruction cycle.

1.3.3 Timers
Timers are important parts of any microcontroller. A timer is basically a counter which is driven
either from an external clock pulse or from the internal oscillator of the microcontroller. A timer
can be 8-bits or 16-bits wide.

1.3.4 Watchdog
The watchdog is basically a timer which is refreshed by the user program and a
reset occurs if the program fails to refresh the watchdog. A watchdog is a safety feature that
prevents runaway software and stops the microcontroller from executing meaningless and
unwanted code.
1.3.5 Reset input
A reset input is used to reset a microcontroller. Resetting puts the microcontroller into a known
state such that the program execution starts from address 0 of the program memory.
1.3.6 Interrupts
An interrupt causes the microcontroller to respond to external and internal (e.g. a timer) events
very quickly. When an interrupt occurs the microcontroller leaves its normal flow of program
execution and jumps to a special part of the program, Another important feature with multi-
interrupt capability is that different interrupt sources can be given different levels of priority.
1.3.7 Analogue-to-digital converter
An analogue-to-digital converter (A/D) is used to convert an analogue signal such as voltage to a
digital form so that it can be read by a microcontroller. Some microcontrollers have built-in A/D
1.3.8 Serial I/O
Serial communication (also called MAX232 communication) enables a microcontroller to be
connected to another microcontroller or to a PC using a serial cable. The baud rate and the data
format can usually be selected by the user program. If any serial I/O hardware is not provided, it
is easy to develop software to implement serial data communication using any I/O pin of a
1.3.9 EEPROM data memory
EEPROM type data memory is also very common in many microcontrollers. The advantage of
an EEPROM memory is that the programmer can store non-volatile data in such a memory, and
can also change this data whenever required. Then, if the power supply is removed for whatever
reason, the values of the latest readings will still be available in the EEPROM memory. PIC
Basic and PIC Basic Pro languages provide special instructions for reading and writing to the
EEPROM memory of a microcontroller which has such memory built-in.
1.3.10 LCD drivers
LCD drivers enable a microcontroller to be connected to an external LCD display directly. These
drivers are not common since most of the functions provided by them can be implemented in
1.3.11 Analogue comparator
Analogue comparators are used where it is required to compare two analogue voltages. Although
these circuits are implemented in most high-end PIC microcontrollers they are not common in
other microcontrollers.
1.3.12 Sleep mode
Some microcontrollers (e.g. PIC) offer built-in sleep modes where executing this instruction puts
the microcontroller into a mode where the internal oscillator is stopped and the power
consumption is reduced to an extremely low level. The main reason of using the sleep mode is to
conserve the battery power when the microcontroller is not doing anything useful. The
microcontroller usually wakes up from the sleep mode by external reset or by a watchdog time-
1.3.13 Power-on reset
Some microcontrollers (e.g. PIC) have built-in power-on reset circuits which keep the
microcontroller in reset state until all the internal circuitry has been initialized. This feature is
very useful as it starts the microcontroller from a known state on power-up. An external reset can
also be provided where the microcontroller can be reset when an external button is pressed.
1.3.16 Low power operation
Low power operation is especially important in portable applications where the microcontroller
based equipment is operated from batteries. Some microcontrollers (e.g. PIC) can operate with
less than 2 mA with 5 V supply, and around 15_A at 3 V supply. Some other microcontrollers,
especially microprocessor-based systems where there could be several chips may consume
several hundred mill amperes or even more.
1.3.17 Current sink/source capability
This is important if the microcontroller is to be connected to an external device which may draw
large current for its operation.

Liquid Crystal Display which is commonly known as LCD is an Alphanumeric Display it

means that it can display Alphabets, Numbers as well as special symbols thus LCD is a user
friendly Display device which can be used for displaying various messages unlike seven segment
display which can display only numbers and some of the alphabets. The only disadvantage of
LCD over seven segment is that seven segment is robust display and be visualized from a longer
distance as compared to LCD. Here we have used 16 x 2 Alphanumeric Display which means on
this display we can display two lines with maximum of 16 characters in one line.

LCD (Liquid Crystal Display) screen is an electronic display module and find a wide
range of applications. A 16x2 LCD display is very basic module and is very commonly used in
various devices and circuits. These modules are preferred over seven segments and other multi
segment LEDs. The reasons being: LCDs are economical; easily programmable; have no
limitation of displaying special & even custom characters (unlike in seven segments), animations
and so on. A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In
this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely,
Command and Data. 16 Characters x 2 Lines Built-in HD44780 Equivalent LCD Controller
Works directly with ATMEGA, ARDUINO, PIC and many other microcontroller/kits. 4 or 8 bit
data I/O interface Low power consumption.

Drive method: 1/16 duty cycle
Display size: 16 character * 2 lines
Character structure: 5*8 dots.
Display data RAM: 80 characters (80*8 bits)
Character generate ROM: 192 characters
Character generate RAM: 8 characters (64*8 bits)
Both display data and character generator RAMs can be read from MPU.
Internal automatic reset circuit at power ON.
Built in oscillator circuit.
Fig 3.12 LCD display 16X2

Table 3.3 Pin description of LCD


A relay is an electrically operated switch. Current flowing through the coil of the relay
creates a magnetic field which attracts a lever and changes the switch contacts. The coil current
can be on or off so relays have two switch positions and they are double throw (changeover)
Relays allow one circuit to switch a second circuit which can be completely separate
from the first. For example a low voltage battery circuit can use a relay to switch a 230V AC
mains circuit. There is no electrical connection inside the relay between the two circuits, the link
is magnetic and mechanical.
Working :
When an electric current is passed through the coil it generates a magnetic field that
attracts the armature, and the consequent movement of the movable contacts either makes or
breaks (depending upon construction) a connection with a fixed contact. If the set of contacts
was closed when the relay was de-energized, then the movement opens the contacts and breaks
the connection, and vice versa if the contacts were open.
When the current to the coil is switched off, the armature is returned by a force,
approximately half as strong as the magnetic force, to its relaxed position. Usually this force is
provided by a spring, but gravity is also used commonly in industrial motor starters.
Normally-open (NO) contacts connect the circuit when the relay is activated the circuit is
disconnected when the relay is inactive. It is also called a Form A contact or "make" contact.
Normally-closed (NC) contacts disconnect the circuit when the relay is activated; the circuit is
connected when the relay is inactive. It is also called a Form B contact or "break" contact.
The basis for relays, is the simple electromagnet
A nail, some wire, and a battery is all that is needed to make one, to demonstrate and amaze add
a switch, and presto! You're the talk of the town.

With no power applied to the coil, the nail is NOT magnetized

Connect this to a power source, and it will now grab and hold small pieces of metal.
So, here in lies the concept. If we take an electromagnet, it will interact with metals in its
vicinity. Now let’s take this one step further... If we were to place a piece of metal, near the
electromagnet, and connect some contacts, so that when the electromagnet is energized, the
contacts close, we have a working relay.

The simplest relay, is the Single Pole, Single Throw (spst) relay. It is nothing more than an
electrically controlled on-off switch. Its biggest property is the ability to use a very small current,
to control a much larger current. This is desirable because we can now use smaller diameter
wires, to control the current flow through a much larger wire, and also to limit the wear and tear
on the control switch.
Above is a simple relay control. Now, here is what is happening.....

The control circuit (GREEN) powers the coil inside the relay, using a small amount of current. It
flows from the battery, thru the fuse ( for protection) to a switch, (say, a light switch) then to the
coil in the relay, energizing it.
The coil, now energized becomes an electromagnet, and attracts the metal strip with the contacts,
which closes, providing a secondary heavy current path ( RED ) to the device ( say, the fog

Turning off the switch, opens the circuit to the coil, removes current flow, and the electromagnet
is no longer a magnet, the secondary path is opened, and the lights extinguish
A transistor is a semiconductor device used to amplify and switch electronic signals
and electrical power. It is composed of semiconductor material with at least three terminals for
connection to an external circuit. A voltage or current applied to one pair of the transistor's
terminals changes the current through another pair of terminals. Because the controlled
(output) power can be higher than the controlling (input) power, a transistor can amplify a signal.
Today, some transistors are packaged individually, but many more are found embedded
in integrated circuits.

The transistor is the fundamental building block of modern electronic devices, and is
ubiquitous in modern electronic systems. Following its development in 1947 by
American physicists John Bardeen, Walter Brattain, and William Shockley, the transistor
revolutionized the field of electronics, and paved the way for smaller and
cheaper radios, calculators, and computers, among other things. The transistor is on the list of
IEEE milestones in electronics, and the inventors were jointly awarded the 1956 Nobel Prize in
Physics for their achievement.

The transistor is the key active component in practically all modern electronics. Many
consider it to be one of the greatest inventions of the 20th century. Its importance in today's
society rests on its ability to be mass-produced using a highly automated process (semiconductor
device fabrication) that achieves astonishingly low per-transistor costs. The invention of the first
transistor at Bell Labs was named an IEEE Milestone in 2009.

Although several companies each produce over a billion individually packaged (known
as discrete) transistors every year, the vast majority of transistors are now produced in integrated
circuits (often shortened to IC, microchips or simply chips), along with diodes,
resistors, capacitors and other electronic components, to produce complete electronic circuits.
A logic gate consists of up to about twenty transistors whereas an advanced microprocessor, as
of 2009, can use as many as 3 billion transistors (MOSFETs). "About 60 million transistors were
built in 2002 ... for [each] man, woman, and child on Earth."

The transistor's low cost, flexibility, and reliability have made it a ubiquitous device.
Transistorized mechatronic circuits have replaced electromechanical devices in controlling
appliances and machinery. It is often easier and cheaper to use a standard microcontroller and
write a computer program to carry out a control function than to design an equivalent mechanical
control function.

The essential usefulness of a transistor comes from its ability to use a small signal applied
between one pair of its terminals to control a much larger signal at another pair of terminals. This
property is called gain. It can produce a stronger output signal, a voltage or current, that is
proportional to a weaker input signal; that is, it can act as an amplifier. Alternatively, the
transistor can be used to turn current on or off in a circuit as an electrically controlled switch,
where the amount of current is determined by other circuit elements.

There are two types of transistors, which have slight differences in how they are used in a
circuit. A bipolar transistor has terminals labeled base, collector, and emitter. A small current at
the base terminal (that is, flowing between the base and the emitter) can control or switch a much
larger current between the collector and emitter terminals. For a field-effect transistor, the
terminals are labeled gate, source, and drain, and a voltage at the gate can control a current
between source and drain.

The image to the right represents a typical bipolar transistor in a circuit. Charge will flow
between emitter and collector terminals depending on the current in the base. Because internally
the base and emitter connections behave like a semiconductor diode, a voltage drop develops
between base and emitter while the base current exists. The amount of this voltage depends on
the material the transistor is made from, and is referred to as VBE
Power supply is the first and the most important part of our project. For our project we
require +5V regulated power supply with maximum current rating 1A.
Following basic building blocks are required to generate regulated power supply.

Transformers convert AC electricity from one voltage to another with a little loss of power. Step-
up transformers increase voltage, step-down transformers reduce voltage. Most power supplies
use a step-down transformer to reduce the dangerously high voltage to a safer low voltage.


The input coil is called the primary and the output coil is called the secondary. There is no
electrical connection between the two coils; instead they are linked by an alternating magnetic
field created in the soft-iron core of the transformer. The two lines in the middle of the circuit
symbol represent the core. Transformers waste very little power so the power out is (almost)
equal to the power in. Note that as voltage is stepped down and current is stepped up.
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.

TURNS RATIO = (Vp / Vs) = ( Np / Ns )

Vp = primary (input) voltage.
Vs = secondary (output) voltage
Np = number of turns on primary coil
Ns = number of turns on secondary coil
Ip = primary (input) current
Is = secondary (output) current.

Ideal power equation

The ideal transformer as a circuit element

If the secondary coil is attached to a load that allows current to flow, electrical power is
transmitted from the primary circuit to the secondary circuit. Ideally, the transformer is perfectly
efficient; all the incoming energy is transformed from the primary circuit to the magnetic field
and into the secondary circuit. If this condition is met, the incoming electric power must equal
the outgoing power:
Giving the ideal transformer equation

Transformers normally have high efficiency, so this formula is a reasonable approximation.

If the voltage is increased, then the current is decreased by the same factor. The impedance in
one circuit is transformed by the square of the turns ratio. For example, if an impedance Zs is
attached across the terminals of the secondary coil, it appears to the primary circuit to have an
impedance of (Np/Ns)2Zs. This relationship is reciprocal, so that the impedance Zp of the primary
circuit appears to the secondary to be (Ns/Np)2Zp.


• Output Current up to 1A.
• Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V.
• Thermal Overload Protection.
• Short Circuit Protection
.• Output Transistor Safe Operating Area Protection.
The LM78XX/LM78XXA series of three-terminal positive regulators are available in the TO-
220/D-PAK package and with several fixed output voltages, making them useful in a Wide range
of applications. Each type employs internal current limiting, thermal shutdown and safe
operating area protection, making it essentially indestructible. If adequate heat sinking is
provided, they can deliver over 1A output Current. Although designed primarily as fixed voltage
regulators, these devices can be used with external components to obtain adjustable voltages and


Absolute Maximum Ratings:-


A rectifier is an electrical device that converts alternating current (AC), which periodically
reverses direction, to direct current (DC), current that flows in only one direction, a process
known as rectification. Rectifiers have many uses including as components of power supplies
and as detectors of radio signals. Rectifiers may be made of solid state diodes, vacuum tube
diodes, mercury arc valves, and other components. The output from the transformer is fed to the
rectifier. It converts A.C. into pulsating D.C. The rectifier may be a half wave or a full wave
rectifier. In this project, a bridge rectifier is used because of its merits like good stability and full
wave rectification. In positive half cycle only two diodes (1 set of parallel diodes) will conduct,
in negative half cycle remaining two diodes will conduct and they will conduct only in forward
bias only.
Capacitive filter is used in this project. It removes the ripples from the output of rectifier
and smoothens the D.C. Output received from this filter is constant until the mains voltage and
load is maintained constant. However, if either of the two is varied, D.C. voltage received at this
point changes. Therefore a regulator is applied at the output stage.
The simple capacitor filter is the most basic type of power supply filter. The use of this filter is
very limited. It is sometimes used on extremely high-voltage, low-current power supplies for
cathode-ray and similar electron tubes that require very little load current from the supply. This
filter is also used in circuits where the power-supply ripple frequency is not critical and can be
relatively high.below figure can show how the capacitor chages and discharges.

Specifications of 7805 vtg regulator:

Polarity = +ve

Output vtg : +5v

Output current :1.5A

Output of bridge rectifier for rectification :

Output: 12Vdc = vrms

Vm=vrms x sq. rt of 2

= 12x sq.rt of 2

= 16.97

Vm= PIV =16.97

Value of Filter capacitor :

C= (IxT)/V


= 1/2 x3.14×50 hz

Output current of 7805 =1.5 A

C=(1.5 x 3.1847 x10-3 )/5

= 955.41×10-6

=1000 µf
Axial-lead resistors on tape. The tape is removed during assembly before the leads are
formed and the part is inserted into the board. In automated assembly the leads are cut and
A resistor is a passive two-terminal electrical component that implements electrical
resistance as a circuit element. Resistors act to reduce current flow, and, at the same time, act to
lower voltage levels within circuits. In electronic circuits resistors are used to limit current flow,
to adjust signal levels, bias active elements, terminate transmission lines among other uses. High-
power resistors that can dissipate many watts of electrical power as heat may be used as part of
motor controls, in power distribution systems, or as test loads for generators. Resistors can have
fixed resistances that only change slightly with temperature, time or operating voltage. Variable
resistors can be used to adjust circuit elements (such as a volume control or a lamp dimmer), or
as sensing devices for heat, light, humidity, force, or chemical activity.
Resistors are common elements of electrical networks and electronic circuits and are
ubiquitous in electronic equipment. Practical resistors as discrete components can be composed
of various compounds and forms. Resistors are also implemented withinintegrated circuits.
The electrical function of a resistor is specified by its resistance: common commercial resistors
are manufactured over a range of more than nine orders of magnitude. The nominal value of the
resistance will fall within a manufacturing tolerance.
The behavior of an ideal resistor is dictated by the relationship specified by Ohm's law:

Ohm's law states that the voltage (V) across a resistor is proportional to the current (I), where the
constant of proportionality is the resistance (R). For example, if a 300 ohm resistor is attached
across the terminals of a 12 volt battery, then a current of 12 / 300 = 0.04 amperes flows through
that resistor.
Practical resistors also have some inductance and capacitance which will also affect the
relation between voltage and current in alternating current circuits.
The ohm (symbol: Ω) is the SI unit of electrical resistance, named after Georg Simon Ohm. An
ohm is equivalent to a volt per ampere. Since resistors are specified and manufactured over a
very large range of values, the derived units of milliohm (1 mΩ = 10−3 Ω), kilohm (1 kΩ =
103 Ω), and megohm (1 MΩ = 106 Ω) are also in common usage
Resistor color-coding:-

One decade of the E12 series (there are twelve preferred values per decade of values) shown with
their electronic color codes on resistors

A 100 kΩ, 5% axial-lead resistor

A 0 Ω resistor, marked with a single black band

A 2260 ohm, 1% precision resistor with 5 color bands (E96 series), from top 2-2-6-1-1; the last
two brown bands indicate the multiplier (x10), and the 1% tolerance. The larger gap before the
tolerance band is somewhat difficult to distinguish.

To distinguish left from right there is a gap between the C and D bands.
 band A is the first significant figure of component value (left side)
 band B is the second significant figure (some precision resistors have a third significant
figure, and thus five bands).
 band C is the decimal multiplier
 band D if present, indicates tolerance of value in percent (no band means 20%)
For example, a resistor with bands of yellow, violet, red, and gold will have first digit 4 (yellow
in table below), second digit 7 (violet), followed by 2 (red) zeros: 4,700 ohms. Gold signifies that
the tolerance is ±5%, so the real resistance could lie anywhere between 4,465 and 4,935 ohms.
Resistors manufactured for military use may also include a fifth band which indicates component
failure rate (reliability); refer to MIL-HDBK-199 for further details.
Tight tolerance resistors may have three bands for significant figures rather than two, or an
additional band indicating temperature coefficient, in units of ppm/K.
All coded components will have at least two value bands and a multiplier; other bands are
The standard color code per EN 60062:2005 is as follows:

Color Multiplier Tolerance Coefficient

Black 0 ×100 – 250 U

Brown 1 ×101 ±1% F 100 S

Red 2 ×102 ±2% G 50 R

Orange 3 ×103 – 15 P

Yellow 4 ×104 (±5%) – 25 Q

Green 5 ×105 ±0.5% D 20 Z

Blue 6 ×106 ±0.25% C 10 Z

Violet 7 ×107 ±0.1% B 5 M

Gray 8 ×108 ±0.05% (±10%) A 1 K

White 9 ×109 – –

Gold – ×10-1 ±5% J –

Silver – ×10-2 ±10% K –

None – – ±20% M –

Resistors use preferred numbers for their specific values, which are determined by
their tolerance. These values repeat for every decade of magnitude: 6.8, 68, 680, and so forth. In
the E24 series the values are related by the 24th root of 10, while E12 series are related by the
12th root of 10, and E6 series by the 6th root of 10. The tolerance of device values is arranged so
that every value corresponds to a preferred number, within the required tolerance.
Zero ohm resistors are made as lengths of wire wrapped in a resistor-shaped body which can be
substituted for another resistor value in automatic insertion equipment. They are marked with a
single black band.
The 'body-end-dot' or 'body-tip-spot' system was used for radial-lead (and other
cylindrical) composition resistors sometimes still found in very old equipment; the first band was
given by the body color, the second band by the color of the end of the resistor, and the
multiplier by a dot or band around the middle of the resistor. The other end of the resistor was
colored gold or silver to give the tolerance, otherwise it was 20%.
A capacitor (originally known as a condenser) is a passive two-terminal electrical
component used to store energyelectrostatically in an electric field. The forms of practical
capacitors vary widely, but all contain at least two electrical conductors (plates) separated by
a dielectric (i.e. insulator). The conductors can be thin films, foils or sintered beads of metal or
conductive electrolyte, etc. The "nonconducting" dielectric acts to increase the capacitor's charge
capacity. A dielectric can be glass, ceramic, plastic film, air, vacuum, paper, mica, oxide layer
etc. Capacitors are widely used as parts of electrical circuits in many common electrical devices.
Unlike a resistor, an ideal capacitor does not dissipate energy. Instead, a capacitor
stores energy in the form of an electrostatic field between its plates.
When there is a potential difference across the conductors (e.g., when a capacitor is
attached across a battery), an electric field develops across the dielectric, causing
positive charge +Q to collect on one plate and negative charge −Q to collect on the other plate. If
a battery has been attached to a capacitor for a sufficient amount of time, no current can flow
through the capacitor. However, if a time-varying voltage is applied across the leads of the
capacitor, a displacement current can flow.
An ideal capacitor is characterized by a single constant value for its capacitance.
Capacitance is expressed as the ratio of the electric charge Q on each conductor to the potential
difference V between them. The SI unit of capacitance is the farad (F), which is equal to
one coulomb per volt (1 C/V). Typical capacitance values range from about 1 pF (10−12 F) to
about 1 mF (10−3 F).
The capacitance is greater when there is a narrower separation between conductors and
when the conductors have a larger surface area. In practice, the dielectric between the plates
passes a small amount of leakage current and also has an electric field strength limit, known as
the breakdown voltage. The conductors and leads introduce an undesired inductance and
Capacitors are widely used in electronic circuits for blocking direct current while
allowing alternating current to pass. In analog filter networks, they smooth the output of power
supplies. In resonant circuits they tune radios to particular frequencies. In electric power
transmission systems, they stabilize voltage and power flow.
A capacitor consists of two conductors separated by a non-conductive region.[10] The
non-conductive region is called the dielectric. In simpler terms, the dielectric is just an electrical
insulator. Examples of dielectric media are glass, air, paper, vacuum, and even a semiconductor
depletion region chemically identical to the conductors. A capacitor is assumed to be self-
contained and isolated, with no net electric charge and no influence from any external electric
field. The conductors thus hold equal and opposite charges on their facing surfaces,[11] and the
dielectric develops an electric field. In SI units, a capacitance of one farad means that one
coulomb of charge on each conductor causes a voltage of one volt across the device.[12]
An ideal capacitor is wholly characterized by a constant capacitance C, defined as the ratio of
charge ±Q on each conductor to the voltage V between them:[10]

Because the conductors (or plates) are close together, the opposite charges on the
conductors attract one another due to their electric fields, allowing the capacitor to store more
charge for a given voltage than if the conductors were separated, giving the capacitor a large
Sometimes charge build-up affects the capacitor mechanically, causing its capacitance to vary. In
this case, capacitance is defined in terms of incremental changes:
In electronics, a diode is a two-terminal electronic component with
asymmetric conductance; it has low (ideally zero) resistance to current in one direction, and high
(ideally infinite) resistance in the other. A semiconductor diode, the most common type today, is
a crystalline piece of semiconductor material with a p–n junction connected to two electrical
terminals. A vacuum tube diode has two electrodes , a plate (anode) and a heated cathode.
Semiconductor diodes were the first semiconductor electronic devices. The discovery of crystals
'rectifying abilities was made by German physicist Ferdinand Braun in 1874. The first
semiconductor diodes, called cat's whisker diodes, developed around 1906, were made of
mineral crystals such as galena. Today, most diodes are made of silicon, but other
semiconductors such as selenium or germanium are sometimes used.
A p–n junction diode is made of a crystal of semiconductor, usually silicon,
but germanium and gallium arsenide are also used. Impurities are added to it to create a region
on one side that contains negative charge carriers (electrons), called n-type semiconductor, and a
region on the other side that contains positive charge carriers (holes), called p-type
semiconductor. When two materials i.e. n-type and p-type are attached together, a momentary
flow of electrons occur from n to p side resulting in a third region where no charge carriers are
present. This region is called the depletion region due to the absence of charge carriers (electrons
and holes in this case). The diode's terminals are attached to the n-type and p-type regions. The
boundary between these two regions, called a p–n junction, is where the action of the diode takes
place. The crystal allows electrons to flow from the N-type side (called the cathode) to the P-type
side (called the anode), but not in the opposite direction
The most common function of a diode is to allow an electric current to pass in one
direction (called the diode's forward direction), while blocking current in the opposite direction
(the reverse direction). Thus, the diode can be viewed as an electronic version of a check valve.
This unidirectional behaviour is called rectification, and is used to convert alternating
current to direct current, including extraction of modulation from radio signals in radio
receivers—these diodes are forms of rectifiers.
However, diodes can have more complicated behaviour than this simple on–off action,
due to their nonlinear current-voltage characteristics. Semiconductor diodes begin conducting
electricity only if a certain threshold voltage or cut-in voltage is present in the forward direction
(a state in which the diode is said to be forward-biased). The voltage drop across a forward-
biased diode varies only a little with the current, and is a function of temperature; this effect can
be used as a temperature sensor or voltage reference.
Semiconductor diodes' current–voltage characteristic can be tailored by varying
the semiconductor materials and doping, introducing impurities into the materials. These
techniques are used to create special-purpose diodes that perform many different functions. For
example, diodes are used to regulate voltage (Zener diodes), to protect circuits from high voltage
surges (avalanche diodes), to electronically tune radio and TV receivers (varactor diodes), to
generate radio-frequency oscillations (tunnel diodes, Gunn diodes,IMPATT diodes), and to
produce light (light-emitting diodes). Tunnel, Gunn and IMPATT diodes exhibit negative
resistance, which is useful in microwave and switching circuits.
A light-emitting diode (LED) is a two-lead semiconductor light source. It is a basic pn-
junction diode, which emits light when activated.[6] When a suitable voltage is applied to the
leads, electrons are able to recombine with electron holes within the device, releasing energy in
the form of photons. This effect is called electroluminescence, and the color of the light
(corresponding to the energy of the photon) is determined by the energy band gap of the
An LED is often small in area (less than 1 mm2) and integrated optical components may
be used to shape its radiation pattern.[7]
Appearing as practical electronic components in 1962,[8] the earliest LEDs emitted low-
intensity infrared light. Infrared LEDs are still frequently used as transmitting elements in
remote-control circuits, such as those in remote controls for a wide variety of consumer
electronics. The first visible-light LEDs were also of low intensity, and limited to red. Modern
LEDs are available across the visible,ultraviolet, and infrared wavelengths, with very high
Early LEDs were often used as indicator lamps for electronic devices, replacing small
incandescent bulbs. They were soon packaged into numeric readouts in the form of seven-
segment displays, and were commonly seen in digital clocks.
Recent developments in LEDs permit them to be used in environmental and task lighting.
LEDs have many advantages over incandescent light sources including lower energy
consumption, longer lifetime, improved physical robustness, smaller size, and faster switching.
Light-emitting diodes are now used in applications as diverse as aviation lighting, automotive
headlamps, advertising, general lighting, traffic signals, and camera flashes. However, LEDs
powerful enough for room lighting are still relatively expensive, and require more precise current
and heat management than compact fluorescent lamp sources of comparable output.
LEDs have allowed new text, video displays, and sensors to be developed, while their
high switching rates are also useful in advanced communications technology.
On October 7, 2014, the Nobel Prize in Physics was awarded to Isamu Akasaki, Hiroshi
Amano and Shuji Nakamura for "the invention of efficient blue light-emitting diodes which has
enabled bright and energy-saving white light sources" or, less formally, LED lamps.[9]
Conventional LEDs are made from a variety of inorganic semiconductor materials.
The following table shows the available colors with wavelength range, voltage drop and

Color Wavelength [nm] Semiconductor material
drop [ΔV]

Gallium arsenide (GaAs)

Infrared λ > 760 ΔV < 1.63
Aluminium gallium arsenide (AlGaAs)

Aluminium gallium arsenide (AlGaAs)

Gallium arsenide phosphide (GaAsP)
1.63 < ΔV <
Red 610 < λ < 760 Aluminium gallium indium
phosphide (AlGaInP)
Gallium(III) phosphide (GaP)

Gallium arsenide phosphide (GaAsP)

2.03 < ΔV < Aluminium gallium indium
Orange 590 < λ < 610
2.10 phosphide (AlGaInP)
Gallium(III) phosphide (GaP)

Gallium arsenide phosphide (GaAsP)

2.10 < ΔV < Aluminium gallium indium
Yellow 570 < λ < 590
2.18 phosphide (AlGaInP)
Gallium(III) phosphide (GaP)

Traditional green:
Gallium(III) phosphide (GaP)
Aluminium gallium indium
1.9[72] < ΔV < phosphide (AlGaInP)
Green 500 < λ < 570
4.0 Aluminium gallium phosphide (AlGaP)
Pure green:
Indium gallium nitride (InGaN) / Gallium(III)
nitride (GaN)

2.48 < ΔV < Zinc selenide (ZnSe)

Blue 450 < λ < 500
3.7 Indium gallium nitride (InGaN)
Silicon carbide (SiC) as substrate
Silicon (Si) as substrate—under development

2.76 < ΔV <

Violet 400 < λ < 450 Indium gallium nitride (InGaN)

Dual blue/red LEDs,

2.48 < ΔV <
Purple Multiple types blue with red phosphor,
or white with purple plastic

Diamond (235 nm)[73]

Boron nitride (215 nm)[74][75]
Aluminium nitride (AlN) (210 nm)[76]
Ultraviolet λ < 400 3.1 < ΔV < 4.4
Aluminium gallium nitride (AlGaN)
Aluminium gallium indium
nitride (AlGaInN)—down to 210 nm[77]

Blue with one or two phosphor layers:

yellow with red, orange or pink phosphor added
Pink Multiple types ΔV ~ 3.3[78] afterwards,
or white phosphors with pink pigment or dye
over top.[79]

White Broad spectrum ΔV = 3.5 Blue/UV diode with yellow phosphor

For a certain number of projects, including first-prototype, surface mount 'breadboarding',
layout experimentation, rapid multiple-revisions, and 1-hour deadlines doing your own PCB
etching can be quick, clean, and very very inexpensive. The method set up in the Media Lab
basement is somewhat-similar to that of large pcb manufacture shops, except in scale and
automation. There is no system for through-hole plating, automated drilling/routing or multilayer
design. However, you can make precisely aligned doublesided boards with simple registration
When To Use
A tool is only good towards the application it was designed for. Using the etcher for something
other than what its good for will frustrate you and waste time.
When using the spray etcher is a good idea:
 You need the boards quickly
 The substrate is 1/16" with 1oz or 2oz copper either FR4 or paper phenolic (preferred)
 The design is single sided
 There are many surface mount parts
 The design is double sided, with no hidden vias (vias underneath surfacemount parts) or
through-hole part vias (vias that also serve as through-hole component holes) that you
cannot solder on both sides
 You can visually scan for shorts
 The design follows a 12/12 mil rule (this is probably not true, I'm sure 10/10 or even 8/8
is fine, but yield will drop) That is, 12mil minimum trace width, and 12mil minimum
trace distance.
 You only need a few boards, or are willing to live with a yield as low as 50%
 Drill hole locations can be imprecise (up to 10 mils off!)
Conversely, when using the spray etcher is a bad idea:
 You dislike wet chemistry/cleaning
 Are using exotic substrates
 There are many vias, or throughhole parts, and you dont want to drill holes/solder vias.
 You want the boards to be perfect without checking for shorts or opens
 You need printed overlays, multiple layers, through hole plating or solder masks.
 You want many parts. Remember that for $200 you can just about get as many boards as
your heart desires, and from a reputable PCB manufacturer.
Getting the Layout Ready
In this step you will prepare your layout for etching. For this step you will need: a quality
laser printer, a sheet of transluscent paper.
The photoresist method we use in PCB etching is a positive process, which means that
when UV light hits the resist, it softens, and then is washed away. What remains is a positive of
the PCB design. What this boils down to is that you will want a positive printout of your PCB
design (black where there will be copper). Preferably mirrored. Most all PCB design tools let
you print out your layout mirrored. Or you can mirror your entire design in the software.
Whichever. Also, if possible, have it print white holes where you will drill, these will be your
drill guides. Because the drill holes will not be precise, make your annular rings (the copper
around a drill hole) larger than normal. Since you will lose as many as half of the design to
exposure/development/etching flaws, tile 2-3 times layouts as many as you want.
In Eagle: After your design is ready, go to the CAM Processor, and open the
"" job. As output select PS. Change the extention to ".ps" as well. Be sure
that Mirror is selected but that Fill Pads is not. Then open the ps with any free postscript viewer
and print it. (Also you could print it to "Gerber274x" and use a gerber viewer, or any other
format you can print.)
After you have verified the above, print your design to a high quality (600dpi at least)
laser printer, in monochrome mode, onto a white piece of paper. Double check that it is as you
want it, in the correct orientation, enough tiling, mirrored, dark ink, slightly smaller than the PCB
you have, etc. Now print it onto translucent paper, there is a box of it in the cabinet underneath
the etcher, in a thin cardboard sleeve.
This photo has notes. Move your mouse over the photo to see them.
Left, plain paper test. Right, translucent paper. Both are mirrored.
In this picture, I have two layouts I want to etch. I tiled one three times and one twice.
The one I tiled three times has a very fine pitch IC (TSSOP-16) so it is less likely to come out.
On the left is opaque laser print. On the right, translucent paper. Note that the design (noticably
the text) is mirrored.

Exposing the Board

This step transfers your layout design to a positive-resist PCB by exposing UV light to
the sensitized PCB with the printout as a mask. For this step you will need: a presensitized
positive photoresist copper clad board, scissors, tape, a UV bulb and thin plate glass or exposure
unit. This step takes 5-10 minutes.
First cut out the layout leaving a few millimeters of space on the edges. If you are going
to perform the exposing and etching in the same session, go ahead and turn the etching machine
on now, since it takes 10 minutes to warm up.
Cut the translucent paper, leaving at least a few mm boarder
Next, locate an unused PCB. There is a bag of them in the cabinet underneath the etcher.
You may need to cut a larger board down using a metal shear. Using a larger PCB than necessary
is wasteful, and exhausts the chemicals faster than a board that is well-fit. You can also purchase
your own stash of PCB material in many different substrates, thicknesses, etc. and, of course,
that is encouraged. (See "Where to Purchase Supplies, at bottom")
The best PCBs are those that have a plastic sticky sheet protecting them (some are just
sold in a plastic bag) so that they can be handled, drilled and sheared without excess UV
exposure. The plastic is easy to peel off:
The underlying substrate should be a greenish colour
Place your design on top of the exposed resist, ink-side down, so that it appears not-
mirrored when you look through the paper at the board. Placing the ink closest to the resist
means less light can leak around and cut into thin traces. Next, tape down the design on two
edges, so that the tape does not overlap any of the layout, but holds the paper flat.
Use any plain tape to tape down two opposite sides without overlapping the layout
now take it to be exposed under a UV lamp. As an arbitrary measure, a 15W Sylvania "350
Blacklight" UV 24" flourescent bulb, 3" above a FOTOBOARD2-brand board, with a 1/8" clear
glass plate (to keep the paper totally flat) over the board, 10 minutes will give good exposure.
[When a more permanent fixture is found, it will be calibrated.]
After it has been exposed, peel off one piece of tape and flip it open, to look at the
photoresist. Well exposed photoresist is a paler green, and you will be able to see the layout in
the original, yellower green, faintly. If you don't see anything, retape that side, and try a few
more minutes under the lamp.

The unexposed part is faintly visible, on the right side.

Once you think you're done exposing, lift off the design and put it away in case you want
to make another set of boards. You are ready to perform the chemical processing. If you need to
do this part later, or you have other boards to expose, place this board in an opaque container
(like in an envelope, face down, in a drawer or somesuch.)
Developing the Board
In this step, the exposed photoresist is removed chemically using developer, leaving a
positive of your layout in photoresist on copper. For this step you will need: gloves, apron, sink,
dev tray, developer, small soft sponge. This step takes 3 minutes.
Take the board over to your processing area. Put on the apron and a pair of 'rubber
gloves'. These wet chemicals can splash, some stain, and they are not good to drink. Find the dev
tray and the bottle of developer, (both marked DEV) and make sure the tray is clean. There is
one set of large trays (for > 5x7") and one small set, use the ones that fits best. Place the board
face up in the tray and pour developer in until there is about 1/4" (or enough to cover) in the tray.

Carefully pour into a tray. The developer is green from use, it starts out clear
Almost immediately the board will start to 'leak' resist as it is attacked by developer.
Agitate the board with your hand, and swirl the developer around to make sure there is a flow
around the board. It should be developed in 1/2 to 1 minute. If you leave it in too long, some of
the finer traces wont come out. Leaving it in too little means that there will be a very thin,
invisible, layer of resist left that will stop the etching process and force you to repeat this step.
Use a soft sponge to wipe the photoresist away.
Before rinsing, rub down the board with a soft cloth or sponge soaked in developer
Rinse the board in cold water to clean off the developer (stop bath), the parts that are to be etched
should look like competely clean copper, no residue. If you feel a slimy/slippery coating, or see a
bluish coating, you need to develop more. If none of the resist came off, you'll need to realign
your paper and reexpose the board. Pour the developer back into the bottle, and rinse off the tray.
The board is now ready to etch.

A well developed board has solid green traces and a clean copper background
First Rinse
In this step, the board is spray rinsed to prepare it for etching. This step takes 2 minutes.
First check to see that the machine is on. If not, turn the machine on.
The Rota-Spray machine, the wash tank is on the left, the etching tank on the right.
The on button is in the top left corner.
Once on, the left LED display should display "oC" and then something like "23" which
means the etchant is at 23degC. Now load the board into the board holding apparatus, placing it
near the center, and securing the plastic nuts. Make sure the board won’t fall out and into the
The board holder can hold many small boards, but make sure they cant fall out
Slide the board holder, with the copper facing right, into the wash tank. Attach the water hose
(black, with white plastic spring-end) to the sink faucent, and turn on the cold water.

The connector is a little difficult to use, requiring that you simultaneously push down on
the ring while pressing the brass fitting into the faucet head. Two handed might be easier at first.
Turn on the wash spray to clean off the board. You can move the holder up and down to make
sure the board is sprayed off.

Make sure the water drains cleanly into the sink. This is the older setup, in the current lab
there should be a PVC drainage pipe into the large sink so there shouldnt be any drain problems
Etching the Board
In this step, the board is placed in an etcher, which is a machine that washes warm ferric
chloride (or another etchant) over the board, eating away any exposed copper. For this step you
will need to make sure the etchant is warm enough to use. This step takes 2minutes.
Move the holder into the etching tank, again facing to the right. Check that the
temperature monitor reports 42-45 degrees C, and that the fluid well feels warm. also make sure
the top is secured so that there is very little chance FeCl will spray out the top. By default the
timer is set for 1:30 minutes, which I've found satisfactory. You can also change the time if
necessary (for different weights of copper). Turn on the spray pump by pressing start. The entire
tank will turn reddish brown as the etchant removes the copper from your board. After the time is
up, remove the holder and quickly put it in the wash tank again. Be careful as there will be a lot
of FeCl dripping off the holder and you dont want it going anywhere but in the machine or the
The board is very messy at this point, so do the move quickly and carefuly
Second Rinse
Turn on the wash spray again, moving the holder around so that the entire board and
holder are completely cleaned off. After the water runs clean, remove the board and examine it.
There may be parts that didn't etch, or overetched. Depending on your patience and yield, you
may decide to re-etch a subset of your boards.
There are some traces of unetched copper on the right. Since I only needed one PCB, I
just threw it away.
Examine all the boards carefully to determine which ones have shorts/opens/missing
traces/etc, and which ones are good for use. Shut off the water faucet, run the spray to clean out
the hose, turn off the machine and disconnect the hose from the faucet.
In this step, the remaining photoresist is stripped away, leaving only copper. For this step
you will need chemical stripper and/or a scrub pad. This step takes 2 minutes.
Place the board face up in the STRIP tray, and coat it with resist stripper. This may be in a bottle
or in a 'shoepolish' dispenser. Rub in the chemical first with the soft sponge, then with with a
plastic scrub pad. The green resist should come off, revealing copper underneath. Make sure -all-
of the resist is removed, as it smells very bad when it gets hot (when soldering.) If there is no
stripper, you can just scrub it off with a green scrub pad. If the stripper came from a bottle, pour
it back in. Rinse off the board and tray.
You can easily remove the resist with just a green scouring pad
This step is optional but is very helpful for soldering to your board. For this step you will
need: tinning liquid mix. This step takes 2-10 minutes.
Find the bottle of tinning liquid, and the TIN tray. Place the board in the tray copper up,
and pour in enough tinning liquid to cover the board, the copper should immediately turn a
silvery color. If you intend to reflow solder, you may want to leave it for 15 minutes, otherwise,
3-5 is probably fine. Use this time to clean up the area around the etcher, rinse off surfaces and
clean and dry any trays. When the board is done, remove and rinse it. Pour the tinning liquid
back into the bottle and clean the tray. Throw away the gloves, and put the apron back. Make
sure the area looks better than it did when you got there.
The exposed copper will turn silver almost immediately, tin will aid soldering and stop oxidation
In this step, any holes or vias in the PCB are drilled out. For this step you will need: a
drill press that can run at 2000+ RPM, high-speed carbide wire-gauge drill bits. This step takes
3-10 minutes, depending on number of holes in pcb.
If your PCB is FR4 laminate, you may want to find a dust mask for this step, since
fiberglass dust is carcinogenic. Chances are, you're using paper phenolic which is much safer.
There is a box of HSS carbide drill bits in a box underneath the etcher, they are packaged in
plastic boxes of 10. Find the boxes of closest size to your board holes. In general, .020"/75ga is
good for RF vias, .028"/70ga is good for signal vias, .035"/65ga is good for
DIP/LEDs/Resistors/Capacitors, etc., .042"/58ga is good for TO-220/heavier diodes/etc.,
.060"/53ga for heavier wires and power components, and .086"/44ga for mounting holes or
anything else. Other drill sizes are available for purchase, of course.
Left, these are inexpensive resharpened drill bits $7.50 a box. Right, 70 gauge is as small
as you'll need
Place the first drill bit in the chuck, and tighten it well. Find a piece of wood to place
underneath the board for support. While the drill is running, adjust the speed to 2000RPM or

The drillpress in the media lab shop is more than sufficient, adjust it only while running
Drill all holes of one size at a time. Try to position the drill bit right in the center of the hole, or
at least, try not to drill through any copper traces. The drill bits might break, especially if they
sub-35mil. Holding the board steady while drilling through it helps. The bits only cost 75 cents
so just throw them away when broken, but if you break more than 5, you should purchase a
replacement set.
You can drill a hole a second if you dont clamp down the board, but breakage is more
After all the drilling, replace the bits in their boxes, and put the box back underneath the
In this step, the tiled layouts are seperated. For this step you will need a metal shear (this
step could also be done with a band saw.) This step takes 2 minutes.
Shear or cut the good boards out, leaving a few mm on each edge. The edges may be filed or
A metal shear, such as the one outside the shop, is good for this. Go slowly and use the middle
Application and Advantages:

 This system could be used in that places where we have different sources of supply such
as solar, main and wind.
 This system could be used in industries for supplying the uninterruptable power supply to
the industrial machines.
 This system could be used in educational institutes and hospitals for supplying the
uninterruptable power supply to the hospital or educational equipment.
 This system is more compact and reliable as compared to the electrical ATS panels.
 This system is less costly as compared to the other power control systems.


This work is use to provide a continuous power to the load through any of the sources
from which we are operating the device i.e. main line, generator, inverter and solar automatically
in the absence of any of the source. The complete operation is based on the microcontroller. This
work is a low-cost, reliable, efficient system. The work can be further enhanced by using other
sources like inverters also and then taking into consideration for using the best possible power
source whose tariff remains lowest at that moment.


The Future Scope of the project is the addition of the supply for extra availability of the
project and the convenience of the working operation would become easier if there is an extra
source to the project. The higher specification of the components used would be a better idea for
the durability of the project and project lies for the longer period. The main scope of this paper is
to provide a continuous power supply to the output load through any of the source in the absence
of any of the source. The paper can be further enhanced by using GSM, other sources like wind
power and also then taking into consideration for using the best possible power whose cost
remains lowest at that moment. The significance of this paper lies in its various advantages and
wide places of applications where this project can be used efficiently.

[1] Gagari Deb and Arijit Bardhan Roy, International Journal of Computer and Electrical
Engineering, Vol.4, No.1, February 2012.

[2] Predrag Pejovi´C, Johann W. Kolar, Electronics Journal Special Issue on: Education in
Electronics, Vol. 17, No. 2, January 2014

[3] Aye Myat Thu, Kyaw Soe Lwin, Interntional Journal of Scientific Engineering and
technology Research, International Journal of Scientific Engineering and Technology Research
Volume.03, IssueNo.08, May-2014.

[4] Mr. Bhrijesh N. Patel, Mr. Mrugesh M. Prajapati, International Journal of Scientific and
Research Publications,, Volume 4, Issue 6, June 2014.

[5] Gagari Deb, Ramananda Paul and Sudip Das, International Journal of Computer and
Electrical Engineering, Vol.4, No.2, April 2012.

[6] Parantap Nandi, Department of Electrical Engineering, Institution: IIE (Kalyani), WBUT.
Nadia, WB: 741235. International Journal of Multidisciplinary Research and Development 2015.

[7] Mr. Shahaji Dudhate, Mr. Amol Attargekar, Mr.Dhanaji Desai, Prof. Mrs. Aditi Patil
(2016), “ Power supply control from different sources”, Department Of Electronics And
Telecommunication, Dr. D. Y. Patil Institute Of Engineering And Technology, Pune,
Maharashtra, India.

[8] Garima Pandey, Khanda Anum “Auto power supply control from four different sources:
mains, solar, inverter and generator to ensure no break power” IJSART -Volume1Issue4–APRIL
2015,ISSN [ONLINE]: 2395-105.