Professional Documents
Culture Documents
CONTROL
BY-
ABHISHEK NEB
ABSTRACT
Voice is used in this project for the controlling switches. Reason for choosing voice is
because it is easily being reproduced by human. Besides that, usage of voice gives a control
system that can be effective and convenient to be used. The application of this system involve
modifying the switching system from the traditional way which is physical contact with the
switch to a safer way where the usage of voice to replace all the physical contact. This project
involve a simple switching system that used the transistor along with relay to do all the
connecting of the power to the devices, a voice recognition system that consists of voice
recognition chip AT89C51, and the AT89C51 microcontroller to build up the system. The
ULN2003 serves as the ear that will listen and interpret the command by the given while the
AT89C51 serve as the brain of the system that will coordinate the correct output with the
input command given. This project able to recognition the command trained by the user and
successfully to execute the correct output. This project is a small scale design which consists
of 8 commands that will used to control three different switches. The command is able to
individually switch on and switch off each of the switch. Besides that, the command also able
to switch on all and off all the switch at the same time.
LIST OF ABBREVIATIONS
1.1Background
Home automated system is characterized by the ability of the system to perform tasks to
initiate or control appliance or devices in home. Nowadays, the appliance that available in the
market is getting increase as days passed. Thus, the controlling of such devices is getting
more and more attention. From long time ago mostly the controlling is done manually such as
walking to the switch and switching it on. But as time passed the arrival or remote control that
give the user alternative way to control such appliance without the need for the user to walk to
the appliance.
From the above, there are some more advancement in the controlling method that been on
research. The advancement mention is using of the voice to act as the controlling medium to
initiate or to control the appliance. Taking example such as a security door is only can be
activated with the voice of the authorized personal only if then the door will be unlocked. In
this project, the voice is also used as the medium to perform the controlling of the electrical
appliance in home. The same concept applies in this project compare to the security door
where the different is the electrical appliance controlled.
The main objective of this project is to design a voice recognition home automation system.
This project will enable the user to control the electrical appliance in home using their voice
as the medium that will control the power system. This project also aim to allow not only the
user that have train the system with their voice to control the system but it extend to the other
user who also can use the system without do the training process again.
Besides that, this system provides user a better safety against any current leakage, because by
using voice direct contact with the power source is reduced compare to the usage of
conventional switch.
In order to achieve the objective of this project, there are several scope had been identified.
The scope of this project includes the designing of a voice recognition circuit for the voice
recognition purpose. Follow by the designing of the microcontroller board using AT89S52 as
the hardware that control the whole project by serving as interface for the voice recognition
board with the electrical appliance. Next, a C programming is to be design and coded to
enable the microcontroller to be able to function properly as desired.
This thesis consists of five chapters. In the first chapter, it discuss about the objective, scope
of project and summary of the work. In second chapter, the discussion is more focused on the
literature review. In third chapter, the discussion will be mainly on the methodology of the
hardware and the software implementation in this project
While for chapter four, the discussion is mainly on the theory and working description. Last
but not least the chapter five, the result, conclusion of this project is discussed along with the
future work
This project is summarized to the flow chart below for all the necessary implementation and
optimization of the project. Figure 1.1 shows the flow chart..
Figure 1.1: The Flow chart of the implementation of the project.
CHAPTER 2
LITERATURE REVIEW
2.1 Introduction
This chapter included the background study regarding the voice recognition concept and
several similar projects that applies the theory of voice and sound. It also discussed briefly
about the AT89S52 microcontroller.
This concept is more alike a comparison of between the source and the data stored in memory
(the voice that stored during the training process). The way of this concept function is when a
user speaks out some command, with then the voice is captured through microphone as the
input devices. Once the voice is captured, the usage of a decoding system that will convert the
analog (voice) to digital (binary signal). Later, the input voice is compared with the data
stored in the memory early before the testing. The output of the comparison is the voice
matched with any of the command trained and certain signal is produce as the input for the
controlling system.
There are a few projects done locally by other student and researcher in Malaysia regarding
on the voice related research.
First of it will be the automated home lighting system, by a degree student of UTM. In this
projects, the usage of clap(s) as the source of input or command to control the lighting system
in home. This project offers the ability to control the lighting in term of the intensity or
brightness with corresponding to the light intensity in a room due to environment. From this
project, it can be concluded that the usage of sound is proof to be a way of controlling the
electrical appliance [1]. But the application will be limited to one electrical appliance.
Follow by another research by a master student of UTM. While for this project the voice is
apply as a way to control the wheel chair movement. In this project, a wheel chair is modified
by equipping it with the motor system that will read the command given by the user to control
it speed and movement direction [2]. This project is successful due to the usage of the
HM2007 voice recognition chip. From this project, it can be concluded that the usage of the
voice is capable to be one of the method to control electrical devices provided a suitable
system is used.
There are also some projects made by our seniors based on the controlling of electrical
appliances with the help of PC interface and remote control .
From all above of the discussion on the previous project that have been done by other student.
In this project, the application of the concept and theory used in the above project is applied.
Thus this lead to a project that have the capability to produce a system that have the
application of voice as the controlling method for controlling the electrical appliance or
devices in home.
In this system, voice is used as the primary input to the system. This is because voice is
available for each and every user by doing so the system offers a wide range of the controlling
to the user. By using all the above way the system is able to function as it was designed for
which is to enable the usage of the voice to control the electrical appliance and devices in
home.
CHAPTER 3
METHODOLOGY
3.1 Introduction
Home automation (also called domotics) is the residential extension of "building automation".
It is automation of the home, housework or household activity. Home automation may include
centralized control of lighting, HVAC (heating, ventilation and air conditioning), appliances,
and other systems, to provide improved convenience, comfort, energy efficiency and security.
Home automation for the elderly and disabled can provide increased quality of life for persons
who might otherwise require caregivers or institutional care.
A home automation system integrates electrical devices in a house with each other. The
techniques employed in home automation include those in building automation as well as the
control of domestic activities, such as home entertainment systems, houseplant and yard
watering, pet feeding, changing the ambiance "scenes" for different events (such as dinners or
parties), and the use of domestic robots. Devices may be connected through a computer
network to allow control by a personal computer, and may allow remote access from the
internet.
Typically, a new home is outfitted for home automation during construction, due to the
accessibility of the walls, outlets, and storage rooms, and the ability to make design changes
specifically to accommodate certain technologies. Wireless systems are commonly installed
when outfitting a pre-existing house, as they reduce wiring changes. These communicate
through the existing power wiring, radio, or infrared signals with a central controller. Network
sockets may be installed in every room like AC power receptacles.
Although automated homes of the future have been staple exhibits for World's Fairs and
popular backgrounds in science fiction, complexity, competition between vendors, multiple
incompatible standard and the resulting expense have limited the penetration of home
automation to homes of the wealthy or ambitious hobbyists. Possibly the first "home
computer" was an experimental system in 1966
3.1.1 History and early developments
Earliest home control systems were proposed by Hitachi & Matsushita in 1978.
First home automation blue prints and demonstrations held by Japanese Electrical
Appliance manufacturers like Sanyo, Sony, Toshiba etc.
Honeywell’s first demonstration house started in 1978.
American X 10 system appeared in 1979.
Two rival programs CE Bus and Smart House started in the early 1980’s in the US.
GE reported their multimedia home bus signaling protocol Homenet in 1983.
Total Home system launched in 1992.
GIS, Home Automation Ltd. MK Electric took the initiative in Europe.
3.1.2 General Working
In this section will discuss on the hardware used in the implementation of this system
that include the AT89S52, ULN 2003, voltage regulator and the relay for interfaces.
3.2.1.1 Features
The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of
RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-
vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock
circuitry. In addition, the AT89S52 is designed with static logic for operation down to the
RAM con-tents but freezes the oscillator, disabling all other chip functions until the next
interrupt or hardware reset.
3.2.1.3 Pin Configurations
Port 1 also receives the low-order address bytes during Flash programming and
verification.
5. Port 2- Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2
output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins,
they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port
2 pins that are externally being pulled low will source current (IIL) because of the
internal pull-ups. Port 2 emits the high-order address byte during fetches from external
program memory and during accesses to external data memory that use 16-bit
addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups
when emitting 1s. During accesses to external data memory that use 8-bit addresses
(MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2
also receives the high-order address bits and some control signals during Flash
programming and verification.
6. Port 3- Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3
output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins,
they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port
3 pins that are externally being pulled low will source current (IIL) because of the
pull-ups. Port 3 receives some control signals for Flash programming and verification.
Port 3 also serves the functions of various special features of the AT89S52, as shown
in the following table.
7. RST- Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device. This pin drives high for 98 oscillator periods after the
Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to
disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature
is enabled.
8. ALE/PROG - Address Latch Enable (ALE) is an output pulse for latching the low
byte of the address during accesses to external memory. This pin is also the program
pulse input (PROG) during Flash programming. In normal operation, ALE is emitted
at a constant rate of 1/6 the oscillator frequency and may be used for external timing
or clocking purposes. Note, however, that one ALE pulse is skipped dur-ing each
access to external data memory. If desired, ALE operation can be disabled by setting
bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or
MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable
bit has no effect if the microcontroller is in external execution mode.
9. PSEN- Program Store Enable (PSEN) is the read strobe to external program memory.
When the AT89S52 is executing code from external program memory, PSEN is
activated twice each machine cycle, except that two PSEN activations are skipped
during each access to external data memory.
10. EA/VPP- External Access Enable. EA must be strapped to GND in order to enable
the device to fetch code from external program memory locations starting at 0000H up
to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally
latched on reset. EA should be strapped to VCC for internal program executions. This
pin also receives the 12-volt programming enable voltage (VPP) during Flash
programming.
11. XTAL1- Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
12. XTAL2 -Output from the inverting oscillator amplifier.
Timer 2 Registers: Control and status bits are contained in registers T2CON and T2MOD
for Timer 2. The register pair (RCAP2H, RCAP2L) are the Capture/Reload registers for
Timer 2 in 16-bit capture mode or 16-bit auto-reload mode.
Interrupt Registers: The individual interrupt enable bits are in the IE register. Two priorities
can be set for each of the six interrupt sources in the IP register.
MCS-51 devices have a separate address space for Program and Data Memory. Up to 64K
bytes each of external Program and Data Memory can be addressed.
Program Memory If the EA pin is connected to GND, all program fetches are directed to
external memory. On the AT89S52, if EA is connected to VCC, program fetches to addresses
0000H through 1FFFH are directed to internal memory and fetches to addresses 2000H
through FFFFH are to external memory.
Data Memory The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes
occupy a parallel address space to the Special Function Registers. This means that the upper
128 bytes have the same addresses as the SFR space but are physically separate from SFR
space. When an instruction accesses an internal location above address 7FH, the address mode
used in the instruction specifies whether the CPU accesses the upper 128 bytes of RAM or the
SFR space. Instructions which use direct addressing access the SFR space.
For example, the following direct addressing instruction accesses the SFR at location 0A0H
(which is P2).
MOV 0A0H, #data
Instructions that use indirect addressing access the upper 128 bytes of RAM. For example,
the following indirect addressing instruction, where R0 contains 0A0H, accesses the data byte
at address 0A0H, rather than P2 (whose address is 0A0H).
Note that stack operations are examples of indirect addressing, so the upper 128 bytes of data
RAM are available as stack space.
DESCRIPTION
The ULN2003 is high voltage, high current Darlington arrays each containing seven open
collectors Darlington pairs with common emitters. Each channel rated at 500mA and can
withstand peak currents of 600mA. Suppression diodes are included for inductive load driving
and the inputs are pinned opposite the outputs to simplify board layout.
PACKAGE
2003A is supplied in 16 pin plastic DIP packages with a copper lead frame to reduce thermal
resistance.
ULN2003A: 06 – 15V
CMOS
PMOS
APPLICATIONS
These versatile devices are useful for driving a wide range of loads including solenoids, relays
DC motors; LED displays filament lamps, thermal print heads and high power buffers.
SCHEMATIC DIAGRAM
3.2.3POWER SUPPLY
In the power supply section we use one step down transformer to step down the voltage from
220 volt ac to 9 volt dc. Output of the transformer is further connected to the two diode
circuit. Here two diode work as a full wave rectifier circuit. Output of the full wave rectifier is
now filtered by the capacitor. Capacitor converts the pulsating dc into smooth dc with the
help of charging and discharging effect. Output of the capacitor is now regulated by the IC
7805 regulator. IC 7805 provides a 5 volt regulation to the circuit and provides a regulated 5
volt power supply. Output of the regulator is now again filter by the capacitor. In the output of
the capacitor we use one resistor and one l.e.d in series to provide a visual indication to the
circuit.
DESCRIPTION
Rugged glass package, using a high temperature alloyed construction. This package is
hermetically sealed and fatigue free as coefficients of expansion of all used parts are matched.
Fig.1 Simplified outline (SOD57) and symbol.
3.2.5 TRANSISTOR
The name is transistor derived from ‘transfer resistors’ indicating a solid state Semiconductor
device. In addition to conductor and insulators, there is a third class of material that exhibits
proportion of both. Under some conditions, it acts as an insulator, and under other conditions
it’s a conductor. This phenomenon is called Semi-conducting and allows a variable control
over electron flow. So, the transistor is semi conductor device used in electronics for
amplitude. Transistor has three terminals, one is the collector, one is the base and other is the
emitter, (each lead must be connected in the circuit correctly and only then the transistor will
function). Electrons are emitted via one terminal and collected on another terminal, while the
third terminal acts as a control element. Each transistor has a number marked on its body.
Every number has its own specifications.
There are mainly two types of transistor (i) NPN & (ii) PNP
NPN Transistors:
When a positive voltage is applied to the base, the transistor begins to conduct by allowing
current to flow through the collector to emitter circuit. The relatively small current flowing
through the base circuit causes a much greater current to pass through the emitter / collector
circuit. The phenomenon is called current gain and it is measure in beta.
PNP Transistor:
It also does exactly same thing as above except that it has a negative voltage on its collector
and a positive voltage on its emitter.
Transistor is a combination of semi-conductor elements allowing a controlled current
flow. Germanium and Silicon is the two semi-conductor elements used for making it. There
are two types of transistors such as POINT CONTACT and JUNCTION TRANSISTORS.
Point contact construction is defective so is now out of use. Junction triode transistors are in
many respects analogous to triode electron tube.
A junction transistor can function as an amplifier or oscillator as can a triode tube, but has the
additional advantage of long life, small size, ruggedness and absence of cathode heating
power.
Junction transistors are of two types which can be obtained while manufacturing.
The two types are: -
1) PNP TYPE: This is formed by joining a layer of P type of germanium to an N-P
Junction.
P N P
1) NPN TYPE:
This is formed by joining a layer of N type
germanium to a P-N Junction.
N P N
The majority carriers (holes) of P region (known as emitter) move to N region as they are
repelled by the positive terminal of battery while the electrons of N region are attracted by the
positive terminal. The holes overcome the barrier and cross the emitter junction into N region.
As the width of base region is extremely thin, two to five percent of holes recombine with the
free electrons of N-region which result in a small base current while the remaining holes (95%
to 98%) reach the collector junction. The collector is biased negatively and the negative
collector voltage aids in sweeping the hole into collector region.
As the P region at the right is biased negatively, a very small current should flow but
the following facts are observed:-
1) A substantial current flows through it when the emitter junction is biased in a forward
direction.
2) The current flowing across the collector is slightly less than that of the emitter.
3) The collector current is a function of emitter current i.e. with the decrease or increase
in the emitter current a corresponding change in the collector current is observed.
The facts can be explained as follows:-
1. As already discussed that 2 to 5% of the holes are lost in recombination with the
electron n base region, which result in a small base current and hence the collector
current is slightly less than the emitter current.
2. The collector current increases as the holes reaching the collector junction are
attracted by negative potential applied to the collector.
3. When the emitter current increases, most holes are injected into the base region, which
is attracted by the negative potential of the collector and hence results in increasing the
collector current. In this way emitter is analogous to the control of plate current by
small grid voltage in a vacuum triode.
Hence we can say that when the emitter is forward biased and collector is negatively
biased, a substantial current flows in both the circuits. Since a small emitter voltage of about
0.1 to 0.5 volts permits the flow of an appreciable emitter current the input power is very
small. The collector voltage can be as high as 45 volts.
3.2.6 RESISTANCE
Resistance is the opposition of a material to the current. It is measured in Ohms (Ω). All
conductors represent a certain amount of resistance, since no conductor is 100% efficient. To
control the electron flow (current) in a predictable manner, we use resistors. Electronic
circuits use calibrated lumped resistance to control the flow of current. Broadly speaking,
resistor can be divided into two groups viz. fixed & adjustable (variable) resistors. In fixed
resistors, the value is fixed & cannot be varied. In variable resistors, the resistance value can
be varied by an adjuster knob. It can be divided into (a) Carbon composition (b) Wire wound
(c) Special type. The most common type of resistors used in our projects is carbon type. The
resistance value is normally indicated by color bands. Each resistance has four colors, one of
the band on either side will be gold or silver, this is called fourth band and indicates the
tolerance, others three band will give the value of resistance (see table). For example if a
resistor has the following marking on it say red, violet, gold. Comparing these colored rings
with the color code, its value is 27000 ohms or 27 kilo ohms and its tolerance is ±5%.
Resistor comes in various sizes (Power rating). The bigger, the size, the more power rating of
1/4 watts. The four color rings on its body tells us the value of resistor value as given below.
COLOURS CODE
Black-----------------------------------------------------0
Brown----------------------------------------------------1
Red-------------------------------------------------------2
Orange---------------------------------------------------3
Yellow---------------------------------------------------4
Green-----------------------------------------------------5
Blue-------------------------------------------------------6
Violet-----------------------------------------------------7
Grey------------------------------------------------------8
White-----------------------------------------------------9
The first rings give the first digit. The second ring gives the second digit. The third
ring indicates the number of zeroes to be placed after the digits. The fourth ring gives
tolerance (gold ±5%, silver ± 10%, No color ± 20%).
In variable resistors, we have the dial type of resistance boxes. There is a knob with a metal
pointer. This presses over brass pieces placed along a circle with some space b/w each of
them. Resistance coils of different values are connected b/w the gaps. When the knob is
rotated, the pointer also moves over the brass pieces. If a gap is skipped over, its resistance is
included in the circuit. If two gaps are skipped over, the resistances of both together are
included in the circuit and so on.
A dial type of resistance box contains many dials depending upon the range, which it has to
cover. If a resistance box has to read up to 10,000Ω, it will have three dials each having ten
gaps i.e. ten resistance coils each of resistance 10Ω. The third dial will have ten resistances
each of 100Ω.
The dial type of resistance boxes is better because the contact resistance in this case is small
& constant.
3.2.7 Capacitors
It is an electronic component whose function is to accumulate charges and then release it.
To understand the concept of capacitance, consider a pair of metal plates which all are placed
near to each other without touching. If a battery is connected to these plates the positive pole
to one and the negative pole to the other, electrons from the battery will be attracted from the
plate connected to the positive terminal of the battery. If the battery is then disconnected, one
plate will be left with an excess of electrons, the other with a shortage, and a potential or
voltage difference will exists between them. These plates will be acting as capacitors.
(1) Fixed type like ceramic, polyester, electrolytic capacitors-these names refer to the
material they are made of aluminum foil.
(2) Variable type like gang condenser in radio or trimmer. In fixed type capacitors, it has two
leads and its value is written over its body and variable type has three leads. Unit of
measurement of a capacitor is farad denoted by the symbol F. It is a very big unit of
capacitance. Small unit capacitor are Pico-farad denoted by PF (1PF=1/1000, 000,000,000 f)
Above all, in case of electrolytic capacitors, its two terminal are marked as (-) and (+) so
check it while using capacitors in the circuit in right direction. Mistake can destroy the
capacitor or entire circuit in operational.
3.2.8 DIODE
If the connections are reversed, a very little current will flow. This is because under this
condition, the p-type material will accept the electrons from the negative terminal of the
battery and the N-type material will give up its free electrons to the battery, resulting in the
state of electrical equilibrium since the N-type material has no more electrons. Thus there will
be a small current to flow and the diode is called Reverse biased.
Thus the Diode allows direct current to pass only in one direction while blocking it in the
other direction. Power diodes are used in concerting AC into DC. In this, current will flow
freely during the first half cycle (forward biased) and practically not at all during the other
half cycle (reverse biased). This makes the diode an effective rectifier, which convert ac into
pulsating dc. Signal diodes are used in radio circuits for detection. Zener diodes are used in
the circuit to control the voltage.
In this project, the primary interface between the systems with the electrical appliance is the
relay. The relay is actually a switch alike component just the different is the way of triggering
is through the magnetic field that will change the contact and thus activating a switch. This
model of relay is selected for a few reasons. First of it is the required triggering voltage which
is 5 volts and this power sources is easy to be acquire by using a simple 7805 regulator IC
Chip. Second is the contacts voltage that permitted by this model which is 240volts, and it fit
just nice to the system as this system serves as the switching system that will replace a switch
which traditionally used to connect the 240 volts power supply from 16 power supply.
If low range (Rxl) of the ohmmeter is used the LED would light up in most cases because the
low range of ohmmeter can pass sufficient current to light up the LED.
Another safe method is to connect the test circuit shown in Fig. 2. Use any two dry cells in
series with a current limiting resistor of 68 to 100 ohms. The resistor limits the forward diode
current of the LED under test to a safe value. When the LED under test is connected to the
test terminals in any way: if it does not light up, reverse the test leads. The LED will now light
up. The anode of the LED is that which is connected to the “A” terminal (positive pole of the
battery). This method is safe, as reverse voltage can never exceed 3 volts in this test.
3.2.11 Transformers
PRINCIPLE OF THE TRANSFORMER:- Two coils are wound over a Core such
that they are magnetically coupled. The two coils are known as the primary and secondary
windings.
In a Transformer, an iron core is used. The coupling between the coils is source of making a
path for the magnetic flux to link both the coils. A core as in fig.2 is used and the coils are
wound on the limbs of the core. Because of high permeability of iron, the flux path for the
flux is only in the iron and hence the flux links both windings. Hence there is very little
‘leakage flux’. This term leakage flux denotes the part of the flux, which does not link both
the coils, i.e., when coupling is not perfect. In the high frequency transformers, ferrite core is
used. The transformers may be step-up, step-down, frequency matching, sound output,
amplifier driver etc. The basic principles of all the transformers are same.
Due to its relative simplicity and low hardware overhead (when compared to parallel interfacing),
serial communications is used extensively within the electronics industry. Today, the most
popular serial communications standard is certainly the EIA/TIA-232-E specification. This
standard, which was developed by the Electronic Industry Association and the
Telecommunications Industry Association (EIA/TIA), is more popularly called simply RS-232,
where RS stands for "recommended standard." Although this RS prefix has been replaced in
recent years with EIA/TIA to help identify the source of the standard, this paper uses the common
RS232 notation.
3.2.12.1Introduction
The official name of the EIA/TIA-232-E standard is "Interface Between Data Terminal
Equipment and Data Circuit-Termination Equipment Employing Serial Binary Data Interchange."
Although the name may sound intimidating, the standard is simply concerned with serial data
communication between a host system (Data Terminal Equipment, or DTE) and peripheral
system. The EIA/TIA-232-E standard was introduced in 1962 and has since been updated four
times to meet the evolving needs of serial communication applications. The letter "E" in the
standard's name indicates that this is the fifth revision of the standard.
3.2.12.2RS-232 Specifications
RS-232 is a complete standard. This means that the standard sets out to ensure compatibility
between the host and peripheral systems by specifying:
Unlike many standards which simply specify the electrical characteristics of a given interface,
RS-232 specifies electrical, functional, and mechanical characteristics to meet the above three
criteria. Each of these aspects of the RS-232 standard is discussed below.
The RS-232 standard also limits the maximum slew rate at the driver output. This
limitation was included to help reduce the likelihood of crosstalk between adjacent signals.
The slower the rise and fall time, the less chance of crosstalk. With this in mind, the
maximum slew rate allowed is 30V/ms. Additionally, standard defines a maximum data rate
of 20kbps, again to reduce the chance of crosstalk. The impedance of the interface between
the driver and receiver has also been defined. The load seen by the driver is specified at
3kΩ to 7kΩ. In the original RS-232 standard the cable length between the driver and
receiver was specified to be 15 meters maximum. Revision "D" (EIA/TIA-232-D) changed
this part of the standard. Instead of specifying the maximum length of cable, the standard
specified a maximum capacitive load of 2500pF, clearly a more adequate specification. The
maximum cable length is determined by the capacitance per unit length of the cable, which
is provided in the cable specifications.
3.2.12.4Functional Characteristics
Because RS-232 is a complete standard, it includes more than just specifications on electrical
characteristics. The standard also addresses the functional characteristics of the interface, #2 on
our list above. This essentially means that RS-232 defines the function of the different signals
used in the interface. These signals are divided into four different categories: common, data,
control, and timing. See Table 2. The standard provides abundant control signals and supports a
primary and secondary communications channel. Fortunately few applications, if any, require all
these defined signals. For example, only eight signals are used for a typical modem. Examples of
how the RS-232 standard is used in real-world applications are discussed later. The complete list
of defined signals is included here as a reference. Reviewing the functionality of all these signals
is, however, beyond the scope of this paper.
The original MAX232 Driver/Receiver and its related parts simply doubled and inverted the input
voltage to supply the RS-232 driver circuitry. This design enabled much more voltage than
actually required; it wasted power. The EIA-232 levels are defined as ±5V into 5kΩ. With a new
low-dropout output stage, Maxim introduced RS-232 transceivers with internal charge pumps
that provided regulated ±5.5V outputs. This design allows the transmitter outputs to maintain RS-
232-compatible levels with a minimum amount of supply current.
Low-Voltage Operation
The reduced output voltages of the new regulated charge pumps and low-dropout transmitters
allow use of reduced supply voltages. Most of Maxim's recent RS-232 transceivers operate with
supply voltages down to +3.0V.
Auto Shutdown
In the never-ending battle to extend battery life, Maxim pioneered a technique called auto-
shutdown. When the device is not detecting valid RS-232 activity, it enters a low-power
shutdown mode. An RS-232-valid output indicates to the system processor whether an active RS-
232 port is connected at the other end of the cable. The MAX3212 goes one step further: it
includes a transition-detect circuit whose latched output, applied as an interrupt, can awaken the
system when a change of state occurs on any incoming line.
Building on the success of Auto Shutdown, devices with Maxim's Auto Shutdown Plus capability
achieve a 1µA supply current. These devices automatically enter a low-power shutdown mode
either when the RS-232 cable is disconnected or the transmitters of the connected peripherals are
inactive, or when the UART driving the transmitter inputs is inactive for more than 30 seconds.
The devices turn on again when they sense a valid transition at any transmitter or receiver input.
Auto Shutdown Plus saves power without changes to the existing BIOS or operating system.
Mega Baud
Moving beyond the EIA-232 specification is mega baud mode, which allows the driver slew rate
to increase, thereby providing data rates up to 1Mbps. Mega Baud mode is useful for
communication between high-speed peripherals such DSL or ISDN modems over short distances.
High ESD
Some ICs are designed to provide high ESD protection. These ICs specify and achieve ±15kV
ESD protection using both the human body model and the IEC 801-2 air-gap discharge method.
Maxim's high-ESD protection eliminates the need for costly external protection devices such as
Transzorbs, while preventing expensive field failures.
Capacitor Selection
The charge pumps of Maxim RS-232 transceivers rely on capacitors to convert and store energy,
so choosing these capacitors affects the circuit's overall performance. Although some data sheets
indicate polarized capacitors in their typical application circuits, this information is shown only
for a customer who wants to use polarized capacitors. In practice, ceramic capacitors work best
for most Maxim RS-232 ICs. Choosing the ceramic capacitor is also important. Capacitor
dielectric types of Z5U and Y5V are unacceptable because of their incredible voltage and
temperature coefficients. Types X5R and X7R provide the necessary performance.
Unused Inputs
RS-232 receiver inputs contain an internal 5kΩ pull-down resistor. If this receiver input is
unused, it can be left floating without causing any problems. The CMOS transmitter inputs are
high-impedance and must be driven to valid logic levels for proper IC operation. If a transmitter
input is unused, connect it to VCC or GND.
Layout Guidelines
Maxim RS-232 ICs should be treated like DC-DC converters for layout purposes. The AC current
flow must be analyzed for both the charge and discharge stages of the charge-pump cycle. To
facilitate an easy and effective layout, Maxim conveniently places all the critical pins in close
proximity to their external components.
Low-power RS-232 transceivers are available in space-saving chip-scale (UCSP), TQFN, and
TSSOP packages. The MAX3243E in a 32-pin (7mm x 7mm) thin QFN package saves 20%
board space over TSSOP solutions. The MAX3222E, also available in a 20-pin (5mm x 5mm)
TQFN, improves and thus saves board space by 40%. Other transceiver part families packaged in
a TQFN, the MAX3222E and MAX3232E with two drivers and two receivers and the
MAX3221E with a single driver and single receiver, feature Auto Shutdown capability to reduce
the supply current to 1µA (See Table 3). These RS-232 transceivers are ideal for battery-
powered equipment.
The MAX3228E/MAX3229E family in a 30-bump (3mm x 2.5mm) UCSP package saves about
70% board space, making these ICs ideal for space-constrained applications such as notebook,
cell phone, and handheld equipment. Low-power RS-232 transceivers in space-saving UCSP with
a low 1µA shutdown supply current are ideal for ultra-low-power system applications.
Most systems designed today do not operate using RS-232 voltage levels. Consequently, level
conversion is necessary to implement RS-232 communication. Level conversion is performed by
special RS-232 ICs with both line drivers that generate the voltage levels required by RS-232,
and line receivers that can receive RS-232 voltage levels without being damaged. These line
drivers and receivers typically invert the signal as well, since logic 1 is represented by a low
voltage level for RS-232 communication, and logic 0 is represented by a high logic level.
Figure 3 illustrates the function of an RS-232 line driver/receiver in a typical modem application.
In this example, the signals necessary for serial communication are generated and received by the
Universal Asynchronous Receiver/Transmitter (UART). The RS-232 line driver/receiver IC
performs the level translation necessary between the CMOS/TTL and RS-232 interface.
Figure 3. Typical RS-232 modem application.
The UART performs the "overhead" tasks necessary for asynchronous serial communication.
Asynchronous communication usually requires, for example, that the host system initiate start
and stop bits to indicate to the peripheral system when communication will start and stop. Parity
bits are also often employed to ensure that the data sent has not been corrupted. The UART
usually generates the start, stop, and parity bits when transmitting data, and can detect
communication errors upon receiving data. The UART also functions as the intermediary
between byte-wide (parallel) and bit-wide (serial) communication; it converts a byte of data into
a serial bit stream for transmitting and converts a serial bit stream into a byte of data when
receiving.
Now that an elementary explanation of the TTL/CMOS to RS-232 interface has been provided,
we can consider some real-world RS-232 applications. It has already been noted in the Functional
Characteristics section above that RS-232 applications rarely follow the RS-232 standard
precisely. The unnecessary RS-232 signals are usually omitted. Many applications, such as a
modem, require only nine signals (two data signals, six control signals, and ground). Other
applications require only five signals (two for data, two for handshaking, and ground), while
others require only data signals with no handshake control. We begin our investigation of real-
world implementations by considering the typical modem application.
Modem applications are one of the most popular uses for the RS-232 standard. Figure 4
illustrates a typical modem application. As can be seen in the diagram, the PC is the DTE and the
modem is the DCE. Communication between each PC and its associated modem is accomplished
using the RS-232 standard. Communication between the two modems is accomplished through
telecommunication. It should be noted that, although a microcontroller is usually the DTE in RS-
232 applications, this is not mandated by a strict interpretation of the standard.
Although some designers choose to use a 25-pin connector for this application, it is not necessary
as there are only nine interface signals (including ground) between the DTE and DCE. With this
in mind, many designers use 9- or 15-pin connectors. (Figure 2 above shows a 9-pin connector
design.) The "basic nine" signals used in modem communication are illustrated in Figure 3
above; three RS-232 drivers and five receivers are necessary for the DTE. The functionality of
these signals is described below. Note that for the following signal descriptions, ON refers to a
high RS-232 voltage level (+5V to +15V), and OFF refers to a low RS-232 voltage level (-5V to
-15V). Keep in mind that a high RS-232 voltage level actually represents a logic 0, and that a low
RS-232 voltage level refers to a logic 1.
Although the modem application discussed above is simplified from the RS-232 standard because
of the number of signals needed, it is still more complex than many system requirements. For
many applications, only two data lines and two handshake control lines are necessary to establish
and control communication between a host system and a peripheral system. For e.g., an
environmental control system may need to interface with a thermostat using a half-duplex
communication scheme. At times the control systems read the temperature from the thermostat
and at other times they load temperature trip points to the thermostat. In this type of simple
application, only five signals could be needed (two for data, two for handshake control, and
ground.
In the more than four decades since the RS-232 standard was introduced, the electronics industry
has changed immensely. There are, therefore, some limitations in the RS-232 standard. One
limitation—the fact that over twenty signals have been defined by the standard—has already been
addressed. Designers simply do not use all the signals or the 25-pin connector.
As explained in the Electrical Characteristics section, RS-232 does not use the conventional 0
and 5V levels implemented in TTL and CMOS designs. Drivers have to supply +5V to +15V for
logic 0 and -5V to -15V for logic 1. This means that extra power supplies are needed to drive the
RS-232 voltage levels. Typically, a +12V and a -12V power supply are used to drive the RS-232
outputs. This is a great inconvenience for systems that have no other requirements for these
power supplies. With this in mind, RS-232 products manufactured by Dallas Semiconductor have
on-chip charge-pump circuits that generate the necessary voltage levels for RS-232
communication. The first charge pump essentially doubles the standard +5V power supply to
provide the voltage level necessary for driving logic 0. A second charge pump inverts this voltage
and provides the voltage level necessary for driving logic 1. These two charge pumps allow the
RS-232 interface products to operate from a single +5V supply.
Another limitation in the RS-232 standard is the maximum data rate. The standard defines a
maximum data rate of 20kbps, which is unnecessarily slow for many of today's applications. RS-
232 products manufactured by Dallas Semiconductor guarantee up to 250kbps and typically can
communicate up to 350kbps. While providing a communication rate at this frequency, the devices
still maintain a maximum 30V/ms maximum slew rate to reduce the likelihood of crosstalk
between adjacent signals.
As we have seen, the cable-length specification once included in the RS-232 standard has been
replaced by a maximum load-capacitance specification of 2500pF. To determine the total length
of cable allowed, one must determine the total line capacitance.
Figure 6 shows a simple approximation for the total line capacitance of a conductor. As can be
seen, the total capacitance is approximated by the sum of the mutual capacitance between the
signal conductors and the conductor to shield capacitance (or stray capacitance in the case of
unshielded cable).
As an example, assume that the user decided to use no shielded cable when interconnecting the
equipment. The mutual capacitance (Cm) of the cable is found in the cable's specifications to be
20pF per foot. Assuming that the receiver's input capacitance is 20pF, this leaves the user with
2480pF for the interconnecting cable. From the equation in Figure 6, the total capacitance per
foot is 30pF. Dividing 2480pF by 30pF reveals that the maximum cable length is approximately
80 feet. If a longer cable length is required, the user must find a cable with a smaller mutual
capacitance.
Figure 6. Interface cable-capacitive model, per unit length.
Keil Micro Vision is an integrated development environment used to create software to be run
on embedded systems (like a microcontroller). It allows for such software to be written either
in assembly or C programming languages and for that software to be simulated on a computer
before being loaded onto the microcontroller.
μVision3 is an IDE (Integrated Development Environment) that helps write, compile, and
debug embedded programs. It encapsulates the following components:
• A project manager.
• A make facility.
• A Tool configuration.
• An Editor.
• A powerful debugger.
“Project”=>”New Project” from the pull–down menus. In the file dialog that appears, choose
a name and base directory for the project. It is recommended that a new directory be created
for each project, as several files will be generated. Once the project has been named, the
dialog shown in the figure below will appear, prompting the user to select a target device. In
this lab, the chip being used is the “AT89S52,” which is listed under the heading “Atmel”
.
Fig-Window for choosing the target device
Next, Micro Vision must be instructed to generate a HEX file upon program compilation. A
HEX file is a standard file format for storing executable code that is to be loaded onto the
microcontroller.
In the “Project Workspace” pane at the left, right–click on “Target 1” and select “Options for
‘Target 1’ ”.Under the “Output” tab of the resulting options dialog, ensure that both the
“Create Executable” and “Create HEX File” options are checked. Then click “OK”
As shown in the two figures below.
Fig- Project workspace pane Fig-Project Options Dialog
Next, a file must be added to the project that will contain the project code. To do this, expand
the “Target 1” heading, right–click on the “Source Group 1” folder, and select “Add files…”
Create a new blank file (the file name should end in “.asm”), select it, and click “Add.” The
new file should now appear in the “Project Workspace” pane under the “Source Group 1”
folder. Double-click on the newly created file to open it in the editor. All code for this lab will
go in this file. To compile the program, first save all source files by clicking on the “Save All”
button, and then click on the “Rebuild All Target Files” to compile the program as shown in
the figure below. If any errors or warnings occur during compilation, they will be displayed in
the output window at the bottom of the screen. All errors and warnings will reference the line
and column number in which they occur along with a description of the problem so that they
can be easily located. Note that only errors indicate that the compilation failed, warnings do
not (though it is generally a good idea to look into them anyway).
Fig. “Save All” and “Build All Target Files” Buttons
When the program has been successfully compiled, it can be simulated using the integrated
debugger in Keil Micro Vision. To start the debugger, select “Debug”=>”Start/Stop Debug
Session” from the pull–down menus.
At the left side of the debugger window, a table is displayed containing several key
parameters about the simulated microcontroller, most notably the elapsed time (circled in the
figure below). Just above that, there are several buttons that control code execution. The
“Run” button will cause the program to run continuously until a breakpoint is reached,
whereas the “Step Into” button will execute the next line of code and then pause (the current
position in the program is indicated by a yellow arrow to the left of the code).
Fig. μVision3 Debugger window
Breakpoints can be set by double–clicking on the grey bar on the left edge of the window
containing the program code. A breakpoint is indicated by a red box next to the line of code.
The current state of the pins on each I/O port on the simulated microcontroller can also be
displayed. To view the state of a port, select “Peripherals”=>”I/O Ports”=>”Port n” from the
pull–down menus, where n is the port number. A checked box in the port window indicates a
high (1) pin, and an empty box indicates a low (0) pin. Both the I/O port data and the data at
the left side of the screen are updated whenever the program is paused.
The debugger will help eliminate many programming errors, however the simulation is not
perfect and code that executes properly in simulation may not always work on the actual
microcontroller.
3.3.1.3DEVICE DATABASE
A unique feature of the Keil μVision3 IDE is the Device Database, which contains
information about more than 400 supported microcontrollers. When you create a new
μVision3 project and select the target chip from the database, μVision3 sets all assembler,
compiler, linker, and debugger options for you. The only option you must configure is the
memory map.
3.3.1.4PERIPHERAL SIMULATION
The μVision3 Debugger provides complete simulation for the CPU and on-chip peripherals of
most embedded devices. To discover which peripherals of a device are supported, in μVision3
select the Simulated Peripherals item from the Help menu. You may also use the web-based
Device Database. We are constantly adding new devices and simulation support for on-chip
peripherals so be sure to check Device Database often.
3.3.2PROGRAMMER
The programmer used is a powerful programmer for the Atmel 89 series of microcontrollers
that includes 89C51/52/55, 89S51/52/55 and many more.
It is simple to use & low cost, yet powerful flash microcontroller programmer for the Atmel
89 series. It will Program, Read and Verify Code Data, Write Lock Bits, Erase and Blank
The debugger will help eliminate many programming errors, however the simulation is not
perfect and code that executes properly in simulation may not always work on the actual
microcontroller.
3.3.1.3DEVICE DATABASE
A unique feature of the Keil μVision3 IDE is the Device Database, which contains
information about more than 400 supported microcontrollers. When you create a new
μVision3 project and select the target chip from the database, μVision3 sets all assembler,
compiler, linker, and debugger options for you. The only option you must configure is the
memory map.
3.3.1.4PERIPHERAL SIMULATION
The μVision3 Debugger provides complete simulation for the CPU and on-chip peripherals of
most embedded devices. To discover which peripherals of a device are supported, in μVision3
select the Simulated Peripherals item from the Help menu. You may also use the web-based
Device Database. We are constantly adding new devices and simulation support for on-chip
peripherals so be sure to check Device Database often.
3.3.2PROGRAMMER
The programmer used is a powerful programmer for the Atmel 89 series of microcontrollers
that includes 89C51/52/55, 89S51/52/55 and many more.
It is simple to use & low cost, yet powerful flash microcontroller programmer for the Atmel
89 series. It will Program, Read and Verify Code Data, Write Lock Bits, Erase and Blank
Check. All fuse and lock bits are programmable. This programmer has intelligent onboard
firmware and connects to the serial port. It can be used with any type of computer and
requires no special hardware. All that is needed is a serial communication port which all
computers have.
All devices also have a number of lock bits to provide various levels of software and
programming protection. These lock bits are fully programmable using this programmer.
Locks bits are useful to protect the program to be read back from microcontroller only
allowing erase to reprogram the microcontroller.
Major parts of this programmer are Serial Port, Power Supply and Firmware microcontroller.
Serial data is sent and received from 9 pin connector and converted to/from TTL logic/RS232
signal levels by MAX232 chip. A Male to Female serial port cable, connects to the 9 pin
connector of hardware and another side connects to back of computer.
All the programming ‘intelligence’ is built into the programmer so you do not need any
special hardware to run it. Programmer comes with window based software for easy
programming of the devices.
The way of this concept function is when a user speaks out some command, then the voice is
captured through microphone as the input devices.
Once the voice is captured, the usage of a decoding system that will convert the analog
(voice) to digital (binary signal).
Later, the input voice is compared with the data stored in the memory early before the testing.
The output of the comparison is the voice matched with any of the command trained and
certain signal is produce as the input for the controlling system.
In this project whenever we want to control the machine from our voice then first of we
enable the button of voice control. As we speaks through the mike on/off then the control
panel works as per condition.
Whenever we want to control the machine computer then first of we enable the button of pc
control. As we enable the button then with the help mouse we on /off the control panel as per
our requirement. Once we enable the button then Red indicator is lit on the screen then
computer send a code to the microcontroller via RS 232 com port. Data is transfer via serial
port on the baud rate of 9600 bps. Data transfer in the 8 bit package. Data receive by the
controller receive pin via Max 232 IC. IC max232 is RS232 to TTL converter IC. As the code
is receive by the controller inside and then switch on/off the electrical appliances in. When the
output is on then connected L.E.D. is on and when the output is off then connected L.E.D is
off.
For this project we transfer the data from computer in the form of serial communication.
When we want to control the appliances through Wireless remote then first of all we enable
the remote option. In the project we use RC5 TV remote. There is lot of remote are available,
but in this project we use RC5 base remote fro switching. For Any remote control device we
must know the protocol of infra red transmission. In the infra red transmission we send the
different codes on modulated frequency. Each time when we press any switch from the
remote then one modulated signal is transfer to the receiver circuit. On the receiver end we
receive this code with the help of infra red receiver eye. Receiver eye receive the code then
demodulated the frequency. Code from the eye is further connected to then microcontroller
for further process. Microcontroller receives the code and after processing Toggle the
electrical switch regular rally.
In our project we use MICROSOFT VISUAL BASIC to run appliance controller.
Chapter 4
Working Description
4.1.1 INTRODUCTION—
Making a Printed Circuit Board is the first step towards building electronic equipment by any
electronic industry. A number of methods are available for making P.C.B., the simplest
method is of drawing pattern on a copper clad board with acid resistant (etchants) ink or paint
or simple nail polish on a copper clad board and do the etching process for dissolving the rest
of copper pattern in acid liquid.
• Plastic Tray
4.1.3 PROCEDURE
The first and foremost in the process is to clean all dirt from copper sheet with say spirit or
trichloro ethylene to remove traces grease or oil etc. and then wash the board under running
tap water. Dry the surface with forced warm air or just leave the board to dry naturally for
some time.
Making of the P.C.B. drawing involves some preliminary consideration such as thickness of
lines/ holes according to the components. Now draw the sketch of P.C.B. design (tracks, rows,
square) as per circuit diagram with the help of nail polish or enamel paint or any other acid
resistant liquid. Dry the point surface in open air, when it is completely dried, the marked
holes in P.C.B. may be drilled using 1Mm drill bits. In case there is any shorting of lines due
to spilling of paint, these may be removed by scraping with a blade or a knife, after the paint
has dried.
After drying, 22-30 grams of ferric chloride in 75 ml of water may be heated to about 60
degree and poured over the P.C.B. , placed with its copper side upwards in a plastic tray of
about 15*20 cm. Stirring the solution helps speedy etching. The dissolution of unwanted
copper would take about 45 minutes. If etching takes longer, the solution may be heated again
and the process repeated. The paint on the pattern can be removed P.C.B. may then be washed
and dried. Put a coat of varnish to retain the shine. Your P.C.B. is ready.
4.1.4 REACTION
Fecl3 + Cu ----- CuCl3 + Fe
4.1.5 PRECAUTION
1. Add Ferric Chloride (Fecl3) carefully, without any splashing. Fecl3 is irritating to the
• Removing the copper in places which are not needed, by the process of etching
(chemical process)
Building project in the proper manner is really an art, something which must be précised and
learned through trial and error, it is not all that difficult. The main thing is to remember to
take each step slowly and carefully according to the instructions giving making since that
everything at it should be before proceeding further.
4.2.1 TOOLS: The electronics workbench is an actual place of work with comfortably &
conveniently & should be supplied with compliment of those tools must often use in project
building. Probably the most important device is a soldering tool. Other tool which should be
at the electronic work bench includes a pair of needle nose pliers, diagonal wire cutter, a small
knife, an assortment of screw driver, nut driver, few nuts & bolts, electrical tape, pucker etc.
Diagonal wire cutter will be used to cut away any excess lead length from copper side of
P.C.B. 7 to cut section of the board after the circuit is complete. The needle nose pliers are
most often using to bend wire leads & wrap them in order to form a strong mechanical
connection.
2. SOLDER: The raw material used for soldering is solder. It is composition of lead &
tin. The good quality solder (a type of flexible naked wire) is 60% Tin +40% Lead
which will melt between 180 degree to 200 degree C temperature.
3. LUXES OR SOLDERING PASTE: When the points to solder are heated, an oxide
film forms. This must be removed at once so that solder may get to the surface of the
metal parts. This is done by applying chemical substance called Flux, which boils
under the heat of the iron remove the oxide formation and enable the metal to receive
the solder.
1. Use right type of soldering iron. A small efficient soldering iron (about 10-25 watts with
1/8 or 1/4 inch tip) is ideal for this work.
2. Keep the hot tip of the soldering iron on a piece of metal so that excess heat is dissipated.
3. Make sure that connection to the soldered is clean. Wax frayed insulation and other
substances cause poor soldering connection. Clean the leads, wires, tags etc. before
soldering.
4. Use just enough solder to cover the lead to be soldered. Excess solder can cause a short
circuit.
5. Use sufficient heat. This is the essence of good soldering. Apply enough heat to the
component lead. You are not using enough heat, if the solder barely melts and forms a
round ball of rough flaky solder. A good solder joint will look smooth, shining and spread
type. The difference between good & bad soldering is just a few seconds extra with a hot
iron applied firmly.
4.2.6 PRECAUTIONS
1. Mount the components at the appropriate places before soldering. Follow the circuit
description and components details, leads identification etc. Do not start soldering before
making it confirm that all the components are mounted at the right place.
2. Do not use a spread solder on the board, it may cause short circuit.
3. Do not sit under the fan while soldering.
4. Position the board so that gravity tends to keep the solder where you want it.
5. Do not over heat the components at the board. Excess heat may damage the components
or board.
6. The board should not vibrate while soldering otherwise you have a dry or a cold joint.
7. Do not put the kit under or over voltage source. Be sure about the voltage either dc or ac
while operating the gadget.
8. Do spare the bare ends of the components leads otherwise it may short circuit with the
other components. To prevent this use sleeves at the component leads or use sleeved
wire for connections.
9. Do not use old dark color solder. It may give dry joint. Be sure that all the joints are
clean and well shiny.
10. Do make loose wire connections especially with cell holder, speaker, probes etc. Put
knots while connections to the circuit board, otherwise it may get loose.
CHAPTER 5
RESULT AND DISCUSSION
This project discussed the development of the voice recognition home automation system
which can be used to replace the old and conventional way to switch on the power of an
electrical device. This system consists of a voice recognition circuit, a microcontroller circuit
and a set of relay.
The voice recognition home automation system has been successfully developed and through
this project we have gained much experience especially in the field of applying the technique
of troubleshooting an electrical circuit and also in programming the microcontroller. This
project is a very simple project compare to any of those who are already in the industry and
commercialized but yet we hope that this project can be research on further to create a better
design that can be applied to a larger scale of controlling.
Besides that, we also hope that this project can be jumping stone for the application as one of
the smart home necessity. Besides the achieving of the main objective, by using this system, it
can help reduce any occurrence of getting shock due to the failure of the switch and it offer a
more safety way to turn on the switch. Moreover if this system is fully equipped in a house it
can reduce the addition of the wall switch and what left is only the plug point for user to plug
in their devices only.
5.3 APPENDICS
// This is declaration of variable used
char *someText1;
char *someText2;
char *someText3;
int state;
int plug1;
int plug2;
int plug3;
// module connections
char D_DataPort at PORTH;
sbit D_CS1 at LATJ0_bit;
sbit D_CS2 at LATJ1_bit;
sbit D_RS at LATJ2_bit;
sbit D_RW at LATJ3_bit;
sbit D_EN at LATJ4_bit;
sbit D_RST at LATJ5_bit; sbit GLCD_CS1_Direction at TRISJ0_bit;
sbit D_CS2_Direction at TRISJ1_bit;
sbit D_RS_Direction at TRISJ2_bit;
sbit D_RW_Direction at TRISJ3_bit;
sbit D_EN_Direction at TRISJ4_bit;
sbit D_RST_Direction at TRISJ5_bit;
// End module connections
void delay1S(){
// 0.5 seconds delay function
Delay_ms(500);
}
void delay2S(){
// 2.0 seconds delay function
Delay_ms(2000);
}
void main() {
ADCON1|=0x0F;
CMCON |= 7;
TRISD = 0xff; // port D as input
TRISA = 0x1f; // port A as analog input
TRISE = 0x00; // port E as output
PORTE = d_Init(); // Initialize
d_Fill(0xFF);
// Setting the Font
d_Set_Font(Character8x7, 8, 7, 32);
d_Write_Text("Welcome ", 67, 1, 2);
d_Write_Text("to", 90, 2, 2);
d_Write_Text("VRHAS", 75, 3, 2);
delay2S();
d_Fill(0xFF); // Clear GLCD
someText1="off"; // Initialize the display
someText2="off"; // Initialize the display
someText3="off"; // Initialize the display
while(1){
d_Write_Text("VRHAS", 75, 1, 2);
delay1S();
d_Write_Text("S1", 70, 2, 2);
d_Write_Text(someText1, 95, 2, 2);
d_Write_Text("S2", 70, 3, 2);
d_Write_Text(someText2, 95, 3, 2);
d_Write_Text("S3", 70, 4, 2);
d_Write_Text(someText3, 95, 4, 2);
delay1S();
// Distance sensor input
while (PORTA.F1==0) {}
// user input command
if (PORTD==0X01) state=1;
else if (PORTD==0X02) state=2;
else if (PORTD==0X03) state=3;
else if (PORTD==0x04) state=4;
else if (PORTD==0x05) state=5;
else if (PORTD==0x06) state=6;
else if (PORTD==0x07) state=7;
else if (PORTD==0x08) state=8;
switch (state) {
case 0:
break;
case 1:plug1= 1; // setting output
someText1= "on"; //update display
break;
case 2:plug1= 0; // setting output
someText1= "Off"; //update display
break;
case 3:plug2=1; // setting output
someText2= "On"; //update display
break;
case 4:plug2=0; // setting output
someText2= "Off"; //update display
35
break;
case 5:plug3=1; // setting output
someText3= "On";
break;
case 6:plug3=0; // setting output
someText3= "Off"; //update display
break;
case 7:plug1=0; // setting output
plug2=0; // setting output
plug3=0; // setting output
someText1= "Off"; //update display
someText2= "Off"; //update display
someText3= "Off"; //update display
break;
case 8:plug1=1; // setting output
plug2=1; // setting output
plug3=1; // setting output
someText1= "on"; //update display
someText2= "On"; //update display
someText3= "On"; //update display
break;
default:
break;
}
LATE.F1=plug1; // Actual output
LATE.F3=plug2; // Actual output
LATE.F5=plug3; // Actual output
}
}33
5.4 REFERENCES