Académique Documents
Professionnel Documents
Culture Documents
1.1 Introduction:
The objective of this project is to determine the distance of
underground cable fault from base station in kilometres. The underground cable system is
a common practice followed in many urban areas. While a fault occurs for some reason,
at that time the repairing process related to that particular cable is difficult due to not
knowing the exact location of the cable fault. The proposed system is to find the exact
location of the fault.
The project uses the standard concept of Ohms law i.e., when a low DC voltage is
applied at the feeder end through a series resistor (Cable lines), then current would vary
depending upon the location of fault in the cable. In case there is a short circuit (Line to
Ground), the voltage across series resistors changes accordingly, which is then fed to an
ADC to develop precise digital data which the programmed microcontroller would
display in kilometres. This project uses Arduino microcontroller to which all components
like Fault switches with current sensing circuit, LCD, LED indicator are connected.
The project is assembled with a set of resistors representing cable length in KM’s
and fault creation is made by a set of switches at every known KM to cross check the
accuracy of the same. The fault occurring at a particular distance and the respective phase
is displayed on a LCD interfaced to the microcontroller.
1
Microprocessors are commonly referred to as general purpose
processors as they simply accept the inputs, process it and give the output. In contrast, a
microcontroller not only accepts the data as inputs but also manipulates it, interfaces the
data with various devices, controls the data and thus finally gives the result.
1.3 Thesis:
Chapter 1 Presents introduction to the overall thesis and the overview of the
project.
Chapter 2 Presents the topic embedded systems. It explains the about what is
embedded systems, need for embedded systems, explanation of it along with its
applications.
Chapter 3 Presents the hardware description. It deals with the block diagram
of the project and explains the purpose of each block.
Chapter 5 Presents the internet of things. In this we are using WIFI module.
Chapter 6 Presents the project description along with temperature sensor module
interfacing to microcontroller.
Chapter 8 Presents the results, conclusion and future scope of the project.
2
CHAPTER 2: EMBEDDED SYSTEMS
4
2.1.1 History:
One of the first recognizably modern embedded systems was the Apollo
Guidance Computer, developed by Charles Stark Draper at the MIT Instrumentation
Laboratory. At the project's inception, the Apollo guidance computer was considered the
riskiest item in the Apollo project as it employed the then newly developed monolithic
integrated circuits to reduce the size and weight. An early mass-produced embedded
system was the Autonetics D-17 guidance computer for the Minuteman missile, released
in 1961. It was built from transistor logic and had a hard disk for main memory. When
the Minuteman II went into production in 1966, the D-17 was replaced with a new
computer that was the first high-volume use of integrated circuits.
2.1.2 Tools:
5
2.1.3 Resources:
The uses of embedded systems are virtually limitless, because every day
new products are introduced to the market that utilizes embedded computers in novel
ways. In recent years, hardware such as microprocessors, microcontrollers, and FPGA
6
chips have become much cheaper. So when implementing a new form of control, it's
wiser to just buy the generic chip and write your own custom software for it. Producing a
custom-made chip to handle a particular task or set of tasks costs far more time and
money. Many embedded computers even come with extensive libraries, so that "writing
your own software" becomes a very trivial task indeed. From an implementation
viewpoint, there is a major difference between a computer and an embedded system.
Embedded systems are often required to provide Real-Time response. The main elements
that make embedded systems unique are its reliability and ease in debugging.
2.2.1 Debugging:
7
Because an embedded system is often composed of a wide variety of
elements, the debugging strategy may vary. For instance, debugging a software(and
microprocessor) centric embedded system is different from debugging an embedded
system where most of the processing is performed by peripherals (DSP, FPGA, co-
processor). An increasing number of embedded systems today use more than one single
processor core. A common problem with multi-core development is the proper
synchronization of software execution. In such a case, the embedded system design may
wish to check the data traffic on the busses between the processor cores, which requires
very low-level debugging, at signal/bus level, with a logic analyzer, for instance.
2.2.2 Reliability:
In this design, the software simply has a loop. The loop calls subroutines,
each of which manages a part of the hardware or software.
Usually these kinds of systems run a simple task in a main loop also, but
this task is not very sensitive to unexpected delays. Sometimes the interrupt handler will
add longer tasks to a queue structure. Later, after the interrupt handler has finished, these
9
tasks are executed by the main loop. This method brings the system close to a
multitasking kernel with discrete processes.
• Cooperative Multitasking:
• Primitive Multitasking:
As any code can potentially damage the data of another task (except in
larger systems using an MMU) programs must be carefully designed and tested, and
access to shared data must be controlled by some synchronization strategy, such as
message queues, semaphores or a non-blocking synchronization scheme.
10
to different threads of execution. User mode processes implement major functions such
as file systems, network interfaces, etc.
These systems takes the input in the form of electrical signals from
transducers or commands from human beings such as pressing of a button etc.., process
them and produces desired output. This entire process of taking input, processing it and
giving output is done in standalone mode. Such embedded systems comes under stand
alone embedded systems
These embedded systems follow an absolute dead line time period i.e.., if
the tasking is not done in a particular time period then there is a cause of damage to the
entire equipment.
These embedded systems follow a relative dead line time period i.e.., if the task
is not done in a particular time that will not cause damage to the equipment.
11
Eg: Consider a TV remote control system, if the remote control takes a few milliseconds
delay it will not cause damage either to the TV or to the remote control. These systems which will
not cause damage when they are not operated at considerable time period those systems comes
under soft real-time embedded systems.
Eg:
• Consider a web camera that is connected to the computer with internet can be
used to spread communication like sending pictures, images, videos etc.., to
another computer with internet connection throughout anywhere in the world.
Whenever a person comes near the door, it captures the image of a person
and sends to the desktop of your computer which is connected to internet. This gives an
alerting message with image on to the desktop of your computer, and then you can open
the door lock just by clicking the mouse. Fig: 2.2 show the network communications in
embedded systems.
12
2.3.5 Different types of processing units:
The central processing unit (c.p.u) can be any one of the following
microprocessor, microcontroller, digital signal processing.
• Among these Microcontroller is of low cost processor and one of the main
advantage of microcontrollers is, the components such as memory, serial
communication interfaces, analog to digital converters etc.., all these are built on a
single chip. The numbers of external components that are connected to it are very
less according to the application.
• Microprocessors are more powerful than microcontrollers. They are used in major
applications with a number of tasking requirements. But the microprocessor
requires many external components like memory, serial communication, hard
disk, input output ports etc.., so the power consumption is also very high when
compared to microcontrollers.
• Digital signal processing is used mainly for the applications that particularly
involved with processing of signals
Today a lot of industries are using embedded systems for process control.
In industries we design the embedded systems to perform a specific operation like
monitoring temperature, pressure, humidity ,voltage, current etc.., and basing on these
monitored levels we do control other devices, we can send information to a centralized
monitoring station.
Fig2.6: Robot
14
2.4.5 Computer networking:
15
CHAPTER 3: HARDWARE DESCRIPTION
3.1 Introduction:
In this chapter the block diagram of the project and design aspect of
independent modules are considered. Block diagram is shown in fig: 3.1:
FIG 3.1: Block diagram of Fault Detection in Underground Cable Using Universal
Controller (Arduino)
16
The main blocks of this project are:
3.2 ATMEGA328:
i) Features
(ATmega48PA/88PA/168PA/328P)
17
g. Programming Lock for Software Security
4.Peripheral Features
b. One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
c. Mode
5.Temperature Measurement
18
b. 28-pin PDIP, 32-lead TQFP, 28-pad QFN/MLF and 32-pad QFN/MLF
8. Operating Voltage:
9. Temperature Range:
a. 40°C to 85°C
19
Fig.no 3.2 Pin Diagram of ATMEGA328
Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each it).
The Port B output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even
if the clock is not running. Depending on the clock selection fuse settings, PB6 can be used as
input to the inverting Oscillator amplifier and input to the internal clock operating circuit.
20
Depending on the clock selection fuse settings, PB7 can be used as output from the inverting
Oscillator amplifier.
If the Internal Calibrated RC Oscillator is used as chip clock source, PB7..6 is used as
TOSC2..1 input for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set. The various
special features of Port B are elaborated in ”Alternate Functions of Port B” on page 82 and
”System Clock and Clock Options” on page 26.
Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each it).
The PC5..0 output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even
if the clock is not running.
3.3.5 PC6/RESET
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the electrical
characteristics of PC6 differ from those of the other pins of Port C. If the RSTDISBL Fuse is un
programmed, PC6 is used as a Reset input. A low level on this pin for longer than the minimum
pulse length will generate a Reset, even if the clock is not running.
The minimum pulse length is given in Table 28-3 on page 318. Shorter pulses are not
guaranteed to generate a Reset. The various special features of Port C are elaborated in ”Alternate
Functions of Port C” on page 85.
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit).
The Port D output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even
if the clock is not running. The various special features of Port D are elaborated in ”Alternate
Functions of Port D”
3.3.7 AVCC
AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. It should be
externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be
connected to VCC through a low-pass filter. Note that PC6..4 use digital supply voltage, VCC.
21
3.3.8 AREF
In the TQFP and QFN/MLF package, ADC7:6 serve as analog inputs to the A/D converter.
These pins are powered from the analog supply and serve as 10-bit ADC channels.
3.4 Overview
The AVR core combines a rich instruction set with 32 general purpose working registers. All the
32
22
registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent
registers to be accessed in one single instruction executed in one clock cycle. The resulting
architecture is more code efficient while achieving throughputs up to ten times faster than
conventional CISC microcontrollers.
In Power-save mode, the asynchronous timer continues to run, allowing the user to maintain a
timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops the
CPU and all I/O modules except asynchronous timer and ADC, to minimize switching noise
during ADC conversions. In Standby mode, the crystal/resonator Oscillator is running while the
rest of the device is sleeping. This allows very fast start-up combined with low power
consumption.
The device is manufactured using Atmel’s high density non-volatile memory technology.
The On-chip ISP Flash allows the program memory to be reprogrammed In-System through an
SPI serial interface, by a conventional non-volatile memory programmer, or by an On-chip Boot
program running on the AVR core. The Boot program can use any interface to download the
application program in the Application Flash memory. Software in the Boot Flash section will
continue to run while the Application Flash section is updated, providing true Read-While-Write
operation. By combining an 8-bit RISC CPU with In-System Self-Programmable Flash on a
monolithic chip, the Atmel ATmega48PA/88PA/168PA/328P is a powerful microcontroller that
provides a highly flexible and cost effective solution to many embedded control applications.
23
3.5 Comparison Between ATmega48PA, ATmega88PA, ATmega168PA and ATmega328P
Table.No 3.1
3.6 Overview
This section discusses the AVR core architecture in general. The main function of the CPU
core is to ensure correct program execution. The CPU must therefore be able to access memories,
perform calculations, control peripherals, and handle interrupts.
24
Fig.No 3.6
In order to maximize performance and parallelism, the AVR uses a Harvard architecture –
with separate memories and buses for program and data. Instructions in the program memory are
executed with a single level pipelining. While one instruction is being executed, the next
instruction is pre-fetched from the program memory. This concept enables instructions to be
executed in every clock cycle. The program memory is In-System Reprogrammable Flash
memory.
The fast-access Register File contains 32 x 8-bit general purpose working registers with a
single clock cycle access time. This allows single-cycle Arithmetic Logic Unit (ALU) operation.
In a typical ALU operation, two operands are output from the Register File, the operation is
executed, and the result is stored back in the Register File – in one clock cycle. Six of the 32
registers can be used as three 16-bit indirect address register pointers for Data Space addressing –
enabling efficient address calculations. One of the these address pointers can also be used as an
25
address pointer for look up tables in Flash program memory. These added function registers are
the 16-bit X-, Y-, and Z-register, described later in this section.
The ALU supports arithmetic and logic operations between registers or between a constant
and a register. Single register operations can also be executed in the ALU. After an arithmetic
operation, the Status Register is updated to reflect information about the result of the operation.
Program flow is provided by conditional and unconditional jump and call instructions, able to
directly address the whole address space. Most AVR instructions have a single 16-bit word
format. Every program memory address contains a 16- or 32-bit instruction.
Program Flash memory space is divided in two sections, the Boot Program section and the
Application Program section. Both sections have dedicated Lock bits for write and read/write
protection. The SPM instruction that writes into the Application Flash memory section must
reside in the Boot Program section.
During interrupts and subroutine calls, the return address Program Counter (PC) is stored on
the Stack. The Stack is effectively allocated in the general data SRAM, and consequently the
Stack size is only limited by the total SRAM size and the usage of the SRAM. All user programs
must initialize the SP in the Reset routine (before subroutines or interrupts are executed). The
Stack Pointer (SP) is read/write accessible in the I/O space. The data SRAM can easily be
accessed through the five different addressing modes supported in the AVR architecture.
The memory spaces in the AVR architecture are all linear and regular memory maps.
A flexible interrupt module has its control registers in the I/O space with an additional Global
Interrupt Enable bit in the Status Register. All interrupts have a separate Interrupt Vector in the
Interrupt Vector table. The interrupts have priority in accordance with their Interrupt Vector
position.
The lower the Interrupt Vector address, the higher the priority.
The I/O memory space contains 64 addresses for CPU peripheral functions as Control
Registers,SPI, and other I/O functions. The I/O Memory can be accessed directly, or as the Data
Space locations following those of the Register File, 0x20 - 0x5F. In addition, the
ATmega48PA/88PA/168PA/328P has Extended I/O space from 0x60 - 0xFF in SRAM where
only the ST/STS/STD and LD/LDS/LDD instructions can be used.
26
3.7 ALU – Arithmetic Logic Unit
The high-performance AVR ALU operates in direct connection with all the 32 general
purpose working registers. Within a single clock cycle, arithmetic operations between general
purpose registers or between a register and an immediate are executed. The ALU operations are
divided into three main categories – arithmetic, logical, and bit-functions. Some implementations
of the architecture also provide a powerful multiplier supporting both signed/unsigned
multiplication and fractional format. See the “Instruction Set” section for a detailed description.
The Status Register contains information about the result of the most recently executed
arithmetic instruction. This information can be used for altering program flow in order to perform
conditional operations. Note that the Status Register is updated after all ALU operations, as
specified in the Instruction Set Reference. This will in many cases remove the need for using the
dedicated compare instructions, resulting in faster and more compact code. The Status Register is
not automatically stored when entering an interrupt routine and restored when returning from an
interrupt. This must be handled by software.
3.9.1 Overview
The Flash memory has an endurance of at least 10,000 write/erase cycles. The
ATmega48PA/88PA/168PA/328P Program Counter (PC) is 11/12/13/14 bits wide, thus
27
addressing the 2/4/8/16K program memory locations. The operation of Boot Program section and
associated Boot Lock bits for software protection are described in detail in ”Self-Programming
the Flash, ATmega48PA” on page 269 and ”Boot Loader Support – Read-While-Write Self-
Programming, ATmega88PA, ATmega168PA and ATmega328P” on page 277. ”Memory
Programming” on page 294 contains a detailed description on Flash Programming in SPI- or
Parallel Programming mode.
Constant tables can be allocated within the entire program memory address space (see the
LPM – Load Program Memory instruction description).
The five different addressing modes for the data memory cover: Direct, Indirect with
Displacement, Indirect, Indirect with Pre-decrement, and Indirect with Post-increment. In the
Register File, registers R26 to R31 feature the indirect addressing pointer registers.
The direct addressing reaches the entire data space. The Indirect with Displacement mode
reaches 63 address locations from the base address given by the Y- or Z-register.
When using register indirect addressing modes with automatic pre-decrement and post-
increment, the address registers X, Y, and Z are decremented or incremented. The 32 general
purpose working registers, 64 I/O Registers, 160 Extended I/O Registers, and the
512/1024/1024/2048 bytes of internal data SRAM in the ATmega48PA/88PA/168PA/328P are
all accessible through all these addressing modes.
28
The EEPROM has an endurance of at least 100,000 write/erase cycles. The access between the
EEPROM and the CPU is described in the following, specifying the EEPROM Address Registers,
the EEPROM Data Register, and the EEPROM Control Register.
lets the user software detect when the next byte can be written. If the user code contains
instructions that write the EEPROM, some precautions must be taken. In heavily filtered power
supplies, VCC is likely to rise or fall slowly on power-up/down. This causes the device for some
period of time to run at a voltage lower than specified as minimum for the clock frequency used.
In order to prevent unintentional EEPROM writes, a specific write procedure must be followed.
Refer to the description of the EEPROM Control Register for details on this. When the EEPROM
is read, the CPU is halted for four clock cycles before the next instruction is executed. When the
EEPROM is written, the CPU is halted for two clock cycles before the next instruction is
executed.
Pins XTAL1 and XTAL2 are input and output, respectively, of an inverting amplifier which
can be configured for use as an On-chip Oscillator, Either a quartz crystal or a ceramic resonator
may be used. This Crystal Oscillator is a low power oscillator, with reduced voltage swing on the
XTAL2 output.
It gives the lowest power consumption, but is not capable of driving other clock inputs, and
may be more susceptible to noise in noisy environments. C1 and C2 should always be equal for
both crystals and resonators. The optimal value of the capacitors depends on the crystal or
resonator in use, the amount of stray capacitance, and the electromagnetic noise of the
environment. For ceramic resonators, the capacitor values given by the manufacturer should be
used.
29
Fig.No 3.7
3.13.1Features
2. 3 Operating modes
a. Interrupt
b. System Reset
3.13.2 Overview
In Interrupt mode, the WDT gives an interrupt when the timer expires. This interrupt can be
used to wake the device from sleep-modes, and also as a general system timer. One example is to
limit the maximum time allowed for certain operations, giving an interrupt when the operation
30
has run longer than expected. In System Reset mode, the WDT gives a reset when the timer
expires. This is typically used to prevent system hang-up in case of runaway code. The third
mode, Interrupt and System Reset mode, combines the other two modes by first giving an
interrupt and then switch to System Reset mode. This mode will for instance allow a safe
shutdown by saving critical parameters before a system reset.
The Watchdog always on (WDTON) fuse, if programmed, will force the Watchdog Timer to
System Reset mode. With the fuse programmed the System Reset mode bit (WDE) and Interrupt
mode bit (WDIE) are locked to 1 and 0 respectively. To further ensure program security,
alterations to the Watchdog set-up must follow timed sequences. The sequence for clearing WDE
and changing time-out configuration is as follows:
1. In the same operation, write a logic one to the Watchdog change enable bit (WDCE) and WDE.
A logic one must be written to WDE regardless of the previous value of the WDE bit.
2. Within the next four clock cycles, write the WDE and Watchdog prescaler bits (WDP) as
desired, but with the WDCE bit cleared. This must be done in one operation.
The following code example shows one assembly and one C function for turning off the
Watchdog Timer. The example assumes that interrupts are controlled (e.g. by disabling interrupts
globally) so that no interrupts will occur during the execution of these functions.
3.14.1 Features
6. Frequency Generator
31
3.14.2Overview
CPU accessible I/O Registers, including I/O bits and I/O pins, are shown in bold.
3.3.1 Introduction:
a. Conversion of one form of electrical power to another desired form and voltage,
typically involving converting AC line voltage to a well-regulated lower-
voltage DC for electronic devices. Low voltage, low power DC power supply
units are commonly integrated with the devices they supply, such
as computers and household electronics.
b. Batteries.
c. Chemical fuel cells and other forms of energy storage systems.
d. Solar power.
e. Generators or alternators.
32
3.3.2 Block Diagram:
33
The basic circuit diagram of a regulated power supply (DC O/P) with led
connected as load is shown in fig: 3.3.3
a. 230V AC MAINS
b. TRANSFORMER
c. BRIDGE RECTIFIER(DIODES)
d. CAPACITOR
e. VOLTAGE REGULATOR(IC 7805)
f. RESISTOR
g. LED(LIGHT EMITTING DIODE)
The detailed explanation of each and every component mentioned above is as
follows:
3.3.3 Transformers:
If the current is increased, the lines of force move outwards from the coil. If the
current is reduced, the lines of force move inwards.
34
If another coil is placed adjacent to the first coil then, as the field moves out or in,
the moving lines of force will "cut" the turns of the second coil. As it does this, a voltage
is induced in the second coil. With the 50 Hz AC mains supply, this will happen 50 times
a second. This is called MUTUAL INDUCTION and forms the basis of the transformer.
The input coil is called the PRIMARY WINDING; the output coil is the
SECONDARY WINDING. Fig: 3.3.4 shows step-down transformer.
For example, if the secondary has half the primary turns; the secondary will have
half the primary voltage.
Another example is if the primary has 5000 turns and the secondary has 500 turns,
then the turn’s ratio is 10:1.
If the primary voltage is 240 volts then the secondary voltage will be x 10 smaller
= 24 volts. Assuming a perfect transformer, the power provided by the primary must
equal the power taken by a load on the secondary. If a 24-watt lamp is connected across a
24 volt secondary, then the primary must supply 24 watts.
To aid magnetic coupling between primary and secondary, the coils are wound on
a metal CORE. Since the primary would induce power, called EDDY CURRENTS, into
this core, the core is LAMINATED. This means that it is made up from metal sheets
35
insulated from each other. Transformers to work at higher frequencies have an iron dust
core or no core at all.
Note that the transformer only works on AC, which has a constantly changing
current and moving field. DC has a steady current and therefore a steady field and there
would be no induction.
Because of having more turns secondary winding accepts more energy, and it
releases more voltage at the output side.
Incase of step down transformer, Primary winding induces more flux than the
secondary winding, and secondary winding is having less number of turns because of that
it accepts less number of flux, and releases less amount of voltage.
A battery is a type of linear power supply that offers benefits that traditional line-
operated power supplies lack: mobility, portability and reliability. A battery consists of
multiple electrochemical cells connected to provide the voltage desired. Fig: 3.3.5 shows
Hi-Watt 9V battery
36
Fig 3.3.5: Hi-Watt 9V Battery
The most commonly used dry-cell battery is the carbon-zinc dry cell battery. Dry-
cell batteries are made by stacking a carbon plate, a layer of electrolyte paste, and a zinc
plate alternately until the desired total voltage is achieved. The most common dry-cell
batteries have one of the following voltages: 1.5, 3, 6, 9, 22.5, 45, and 90. During the
discharge of a carbon-zinc battery, the zinc metal is converted to a zinc salt in the
electrolyte, and magnesium dioxide is reduced at the carbon electrode. These actions
establish a voltage of approximately 1.5 V.
The lead-acid storage battery may be used. This battery is rechargeable; it consists
of lead and lead/dioxide electrodes which are immersed in sulfuric acid. When fully
charged, this type of battery has a 2.06-2.14 V potential (A 12 volt car battery uses 6 cells
in series). During discharge, the lead is converted to lead sulfate and the sulfuric acid is
converted to water. When the battery is charging, the lead sulfate is converted back to
lead and lead dioxide A nickel-cadmium battery has become more popular in recent
years. This battery cell is completely sealed and rechargeable. The electrolyte is not
involved in the electrode reaction, making the voltage constant over the span of the
batteries long service life. During the charging process, nickel oxide is oxidized to its
higher oxidation state and cadmium oxide is reduced. The nickel-cadmium batteries have
many benefits. They can be stored both charged and uncharged. They have a long service
life, high current availabilities, constant voltage, and the ability to be recharged. Fig:
3.3.6 shows pencil battery of 1.5V.
37
Fig 3.3.6: Pencil Battery of 1.5V
3.3.8 Rectification:
3.3.8.1 Rectifiers:
When only one diode is used to rectify AC (by blocking the negative or positive
portion of the waveform), the difference between the term diode and the term rectifier is
merely one of usage, i.e., the term rectifier describes a diode that is being used to convert
AC to DC. Almost all rectifiers comprise a number of diodes in a specific arrangement
for more efficiently converting AC to DC than is possible with only one diode. Before the
development of silicon semiconductor rectifiers, vacuum tube diodes and copper (I) oxide
or selenium rectifier stacks were used.
38
3.3.8.2 Bridge full wave rectifier:
The Bridge rectifier circuit is shown in fig: 3.3.7, which converts an ac voltage to dc
voltage using both half cycles of the input ac voltage. The Bridge rectifier circuit is
shown in the figure. The circuit has four diodes connected to form a bridge. The ac input
voltage is applied to the diagonally opposite ends of the bridge. The load resistance is
connected between the other two ends of the bridge.
For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct,
whereas diodes D2 and D4 remain in the OFF state. The conducting diodes will be in
series with the load resistance RL and hence the load current flows through RL.
For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct
whereas, D1 and D3 remain OFF. The conducting diodes D2 and D4 will be in series
with the load resistance RL and hence the current flows through RL in the same direction
as in the previous half cycle. Thus a bi-directional wave is converted into a unidirectional
wave.
Input Output
39
3.3.8.4 DB107:
3.3.8.4.1 Features:
3.3.8.5 Filtration:
The process of converting a pulsating direct current to a pure direct current using
filters is called as filtration.
3.3.8.6 Filters:
First, let's consider the case of a "coupling capacitor" where the capacitor is used
to connect a signal from one part of a circuit to another but without allowing any direct
current to flow.
A capacitor will pass alternating current but (apart from an initial surge) it will not
pass d.c.
42
Where a capacitor is used to decouple a circuit, the
effect is to "smooth out ripples". Any ripples, waves
or pulses of current are passed to ground while d.c.
Flows smoothly.
3.3.8.10 Regulation:
A voltage regulator (also called a ‘regulator’) with only three terminals appears to
be a simple device, but it is in fact a very complex integrated circuit. It converts a varying
input voltage into a constant ‘regulated’ output voltage. Voltage Regulators are available
in a variety of outputs like 5V, 6V, 9V, 12V and 15V. The LM78XX series of voltage
regulators are designed for positive input. For applications requiring negative input, the
LM79XX series is used. Using a pair of ‘voltage-divider’ resistors can increase the output
voltage of a regulator circuit.
It is not possible to obtain a voltage lower than the stated rating. You cannot use a
12V regulator to make a 5V power supply. Voltage regulators are very robust. These can
withstand over-current draw due to short circuits and also over-heating. In both cases, the
regulator will cut off before any damage occurs. The only way to destroy a regulator is to
apply reverse voltage to its input. Reverse polarity destroys the regulator almost instantly.
Fig: 3.3.11 shows voltage regulator.
43
Fig 3.3.11: Voltage Regulator
3.3.8.12 Resistors:
V = IR
Resistors are elements of electrical networks and electronic circuits and are
ubiquitous in most electronic equipment. Practical resistors can be made of various
compounds and films, as well as resistance wire (wire made of a high-resistivity alloy,
such as nickel/chrome).
44
3.3.8.13 Theory of operation:
Ohm's law:
V = IR
Ohm's law states that the voltage (V) across a resistor is proportional to
the current (I) through it where the constant of proportionality is the resistance (R).
Power dissipation:
45
3.4. LED:
3.4.1 Working:
The structure of the LED light is completely different than that of the light bulb.
Amazingly, the LED has a simple and strong structure. The light-emitting semiconductor
material is what determines the LED's color. The LED is based on the semiconductor
diode.
When a diode is forward biased (switched on), electrons are able to recombine
with 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 gap of the semiconductor. An LED is usually small in area
46
(less than 1 mm2), and integrated optical components are used to shape its radiation
pattern and assist in reflection. LED’s present many advantages over incandescent light
sources including lower energy consumption, longer lifetime, improved robustness,
smaller size, faster switching, and greater durability and reliability. However, they are
relatively expensive and require more precise current and heat management than
traditional light sources. Current LED products for general lighting are more expensive to
buy than fluorescent lamp sources of comparable output. They also enjoy use in
applications as diverse as replacements for traditional light sources in automotive lighting
(particularly indicators) and in traffic signals. The compact size of LED’s has allowed
new text and video displays and sensors to be developed, while their high switching rates
are useful in advanced communications technology. The electrical symbol and polarities
of led are shown in fig: 3.4.3.
47
Applications of LED fall into three major categories:
• Visual signal application where the light goes more or less directly from the LED
to the human eye, to convey a message or meaning.
• Illumination where LED light is reflected from object to give visual response of
these objects.
• Generate light for measuring and interacting with processes that do not involve
the human visual system.
48
Pin description:
The LCD requires 3 control lines as well as either 4 or 8 I/O lines for the data bus.
The user may select whether the LCD is to operate with a 4-bit data bus or an 8-bit data
bus. If a 4-bit data bus is used the LCD will require a total of 7 data lines (3 control lines
plus the 4 lines for the data bus). If an 8-bit data bus is used the LCD will require a total
of 11 data lines (3 control lines plus the 8 lines for the data bus).
The three control lines are referred to as EN, RS, and RW.
The EN line is called "Enable." This control line is used to tell the LCD that we
are sending it data. To send data to the LCD, our program should make sure this line is
49
low (0) and then set the other two control lines and/or put data on the data bus. When the
other lines are completely ready, bring EN high (1) and wait for the minimum amount of
time required by the LCD datasheet (this varies from LCD to LCD), and end by bringing
it low (0) again.
The RS line is the "Register Select" line. When RS is low (0), the data is to be
treated as a command or special instruction (such as clear screen, position cursor, etc.).
When RS is high (1), the data being sent is text data which should be displayed on the
screen. For example, to display the letter "T" on the screen we would set RS high.
The RW line is the "Read/Write" control line. When RW is low (0), the
information on the data bus is being written to the LCD. When RW is high (1), the
program is effectively querying (or reading) the LCD. Only one instruction ("Get LCD
status") is a read command. All others are write commands--so RW will almost always be
low.
Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation
selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0,
DB1, DB2, DB3, DB4, DB5, DB6, and DB7.
Schematic:
50
3.5.2 Circuit Description:
Above is the quite simple schematic. The LCD panel's Enable and Register Select
is connected to the Control Port. The Control Port is an open collector / open drain
output. While most Parallel Ports have internal pull-up resistors, there is a few which
don't. Therefore by incorporating the two 10K external pull up resistors, the circuit is
more portable for a wider range of computers, some of which may have no internal pull
up resistors.
We make no effort to place the Data bus into reverse direction. Therefore we hard
wire the R/W line of the LCD panel, into write mode. This will cause no bus conflicts on
the data lines. As a result we cannot read back the LCD's internal Busy Flag which tells
us if the LCD has accepted and finished processing the last instruction. This problem is
overcome by inserting known delays into our program.
The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy here.
As with all the examples, I've left the power supply out. We can use a bench power
supply set to 5v or use an onboard +5 regulator. Remember a few de-coupling capacitors,
especially if we have trouble with the circuit working properly.
3.5.3 SETB RW
As we mentioned above, the EN line is used to tell the LCD that we are ready for it
to execute an instruction that we've prepared on the data bus and on the other control
lines. Note that the EN line must be raised/ lowered before/after each instruction sent to
the LCD regardless of whether that instruction is read or write text or instruction. In
short, we must always manipulate EN when communicating with the LCD. EN is the
LCD's way of knowing that we are talking to it. If we don't raise/lower EN, the LCD
doesn't know we're talking to it on the other lines.
51
Thus, before we interact in any way with the LCD we will always bring the EN line
low with the following instruction:
3.5.4 CLR EN
And once we've finished setting up our instruction with the other control lines and
data bus lines, we'll always bring this line high:
3.5.5 SETB EN
The line must be left high for the amount of time required by the LCD as specified
in its datasheet. This is normally on the order of about 250 nanoseconds, but checks the
datasheet. In the case of a typical microcontroller running at 12 MHz, an instruction
requires 1.08 microseconds to execute so the EN line can be brought low the very next
instruction. However, faster microcontrollers (such as the DS89C420 which executes an
instruction in 90 nanoseconds given an 11.0592 MHz crystal) will require a number of
NOPs to create a delay while EN is held high. The number of NOPs that must be inserted
depends on the microcontroller we are using and the crystal we have selected.
The instruction is executed by the LCD at the moment the EN line is brought low
with a final CLR EN instruction.
While it is possible to write code that waits for a specific amount of time to allow
the LCD to execute instructions, this method of "waiting" is not very flexible. If the
crystal frequency is changed, the software will need to be modified. A more robust
52
method of programming is to use the "Get LCD Status" command to determine whether
the LCD is still busy executing the last instruction received.
The "Get LCD Status" command will return to us two tidbits of information; the
information that is useful to us right now is found in DB7. In summary, when we issue
the "Get LCD Status" command the LCD will immediately raise DB7 if it's still busy
executing a command or lower DB7 to indicate that the LCD is no longer occupied. Thus
our program can query the LCD until DB7 goes low, indicating the LCD is no longer
busy. At that point we are free to continue and send the next command.
3.5.7 Applications:
a. Medical equipment
b. Electronic test equipment
c. Industrial machinery Interface
d. Serial terminal
e. Advertising system
f. EPOS
g. Restaurant ordering systems
h. Gaming box
i. Security systems
j. R&D Test units
k. Climatizing units
l. PLC Interface
m. Simulators
n. Environmental monitoring
o. Lab development
p. Student projects
q. Home automation
r. PC external display
s. HMI operator interface.
53
CHAPTER 4: SOFTWARE DESCRIPTION
Express PCB has been used to design many PCBs (some layered and with
surface-mount parts. Print out PCB patterns and use the toner transfer method with an
Etch Resistant Pen to make boards. However, Express PCB does not have a nice print
layout. Here is the procedure to design in Express PCB and clean up the patterns so they
print nicely.
Express PCB comes with a less then exciting list of parts. So before any project
is started head over to Audio logic and grab the additional parts by morsel, ppl, and
54
tangent, and extract them into your Express PCB directory. At this point start the program
and get ready to setup the workspace to suit your style.
Click View -> Options. In this menu, setup the units for “mm” or “in” depending
on how you think, and click “see through the top copper layer” at the bottom. The
standard color scheme of red and green is generally used but it is not as pleasing as red
and blue.
When a project is first started you will be greeted with a yellow outline. This
yellow outline is the dimension of the PCB. Typically after positioning of parts and
traces, move them to their final position and then crop the PCB to the correct size.
However, in designing a board with a certain size constraint, crop the PCB to the correct
size before starting.
Fig: 4.1 show the toolbar in which the each button has the following functions:
1. The select tool: It is fairly obvious what this does. It allows you to move and
manipulate parts. When this tool is selected the top toolbar will show buttons to
move traces to the top / bottom copper layer, and rotate buttons.
2. The zoom to selection tool: does just that.
3. The place pad: button allows you to place small soldier pads which are useful for
board connections or if a part is not in the part library but the part dimensions are
available. When this tool is selected the top toolbar will give you a large selection
of round holes, square holes and surface mount pads.
4. The place component: tool allows you to select a component from the top toolbar
and then by clicking in the workspace places that component in the orientation
chosen using the buttons next to the component list. The components can always
be rotated afterwards with the select tool if the orientation is wrong.
55
5. The place trace: tool allows you to place a solid trace on the board of varying
thicknesses. The top toolbar allows you to select the top or bottom layer to place
the trace on.
6. The Insert Corner in trace: button does exactly what it says. When this tool is
selected, clicking on a trace will insert a corner which can be moved to route
around components and other traces.
7. The remove a trace button is not very important since the delete key will achieve
the same result.
Before starting a project there are several ways to design a PCB and one must be
chosen to suit the project’s needs.
When making a PCB you have the option of making a single sided board, or a
double sided board. Single sided boards are cheaper to produce and easier to etch, but
much harder to design for large projects. If a lot of parts are being used in a small space
it may be difficult to make a single sided board without jumpering over traces with a
cable. While there’s technically nothing wrong with this, it should be avoided if the
signal travelling over the traces is sensitive (e.g. audio signals).
When using a double sided board you must consider which traces should be on
what side of the board. Generally, put power traces on the top of the board, jumping
56
only to the bottom if a part cannot be soldiered onto the top plane (like a relay), and
vice- versa.
Some projects like power supplies or amps can benefit from having a solid plane
to use for ground. In power supplies this can reduce noise, and in amps it minimizes the
distance between parts and their ground connections, and keeps the ground signal as
simple as possible. However, care must be taken with stubborn chips such as the
TPA6120 amplifier from TI. The TPA6120 datasheet specifies not to run a ground
plane under the pins or signal traces of this chip as the capacitance generated could
effect performance negatively.
Step 1: Parts
1 x Arduino on a Breadboard
1 x Arduino UNO
Connecting Wires
Arduino IDE installed on your PC
We use the Arduino UNO to bootload the ATmega328 that is sitting on the Arduino-on-
a-Breadboard. This is fairly straightforward having an ATmega328P-PU, but needs an
extra step for an ATmega328-PU.
57
Step 3: Program your Arduino UNO as an ISP
We need to program the Arduino UNO to act as an ISP (In-System Programmer), so that it can
burn the bootloader onto the Breadboard chip.
58
Search for void heartbeat and change the line that reads:
delay(40);
to
delay(20);
Connect your UNO to the PC, making sure it’s not connected to the Arduino on a
Breadboard.
Ensure your UNO is selected under the Boards menu option, and upload the sketch.
59
Now connect your ATmega to your UNO as follows:
60
I learnt the hard way that there is more than one type of ATmega328. The two variants
that are of interest to us are the ATmega328-PU and the ATmega328P-PU.
The -PU suffix means that the chips are in a PDIP package, the format we need for
our breadboard.
The 328P is a picoPower processor, designed for low power consumption, and is used
on the Arduino boards. Given low power consumption this is first choice.
The 328 does not have picoPower technology, and is not used on the Arduino boards –
and is not explicitly supported by the Arduino IDE.
What this means is that we can easily bootload the ATmega328P, but not the
ATmega328. Unfortunately the websites that sell these chips don't always differentiate
between them and forums are filled with people struggling to use the ATmega328-PU.
Each microprocessor has a signature – a unique code that identifies its model.
When you bootload a chip (or even upload a sketch) the Arduino IDE checks that
the chip selected matches the type it’s connected to. Even though the ATmega328-
PU in essence functions in the same way as the ATmega328P-PU, it has a different
signature, and one that isn’t recognised by the Arduino IDE.
To burn the Bootloader, choose Burn Bootloader from the Tools menu
You should see a message “Burning bootloader to I/O Board (this may take a minute)"
Once the bootloader has been burned, a message of confirming the success gets
displayed.
62
CHAPTER 5. INTERNET OF THINGS
The evaluation of IOT in the electrical Power Industry transformed the way things
performed in usual manner. IOT increased the use of wireless technology to connect
power industry assets and infrastructure in order to lower the power consumption and
cost. The applications of IOT are not limited to particular fields, but span a wide range of
applications such as energy systems, homes, industries, cities, logistics, heath, agriculture
and so on. Since 1881, the overall power grid system has been built up over more than 13
decades, meeting the ever increasing demand for energy.
63
Power grids are now been considered to be one of the vital components of
infrastructure on which the modern society depends. It is essential to provide
uninterrupted power without outages or losses. It is quiet hard to digest the fact that
power generated is not equal to the power consumed at the end point due to various
losses. It is even harder to imagine the after effects without power for a minute. Power
outages occur as result of short circuits. This is a costly event as it influences the
industrial production, commercial activities and consumer lifestyle. Government &
independent power providers are continuously exploring solutions to ensure good power
quality, maximize grid uptime, reduce power consumption, increase the efficiency of grid
operations and eradicate outages, power loss & theft.
IOT system is composed of three layers: the perception layer, the network layer, and
the application layer as shown in Figure 1.3.The perception layer includes a group of
Internet-enabled devices that can percept, detect objects, collect systems information,
and exchange information with other devices through the Internet communication
64
networks. Sensors, Global Positioning Systems (GPS), cameras, and Radio Frequency
Identification Devices (RFID) are examples of devices that exist at perception layer. The
network layer is responsible of forwarding data from perception layer to the application
layer under the constraints of devices’ capabilities, network limitation and the
applications’ constraints. IOT systems use a combination of Internet and short-range
networks based on the communicated parties. Short-range communication technologies
such as Bluetooth and ZigBee are used to carry the information from perception devices
to a nearby gateway. Other technologies such as Wi-Fi, 2G, 3G, 4G, and Power line
Communication (PLC) carry the information for long distances based on the application.
The upper layer is the application layer, where incoming information is processed to
induce insights for better power’s distribution design and management strategies.
65
CHAPTER 6: PROJECT DESCRIPTION
AND LOCATION USING IOT explains the interfacing section of each component with
micro controller. Wi-fi module is connected to 8th and 9th pins of micro controller and 13th LED
66
CHAPTER 7: ADVANTAGES AND DISADVANTAGES
7.1 Advantages:
• Fast response
7.2 Disadvantages:
7.3 Applications:
1. Industrial applications.
2. Home appliances.
67
CHAPTER 8: RESULTS
8.1 Result:
Controller (Arduino)” was designed determine the distance of underground cable fault
8.2 Conclusion:
1. This project can be enhanced by using higher power electronic devices to operate
high capacity DC motors. Regenerative braking for optimizing the power
consumption can also be incorporated.
2. The project can be extended using wireless communication using zigbee, Wifi,
bluetooth
68
3. The project can also be extended using mobile communication to control speed
based on DTMF technology from any where in the world.
4. Using GSM modem the feed back of device status can be known through SMS
messages
This project can be extended by using wireless technology like Zigbee and by
interfacing it with PC, we can plot the graph between speed of dc motor VS loads.
69
REFERENCES
1. www.wikipedia.com
2. www.allaboutcircuits.com
3. www.microchip.com
4. www.howstuffworks.com
Books referred:
5. Embedded C –Michael.J.Pont.
70
APPENDIX
Program Code:
The program code which is dumped in the microcontroller of our project is shown below.
#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
#include <esp8266.h>
LiquidCrystal lcd(2,3,4,5,6,7);
SoftwareSerial mySerial(10,9); // RX, TX
char ch;
void setup()
{
Serial.begin(9600);
mySerial.begin(115200);
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor (0, 0); //sets the cursor at row 0 column
0
lcd.print ("Under ground cable"); // prints 16x2 LCD MODULE
lcd.setCursor (0,1); //sets the cursor at row 0 column 1
lcd.print ("Fault detection");
pinMode(13,OUTPUT);
mySerial.println("AT+RST");
delay(300);
digitalWrite(13,1);
delay(700);
digitalWrite(13,0);
delay(700);
digitalWrite(13,1);
delay(700);
digitalWrite(13,0);
delay(700);
71
}
void loop()
{
long dist1 = 0;
long dist2 = 0;
long dist3 = 0;
while(1)
{
int sensorValue1 = analogRead(A0);
int sensorValue2 = analogRead(A1);
int sensorValue3 = analogRead(A2);
lcd.clear();
lcd.setCursor (0, 0); //sets the cursor at row 0
column 0
lcd.print ("Status:"); // prints 16x2 LCD MODULE
mySerial.print(getStr);
digitalWrite(13,1);
delay(2500);
digitalWrite(13,0);
}
}
74