Вы находитесь на странице: 1из 46

CHAPTER 1

INTRODUCTION

1.1 Introduction:
Home Automation Project Using Embedded System discuss about a profitable and powerful
solution for preserving electrical energy by optimizing electrical appliances such as lights, fans, tube
lights etc., It depends upon occupants in the house or hall with the help of embedded system like
PIC microcontroller. Home Automation Project Using Embedded System using PIC Microcontroller-
Part2 provides an intelligent Energy preserving system for home, schools, malls, rooms, conference
halls etc. This Home Automation Project Using Embedded System saves energy by a profitable
energy management of rooms or hall which utilizes certain predominant mechanisms managed by an
embedded system - PIC microcontroller. Normally all of us always forget to switch OFF the fan and
light in a room, when we leave that room. As a result lots of energy will be wasted and thus make too
much higher electricity bills. Home Automation Project Using Embedded System is a recommended
one in these conditions. By installing this project in your house, office or anywhere else, you can save
energy and can reduce the electricity bill. In this project, if there is no one in the room or house, then
the fan and light will be in switched OFF condition and when any person infiltrates the room, the fan
and light will be switched ON. But the point should be noted that, the fan will be switched ON
according to the room temperature. Similarly, the light also gets switched ON corresponding to the
light intensity level of the room.

The purpose of this project is to design a smart blind stick with home automation which can
provide guidelines to the blind/deaf and dumb peoples. This blind stick have the capability to detect
any kind of obstacles using IR sensor.

This device automatically senses the presence of obstacles in its path and helps blind people
in deviate their direction of movement through vibrator and buzzer alarm. The obstacle detection
mechanism is done by an Obstacle sensor to find the presence of an obstacle in its path.

This consists of a Microcontroller based control system, RF module for transmitter and receiver,
Buzzer, IR Sensor. This device senses the obstacles in its path by continuously transmitting the IR
rays from IR transmitter. If any obstacle comes in its vicinity then the rays are destructed and give this
input to the microcontroller. The IR receiver fitted on the device senses these Obstacles and this
information is passed onto the Microcontroller.

1
CHAPTER 2
HARDWARE DESCRIPTION

2.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: 2.1:

FIG 2.1: Block diagram of transmitter section of BLIND STICK WITH HOME AUTOMATION

The main blocks of this project are:


1. Regulated Power Supply.
2. Microcontroller.
3. IR SENSOR
4. Buzzer
5. Keypad
6. Rf rx tx
7. Relay

2
2.2 Micro controller

Fig: 2.2 Microcontroller

Introduction

The PIC16F72 CMOS FLASH-based 8-bit microcontroller is upward compatible with


PIC16C72/72A and PIC16F872devices. It features 200 ns instruction execution, self programming, an
ICD, 2 Comparators, 5 channels of 8-bit Analog-to-Digital (A/D) converter, 2 capture/compare/PWM
functions, a synchronous serial port that can be configured as either 3-wire SPI or 2-wire I2C bus, a
USART, and a Parallel Slave Port.

High-Performance RISC CPU

• High performance RISC CPU

• Only 35 single word instructions to learn

• All single cycle instructions except for program branches which are two-cycle

• Operating speed: DC - 20 MHz clock input DC - 200 ns instruction cycle

• 2K x 14 words of Program Memory

128 x 8 bytes of Data Memory (RAM)

• Pin out compatible to the PIC16C72/72A and PIC16F872

• Interrupt capability

• Eight level deep hardware stack

• Direct, Indirect and Relative Addressing modes

Peripheral Features

• Timer0: 8-bit timer/counter with 8-bit prescaler

3
• Timer1: 16-bit timer/counter with prescaler, can be incremented during SLEEP via external
crystal/clock

• Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler

• Capture, Compare, PWM (CCP) module

- Capture is 16-bit, max resolution is 12.5 ns

- Compare is 16-bit, max resolution is 200 ns

- PWM max resolution is 10-bit

• 8-bit, 5-channel Analog-to-Digital converter

• Synchronous Serial Port (SSP) with SPI (Master mode) and I2C (Slave)

• Heat sink/Source Current:25 mA

• Brown-out detection circuitry for Brown-out Reset (BOR)

CMOS Technology:

• Low power, high speed CMOS FLASH technology

• Fully static design

• Wide operating voltage range: 2.0V to 5.5V

• Industrial temperature range

• Low power consumption:

- < 0.6 mA typical @ 3V, 4 MHz

- 20 μA typical @ 3V, 32 kHz

- < 1 μA typical standby current

Following are the major blocks of PIC Microcontroller.

Program memory (FLASH) is used for storing a written program.Since memory made in FLASH echn
ology can be programmed and cleared more than once, it makes this microcontroller suitable for devic
development.
EEPROM - data memory that needs to be saved when there is no supply. It is usually used for storing
important data that must not be lost if power supply suddenly stops. For instance, one such data is an
assigned temperature in temperature regulators. If during a loss of power supply this data was lost, we

4
would have to make the adjustment once again upon return of supply. Thus our device looses on self-
reliance.

RAM - Data memory used by a program during its execution.In RAM are stored all inter-results or
temporary data during run-time. PORTS are physical connections between the microcontroller and the
outside world. PIC16F72 has 22 I/O.
FREE-RUN TIMER is an 8-bit register inside a microcontroller that works independently of the
program. On every fourth clock of the oscillator it increments its value until it reaches the maximum
(255), and then it starts counting over again from zero. As we know the exact timing between each
two increments of the timer contents, timer can be used for measuring time which is very useful with
some devices.

Pin description

PIC16F72 has a total of 28 pins. It is most frequently found in a DIP28 type of case but can
also be found in SMD case which is smaller from a DIP. DIP is an abbreviation for Dual In Package.
SMD is an abbreviation for Surface Mount Devices suggesting that holes for pins to go through when
mounting aren't necessary in soldering this type of a component.

Pins on PIC16F72 microcontroller have the following meaning:

There are 28 pins on PIC16F72. Most of them can be used as an IO pin. Others are already for
specific functions. These are the pin functions.
1. MCLR – to reset the PIC
5
2. RA0 – port A pin 0
3. RA1 – port A pin 1
4. RA2 – port A pin 2
5. RA3 – port A pin 3
6. RA4 – port A pin 4
7. RA5 – port A pin 5
8. VSS – ground
9. OSC1 – connect to oscillator
10. OSC2 – connect to oscillator
11. RC0 – port C pin 0 VDD – power supply
12. RC1 – port C pin 1
13. RC2 – port C pin 2
14. RC3 – port C pin 3
15. RC4 - port C pin 4
16. RC5 - port C pin 5
17. RC6 - port C pin 6
18. RC7 - port C pin 7
19. VSS - ground
20. VDD – power supply
21. RB0 - port B pin 0
22. RB1 - port B pin 1
23. RB2 - port B pin 2
24. RB3 - port B pin 3
25. RB4 - port B pin 4
26. RB5 - port B pin 5
27. RB6 - port B pin 6
28. RB7 - port B pin 7

By utilizing all of this pin so many application can be done such as:
1. LCD – connect to Port B pin.
2. LED – connect to any pin declared as output.
3. Relay and Motor - connect to any pin declared as output.
4. External EEPROM – connect to I2C interface pin – RC3 and RC4 (SCL and SDA)
5. LDR, Potentiometer and sensor – connect to analogue input pin such as RA0.
6. GSM modem dial up modem – connect to RC6 and RC7 – the serial communication interface using
RS232 protocol.
For more detail function for each specific pin please refer to the device datasheet from Microchip.

Memory organization

6
PIC16F72 has two separate memory blocks, one for data and the other for program. EEPROM
memory with GPR and SFR registers in RAM memory make up the data block, while FLASH
memory makes up the program block.

Program memory

Program memory has been carried out in FLASH technology which makes it possible to program a
microcontroller many times before it's installed into a device, and even after its installment if eventual
changes in program or process parameters should occur. The size of program memory is 1024
locations with 14 bits width where locations zero and four are reserved for reset and interrupt vector.

Data memory

Data memory consists of EEPROM and RAM memories. EEPROM memory consists of 256 eight bit
locations whose contents are not lost during loosing of power supply. EEPROM is not directly
addressable, but is accessed indirectly through EEADR and EEDATA registers. As EEPROM memory
usually serves for storing important parameters (for example, of a given temperature in temperature
regulators) , there is a strict procedure for writing in EEPROM which must be followed in order to
avoid accidental writing. RAM memory for data occupies space on a memory map from location
0x0C to 0x4F which comes to 68 locations. Locations of RAM memory are also called GPR registers
which is an abbreviation for General Purpose Registers. GPR registers can be accessed regardless of
which bank is selected at the moment.

2.3 REGULATED POWER SUPPLY:

Introduction:

Power supply is a supply of electrical power. A device or system that supplies electrical
or other types of energy to an output load or group of loads is called a power supply unit or PSU. The
term is most commonly applied to electrical energy supplies, less often to mechanical ones, and rarely
to others.

A power supply may include a power distribution system as well as primary or


secondary sources of energy such as

 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.
 Batteries.

 Chemical fuel cells and other forms of energy storage systems.


7
 Solar power.

 Generators or alternators.

Block Diagram:

Fig 2.3.1 Regulated Power Supply

The basic circuit diagram of a regulated power supply (DC O/P) with led connected as
load is shown in fig: 2.3.3.

Fig 2.3.2 Circuit diagram of Regulated Power Supply with Led connection

8
The components mainly used in above figure are

 230V AC MAINS
 TRANSFORMER
 BRIDGE RECTIFIER(DIODES)
 CAPACITOR
 VOLTAGE REGULATOR(IC 7805)
 RESISTOR
 LED(LIGHT EMITTING DIODE)
The detailed explanation of each and every component mentioned above is as follows:

Step 1: Transformation: The process of transforming energy from one device to another is called
transformation. For transforming energy we use transformers.

Transformers:

A transformer is a device that transfers electrical energy from one circuit to another
through inductively coupled conductors without changing its frequency. A varying current in the first
or primary winding creates a varying magnetic flux in the transformer's core, and thus a
varying magnetic field through the secondary winding. This varying magnetic field induces a
varying electromotive force (EMF) or "voltage" in the secondary winding. This effect is called mutual
induction.

If a load is connected to the secondary, an electric current will flow in the secondary
winding and electrical energy will be transferred from the primary circuit through the transformer to
the load. This field is made up from lines of force and has the same shape as a bar magnet.

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.

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: 2.3.4 shows step-down transformer.

The voltage induced in the secondary is determined by the TURNS RATIO.

9
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.

Fig 2.3.3: Step-Down Transformer

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 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.

Some transformers have an electrostatic screen between primary and secondary. This is to
prevent some types of interference being fed from the equipment down into the mains supply, or in the
other direction. Transformers are sometimes used for IMPEDANCE MATCHING.

We can use the transformers as step up or step down.

Step Up transformer:

10
In case of step up transformer, primary windings are every less compared to secondary
winding.Because of having more turns secondary winding accepts more energy, and it releases more
voltage at the output side.

Step down transformer:

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.

Battery power supply:

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

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.

Fig 2.3.4: Hi-Watt 9V Battery


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
11
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.

Step 2: Rectification

The process of converting an alternating current to a pulsating direct current is called


as rectification. For rectification purpose we use rectifiers.

Rectifiers:

A rectifier is an electrical device that converts alternating current (AC) to direct current
(DC), a process known as rectification. Rectifiers have many uses including as components of power
supplies and as detectors of radio signals. Rectifiers may be made of solid-state diodes, vacuum tube
diodes, mercury arc valves, and other components.

A device that it can perform the opposite function (converting DC to AC) is known as an inverter.

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.

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 R L
and hence the load current flows through RL.

12
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 R L 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.

DB107:Now -a -days Bridge rectifier is available in IC with a number of DB107. In our project we
are using an IC in place of bridge rectifier. The picture of DB 107 is shown in fig: 3.3.8.

Input Output

Fig 2.3.5: Bridge rectifier: a full-wave rectifier using 4 diodes

Features:

 Good for automation insertion


 Surge overload rating - 30 amperes peak

 Ideal for printed circuit board

 Reliable low cost construction utilizing molded

 Glass passivated device

 Polarity symbols molded on body

 Mounting position: Any

 Weight: 1.0 gram


13
Fig 2.3.6: DB107

Step 3: Filtration: The process of converting a pulsating direct current to a pure direct current using
filters is called as filtration.

Filters: Electronic filters are electronic circuits, which perform signal-processing functions,
specifically to remove unwanted frequency components from the signal, to enhance wanted ones.

Introduction to Capacitors: The Capacitor or sometimes referred to as a Condenser is a passive


device, and one which stores energy in the form of an electrostatic field which produces a potential
(static voltage) across its plates. In its basic form a capacitor consists of two parallel conductive plates
that are not connected but are electrically separated either by air or by an insulating material called
the Dielectric. When a voltage is applied to these plates, a current flows charging up the plates with
electrons giving one plate a positive charge and the other plate an equal and opposite negative charge.
This flow of electrons to the plates is known as the Charging Current and continues to flow until the
voltage across the plates (and hence the capacitor) is equal to the applied voltage Vcc. At this point
the capacitor is said to be fully charged and this is illustrated below. The construction of capacitor and
an electrolytic capacitor are shown in figures 3.3.9 and 3.3.10 respectively.

Fig 2.3.7:Construction Of a Capacitor Fig 2.3.8:Electrolytic Capaticor

14
Units of Capacitance:

Microfarad (μF) 1μF = 1/1,000,000 = 0.000001 = 10-6 F

Nanofarad (nF) 1nF = 1/1,000,000,000 = 0.000000001 = 10-9 F

Pico farad (pF) 1pF = 1/1,000,000,000,000 = 0.000000000001 = 10-12 F

Step 4: Regulation: The process of converting a varying voltage to a constant regulated voltage is
called as regulation. For the process of regulation we use voltage regulators.

Voltage Regulator: 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.

Fig 2.3.9: Voltage Regulator

Resistors:

A resistor is a two-terminal electronic component that produces a voltage across its terminals
that is proportional to the electric current passing through it in accordance with Ohm's law:

V = IR

15
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).

The primary characteristics of a resistor are the resistance, the tolerance, maximum working
voltage and the power rating. Other characteristics include temperature coefficient, noise, and
inductance. Less well-known is critical resistance, the value below which power dissipation limits the
maximum permitted current flow, and above which the limit is applied voltage. Critical resistance is
determined by the design, materials and dimensions of the resistor.

Resistors can be made to control the flow of current, to work as Voltage dividers, to
dissipate power and it can shape electrical waves when used in combination of other components.
Basic unit is ohms.

Theory of operation:

Ohm's law: The behavior of an ideal resistor is dictated by the relationship specified in 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:

The power dissipated by a resistor (or the equivalent resistance of a resistor network) is
calculated using the following:

16
Fig 2.3.10: Resistor Fig 2.3.11: Color Bands In Resistor

2.4 BUZZER
Basically, the sound source of a piezoelectric sound component is a piezoelectric diaphragm. A
piezoelectric diaphragm consists of a piezoelectric ceramic plate which has electrodes on both sides
and a metal plate (brass or stainless steel, etc.). A piezoelectric ceramic plate is attached to a metal
plate with adhesives. Applying D.C. voltage between electrodes of a piezoelectric diaphragm causes
mechanical distortion due to the piezoelectric effect. For a misshaped piezoelectric element, the
distortion of the piezoelectric element expands in a radial direction. And the piezoelectric diaphragm
bends toward the direction. The metal plate bonded to the piezoelectric element does not expand.
Conversely, when the piezoelectric element shrinks, the piezoelectric diaphragm bends in the direction
Thus, when AC voltage is applied across electrodes, the bending is repeated, producing sound waves
in the air.

To interface a buzzer the standard transistor interfacing circuit is used. Note that if a different
power supply is used for the buzzer, the 0V rails of each power supply must be connected to provide a
common reference.

If a battery is used as the power supply, it is worth remembering that piezo sounders
draw much less current than buzzers. Buzzers also just have one ‘tone’, whereas a
piezo sounder is able to create sounds of many different tones.

To switch on buzzer -high 1

To switch off buzzer -low 1

Notice (Handling) In Using Self Drive Method

17
1) When the piezoelectric buzzer is set to produce intermittent sounds, sound may be heard
continuously even when the self drive circuit is turned ON / OFF at the "X" point shown in Fig. 9.
This is because of the failure of turning off the feedback voltage.

2) Build a circuit of the piezoelectric sounder exactly as per the recommended circuit shown in the
catalog. Hfe of the transistor and circuit constants are designed to ensure stable oscillation of the
piezoelectric sounder.

3) Design switching which ensures direct power switching.

4) The self drive circuit is already contained in the piezoelectric buzzer. So there is no need to prepare
another circuit to drive the piezoelectric buzzer.

5) Rated voltage (3.0 to 20Vdc) must be maintained. Products which can operate with voltage higher
than 20Vdc are also available.

6) Do not place resistors in series with the power source, as this may cause abnormal oscillation. If a
resistor is essential to adjust sound pressure, place a capacitor (about 1μF) in parallel with the piezo
buzzer.

7) Do not close the sound emitting hole on the front side of casing.

8) Carefully install the piezo buzzer so that no obstacle is placed within 15mm from the sound release
hole on the front side of the casing.

2.4.1 Fig: Picture of buzzer

2.5: IR sensor:
IR transmitter and receiver

Basics of IR transmitter and receiver transmitter and receiver are commonly used in
engineering projects for remote control of objects. In particularly, in Robotic system uses transmitter
and receiver. Here i would like to describe the basics if IR transmitter and receiver

Basics of IR transmitter:

18
An electroluminescent IR LED is a product which requires care in use. IR LED’s are
fabricated from narrow band hetero structures with energy gap from 0.25 to 0.4 eV. Infra red
transmitter emits IR rays in planar wave front manner. Even though infra red rays spread in all
directions, it propagates along straight line in forward direction. IR rays have the characteristics of
producing secondary wavelets when it collides with any obstacles in its path. This property of IR is
used here.

When IR rays gets emitted from LED, it moves in the direction it is angled. When any obstacle
interferes in the path, the IR rays get cut and it produces secondary wavelets which propagates mostly
in return direction or in a direction opposite to that of the primary waves, which produces the net
result like reflection of IR rays.

2.5.1 IR transmitter

Basics of IR receiver:

Infrared photo receiver is a two terminal PN junction device, which operates in a reverse bias.
It has a small transparent window, which allows light to strike the PN junction. A photodiode is a type
of photo detector capable of converting light into either current or voltage, depending upon the mode
of operation. Most photodiodes will look similar to a light emitting diode. They will have two leads,
or wires, coming from the bottom .that is anode and cathod The shorter end of the two longer end is
the anode.

A photodiode consists of PN junction or PIN structure. When a photon of sufficient energy strikes the
diode, it excites an electron thereby creating a mobile electron and a positively charged electron hole.
If the absorption occurs in the junction's depletion region, or one diffusion length away from it, these

19
carriers are swept from the junction by the built-in field of the depletion region. Thus holes move
toward the anode, and electrons toward the cathode, and a photocurrent is produced.

2.5.2 IR receiver

Working of infrared communication:

Various types of infrared based applications are available in the market. The circuit for
infrared based applications is designed along with the transmitter and receiver sections i.e. we can’t
use it for other application. But the infrared communication project which we have done here can be
used in any application just by replacing the application at the place of infrared LED in the circuit
diagram of infrared communication. By using this project we can design infrared based applications
easily. The entire circuit consists of two sections named as

1. Transmitter section and


2. Receiver section

1. Transmitter section:

The transmitter section consists of a 555 timer IC functioning in astable mode. It is wired as
shown in figure. The output from astable mode is fed to an IR LED via resistor which limits its
operating current. Infrared LED in the transmitter section emits IR radiation which is focused by a
plastic lens (optics) in to a narrow beam.

2. Receiver section:

The receiver section consists of a silicon phototransistor to convert the infrared radiation to an
electric current. It responds only to the rapidly pulsing signal created by the transmitter, and filters out
20
slowly changing infrared radiation from ambient light. The receiver section comprises an infrared
receiver module, and a led indicator. When the signals are interrupted, the IR Led goes off after a few
seconds depending upon the value of RC combination.

We can increase the distance between the IR transmitter and receiver just by placing the lens
between them. After connecting the IR transmitter and receiver circuit, we can get the output by
applying 6V Power supply to the circuit. We can use this circuit with any application very simply. For
example a buzzer circuit is placed at the output of IR circuit, when the signals are interrupted, the
buzzer produces sound. Both the transmitter and receiver parts can be mounted on a single bread
board or PCB. The infrared receiver must be placed behind the IR Led to avoid false indication due to
infrared leakage. An object moving nearby actually reflects the IR rays emitted by the IR Led.

Photo Diodes:

A photodiode is a semiconductor diode that functions as a photo detector. Photodiodes are


packaged with either a window or optical fiber connection, to let in the light to the sensitive part of the
device. They may also be used without a window to detect vacuum UV or X-rays.

A phototransistor is in essence nothing more than a bipolar transistor that is encased in a


transparent case so that light can reach the base-collector junction. The phototransistor works like a
photodiode, but with a much higher responsivity for light, because the electrons that are generated by
photons in the base-collector junction are injected into the base, and this current is then amplified by
the transistor operation.

Fig 2.5.3 Photodiode schematic symbol

Principle of operation:

A photodiode is a p-n junction or p-i-n structure. When a photon of sufficient energy


strikes the diode, it excites an electron thereby creating a mobile electron and a positively charged
electron hole. If the absorption occurs in the junction's depletion region, or one diffusion length away
from it, these carriers are swept from the junction by the built-in field of the depletion region,
producing a photocurrent.

Photodiodes can be used under either zero bias (photovoltaic mode) or reverse bias
(photoconductive mode). In zero bias, light falling on the diode causes a current across the device,
leading to forward bias which in turn induces "dark current" in the opposite direction to the

21
photocurrent. This is called the photovoltaic effect, and is the basis for solar cells in fact; a solar cell is
just a large number of big photodiodes. Reverse bias induces only little current (known as saturation
or back current) along its direction.

But a more important effect of reverse bias is widening of the depletion layer (therefore
expanding the reaction volume) and strengthening the photocurrent. Circuits based on this effect are
more sensitive to light than ones based on the photovoltaic effect and also tend to have lower
capacitance, which improves the speed of their time response. On the other hand, the photovoltaic
mode tends to exhibit less electronic noise.

Avalanche photodiodes have a similar structure, but they are operated with much higher
reverse bias. This allows each photo-generated carrier to be multiplied by avalanche breakdown,
resulting in internal gain within the photodiode, which increases the effective responsivity of the
device.

Features:

Critical performance parameters of a photodiode include:

1. Responsivity:

The responsivity may also be expressed as quantum efficiency, or the ratio of the number of
photo generated carriers to incident photons and thus a unit less quantity.

2. Dark current:

The dark current includes photocurrent generated by background radiation and the saturation
current of the semiconductor junction. Dark current must be accounted for by calibration if a
photodiode is used to make an accurate optical power measurement, and it is also a source of noise
when a photodiode is used in an optical communication system.

3. Noise-equivalent power:

(NEP) The minimum input optical power to generate photocurrent, equal to the RMS noise
current in a 1 hertz bandwidth. The related characteristic directivity (D) is the inverse of NEP,
1/NEPThe NEP is roughly the minimum detectable input power of a photodiode.

Applications:

1. P-N photodiodes are used in similar applications to other photo detectors, such as
photoconductors, charge-coupled devices, and photomultiplier tubes.

22
2. Photodiodes are used in consumer electronics devices such as compact disc players, smoke
detectors, and the receivers for remote controls in VCRs and televisions.
3. PIN diodes are much faster and more sensitive than ordinary p-n junction diodes, and hence
are often used for optical communications and in lighting regulation.

P-N vs. P-I-N Photodiodes:

1. Due to the intrinsic layer, a PIN photodiode must be reverse biased (Vr). The Vr increases the
depletion region allowing a larger volume for electron-hole pair production, and reduces the
capacitance thereby increasing the bandwidth.
2. The Vr also introduces noise current, which reduces the S/N ratio. Therefore, a reverse bias is
recommended for higher bandwidth applications and/or applications where a wide dynamic
range is required.
3. A PN photodiode is more suitable for lower light applications because it allows for unbiased
operation.

2.6 RF TRANSMITTER

Overview
The STT-433 is ideal for remote control applications where low cost and longer range is required. The
transmitter operates from a1.5-12V supply, making it ideal for battery-powered applications. The
transmitter employs a SAW-stabilized oscillator, ensuring accurate frequency control for best range
performance. Output power and harmonic emissions are easy to control, making FCC and ETSI
compliance easy. The manufacturing-friendly SIP style package and low-cost make the STT-433
suitable for high volume application

23
2.6.1 RF transmitter

Features

· 433.92 MHz Frequency

· Low Cost

· 1.5-12V operation

· 11mA current consumption at 3V

· Small size

· 4 dBm output power at 3V

3. Applications
Remote Keyless Entry (RKE)
Remote Lighting Controls
On-Site Paging
Asset Tracking
Wireless Alarm and Security Systems

24
Long Range RFID
Automated Resource Management

OPERATION

Theory

OOK(On Off Keying) modulation is a binary form of amplitude modulation. When a logical 0
(data line low) is being sent, the transmitter is off, fully suppressing the carrier. In this state, the
transmitter current is very low, less than 1mA. When a logical 1 is being sent, the carrier is fully on. In
this state, the module current consumption is at its highest, about 11mA with a 3V power supply.

25
OOK is the modulation method of choice for remote control applications where power consumption
and cost are the primary factors. Because OOK transmitters draw no power when they transmit a 0,
they exhibit significantly better power consumption than FSK transmitters. OOK data rate is limited
by the start-up time of the oscillator. High-Q oscillators which have very stable center frequencies
take longer to start-up than low-Q oscillators. The start-up time of the oscillator determines the
maximum data rate that the transmitter can send.

Data Rate

The oscillator start-up time is on the order of 40uSec, which limits the maximum data rate to 4.8
kbit/sec.

SAW stabilized oscillator

The transmitter is basically a negative resistance LC oscillator whose center frequency is tightly
controlled by a SAW resonator. SAW (Surface Acoustic Wave) resonators are fundamental frequency
devices that resonate at frequencies much higher than crystals

RF RECEIVER

Overview

26
2.6.2 RF receiver

The STR-433 is ideal for short-range remote control applications where cost is a primary
concern. The receiver module requires no external RF components except for the antenna. It generates
virtually no emissions, making FCC and ETSI approvals easy. The super-regenerative design exhibits
exceptional sensitivity at a very low cost. The manufacturing-friendly SIP style package and low-cost
make the STR-433 suitable for high volume applications.

Features

· Low Cost

· 5V operation

· 3.5mA current drain

· No External Parts are required

· Receiver Frequency: 433.92 MHZ

· Typical sensitivity: -105dBm

· IF Frequency: 1MHz

Applications

· Car security system

· Sensor reporting

· Automation system

· Remote Keyless Entry (RKE)

· Remote Lighting Controls

· On-Site Paging

27
· Asset Tracking

· Wireless Alarm and Security Systems

· Long Range RFID

· Automated Resource Management

OPERATION
Super-Regenerative AM Detection

The STR-433 uses a super-regenerative AM detector to demodulate the incoming AM


carrier. A super regenerative detector is a gain stage with positive feedback greater than unity so that it
oscillates. An RC-time constant is included in the gain stage so that when the gain stage oscillates, the
28
gain will be lowered over time proportional to the RC time constant until the oscillation eventually
dies. When the oscillation dies, the current draw of the gain stage decreases, charging the RC circuit,
increasing the gain, and ultimately the oscillation starts again. In this way, the oscillation of the gain
stage is turned on and off at a rate set by the RC time constant. This rate is chosen to be super-audible
but much lower than the main oscillation rate. Detection is accomplished by measuring the emitter
current of the gain stage. Any RF input signal at the frequency of the main oscillation will aid the
main oscillation in

Restarting. If the amplitude of the RF input increases, the main oscillation will stay on for a longer
period of time, and the emitter current will be higher. Therefore, we can detect the original base-band
signal by simply low-pass filtering the emitter current.

The average emitter current is not very linear as a function of the RF input level. It exhibits a
1/ln response because of the exponentially rising nature of oscillator start-up. The steep slope of a
logarithm near zero results in high sensitivity to small input signals.

Data Slicer

The data slicer converts the base-band analog signal from the super-regenerative detector to
a CMOS/TTL compatible output. Because the data slicer is AC coupled to the audio output, there is a
minimum data rate. AC coupling also limits the minimum and maximum pulse width. Typically, data
is

encoded on the transmit side using pulse-width modulation (PWM) or non-return-to-zero (NRZ). The
most common source for NRZ data is from a UART embedded in a micro-controller. Applications that
use NRZ data encoding typically involve microcontrollers. The most common source for PWM data

is from a remote control IC such as the HC-12E from Holtek

Data is sent as a constant rate square-wave. The duty cycle of that square wave will generally be
either 33% (a zero) or 66% (a one). The data slicer on the STR-433 is optimized for use with PWM
encoded data, though it will work with NRZ data if certain encoding rules are followed.

Power Supply

The STR-433 is designed to operate from a 5V power supply. It is crucial that this power
supply be very quiet. The power supply should be bypassed using a 0.1uF low-ESR ceramic capacitor
and a 4.7Uf tantalum capacitor. These capacitors should be placed as close to the power pins as
possible. The STR- 433 is designed for continuous duty operation. From the time power is applied, it
can take up to 750mSec for the data output to become valid.

Antenna Input

It will support most antenna types, including printed antennas integrated directly onto the PCB and
simple single core wire of about 17cm. The performance of the different antennas varies. Any time a
29
trace is longer than 1/8th the wavelength of the frequency it is carrying, it should be a 50 ohm
microstrip.

Typical Application

Remark: Antenna length about: 17cm for 433MHz

2.1 RELAYS

A relay is an electrically operated switch. Many relays use an electromagnet to operate a


switching mechanism mechanically, but other operating principles are also used. Relays are used
where it is necessary to control a circuit by a low-power signal (with complete electrical isolation
between control and controlled circuits), or where several circuits must be controlled by one signal.
A relay is an electrically operated switch. Current flowing through the coil of the relay creates
a magnetic field which attracts a lever and changes the switch contacts. The coil current can be on or
off so relays have two switch positions and most have double throw (changeover) switch contacts as
shown in the diagram.

Fig 2.7.1 Relay showing coil and switch contacts

Relays allow one circuit to switch a second circuit which can be completely separate from the
first. For example a low voltage battery circuit can use a relay to switch a 230V AC mains circuit.
30
There is no electrical connection inside the relay between the two circuits; the link is magnetic and
mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a 12V relay, but it can
be as much as 100mA for relays designed to operate from lower voltages. Most ICs (chips) cannot
provide this current and a transistor is usually used to amplify the small IC current to the larger value
required for the relay coil. The maximum output current for the popular 555 timer IC is 200mA so
these devices can supply relay coils directly without amplification.
Relays are usually SPDT or DPDT but they can have many more sets of switch contacts, for
example relays with 4 sets of changeover contacts are readily available. For further information about
switch contacts and the terms used to describe them please see the page on switches.
Most relays are designed for PCB mounting but you can solder wires directly to the pins
providing you take care to avoid melting the plastic case of the relay.
The supplier's catalogue should show you the relay's connections. The coil will be obvious and it may
be connected either way round. Relay coils produce brief high voltage 'spikes' when they are switched
off and this can destroy transistors and ICs in the circuit. To prevent damage you must connect a
protection diode across the relay coil.
The figure shows a relay with its coil and switch contacts. You can see a lever on the left being
attracted by magnetism when the coil is switched on. This lever moves the switch contacts.

2.7.2 Relay Circuit


There is one set of contacts (SPDT) in the foreground and another behind them, making the relay
DPDT.
The relay's switch connections are usually labelled COM, NC and NO:
 COM = Common, always connect to this; it is the moving part of the switch.
 NC = Normally Closed, COM is connected to this when the relay coil is off.
 NO = Normally Open, COM is connected to this when the relay coil is on.

Applications of relays

31
 Control a high-voltage circuit with a low-voltage signal, as in some types of modems or
audio amplifiers.
 Control a high-current circuit with a low-current signal, as in the starter solenoid of an
automobile.
 Detect and isolate faults on transmission and distribution lines by opening and closing circuit
breakers.

CHAPTER 3
SOFTWARE DESCRIPTION

This project is implemented using following software’s:


 Express PCB – for designing circuit
 PIC C compiler - for compilation part
 Proteus 7 (Embedded C) – for simulation part

3.1 Express PCB:

Breadboards are great for prototyping equipment as it allows great flexibility to modify
a design when needed; however the final product of a project, ideally should have a neat PCB, few
cables, and survive a shake test. Not only is a proper PCB neater but it is also more durable as there
are no cables which can yank loose.

Express PCB is a software tool to design PCBs specifically for manufacture by the
company Express PCB (no other PCB maker accepts Express PCB files). It is very easy to use, but it
does have several limitations.

It can be likened to more of a toy then a professional CAD program.


32
It has a poor part library (which we can work around)

It cannot import or export files in different formats

It cannot be used to make prepare boards for DIY production

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.

3.1.1 Preparing Express PCB for First Use:

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 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.

3.1.2 The Interface:

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: 3.1 show the toolbar in which the each button has the following functions:

Fig 3.1.2: Tool bar necessary for the interface

 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.
 The zoom to selection tool: does just that.

33
 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.

 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.

 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.

 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.

 The remove a trace button is not very important since the delete key will achieve the same
result.

3.1.3 Design Considerations:

Before starting a project there are several ways to design a PCB and one must be
chosen to suit the project’s needs.

Single sided, or double sided:

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 traveling over the traces is sensitive (e.g. audio
signals).

A double sided board is more expensive to produce professionally, more difficult to


etch on a DIY board, but makes the layout of components a lot smaller and easier. It should be noted
that if a trace is running on the top layer, check with the components to make sure you can get to its
pins with a soldering iron.
34
Large capacitors, relays, and similar parts which don’t have axial leads can NOT have traces on top
unless boards are plated professionally.

Ground-plane or other special purposes for one side:

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 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
paSWSrts 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.

3.2 PIC Compiler:


PIC compiler is software used where the machine language code is written and
compiled. After compilation, the machine source code is converted into hex code which is to be
dumped into the microcontroller for further processing. PIC compiler also supports C language code.
It’s important that you know C language for microcontroller which is commonly
known as Embedded C. As we are going to use PIC Compiler, hence we also call it PIC C. The PCB,
PCM, and PCH are separate compilers. PCB is for 12-bit opcodes, PCM is for 14-bitopcodes, and
PCH is for 16-bit opcode PIC microcontrollers. Due to many similarities, all three compilers are
covered in this reference manual. Features and limitations that apply to only specific microcontrollers
are indicated within. These compilers are specifically designed to meet the unique needs of the PIC
microcontroller. This allows developers to quickly design applications software in a more readable,
high-level language. When compared to a more traditional C compiler, PCB, PCM, and PCH have
some limitations. As an example of the limitations, function recursion is not allowed.
This is due to the fact that the PIC has no stack to push variables onto, and also
because of the way the compilers optimize the code. The compilers can efficiently implement normal
C constructs, input/output operations, and bit twiddling operations. All normal C data types are
supported along with pointers to constant arrays, fixed point decimal, and arrays of bits.

PIC C is not much different from a normal C program. If you know assembly, writing
a C program is not a crisis. In PIC, we will have a main function, in which all your application
specific work will be defined. In case of embedded C, you do not have any operating system running
in there. So you have to make sure that your program or main file should never exit. This can be done
with the help of simple while (1) or for (;;) loop as they are going to run infinitely.

We have to add header file for controller you are using, otherwise you will not be able
to access registers related to peripherals.
35
#include <16F877A.h> // header file for PIC 16F877A//

3.3 Proteus:

Proteus is software which accepts only hex files. Once the machine code is converted
into hex code, that hex code has to be dumped into the microcontroller and this is done by the Proteus.
Proteus is a programmer which itself contains a microcontroller in it other than the one which is to be
programmed. This microcontroller has a program in it written in such a way that it accepts the hex file
from the pic compiler and dumps this hex file into the microcontroller which is to be programmed. As
the Proteus programmer requires power supply to be operated, this power supply is given from the
power supply circuit designed and connected to the microcontroller in proteus. The program which is
to be dumped in to the microcontroller is edited in proteus and is compiled and executed to check any
errors and hence after the successful compilation of the program the program is dumped in to the
microcontroller using a dumper.

CHAPTER 4

PROJECT DESCRIPTION
In this chapter, schematic diagram and interfacing of PIC16F877A microcontroller with each
module is considered

36
Fig 4.1.1 : schematic diagram of transmitter section of BLIND STICK WITH HOME AUTOMATION

37
Fig 4.1.2 : schematic diagram of receiver section of BLIND STICK WITH HOME AUTOMATION

Working principle:

In this project, we are using RF technology to operate the home appliances. In these project we are
using IR sensor to detect the obstacle and buzzer for alarm. Relay to cut of the power supply when the
loads are on /off position.

4.2 Advantages:
1. The microcontroller then processes this data.

2. It also detects and sounds a different buzzer.

3. A wireless rf based remote is used.

4.3 Disadvantages:
 Integrating all the modules to the sensor is quite sensitive.

4.4 Applications:
 Very useful for blind people.
38
CHAPTER 5
RESULTS

5.1 Result:
By using this project we can design and BLIND STICK WITH HOME
AUTOMATION using PIC16F72 can be successfully developed. This project proposed the design
and architecture of a new concept of blind stick with home automation. The advantage of the system
lies in the fact that it can prove to be a very low cost solution to millions of blind person worldwide.

5.2 Conclusion
Integrating features of all the hardware components used have been developed in it.
Presence of every module has been reasoned out and placed carefully, thus contributing to the best
working of the unit. Secondly, using highly advanced IC’s with the help of growing technology, the
project has been successfully implemented. Thus the project has been successfully designed and
tested.

5.3 Future Scope


Our project “ BLIND STICK WITH HOME AUTOMATION ” . A wireless RF based
remote is used for this purpose. Pressing the remote button sounds a buzzer on the stick which helps
the blind person to find their stick. We can extend this project with gsm and iot technology and with
some advanced technologies.

39
REFERENCES

The sites which were used while doing this project:

1. www.wikipedia.com

2. www.allaboutcircuits.com

3. www.microchip.com

4. www.howstuffworks.com

Books referred:

1. Raj kamal –Microcontrollers Architecture, Programming, Interfacing and System Design.

2. Mazidi and Mazidi –Embedded Systems.

3. PCB Design Tutorial –David.L.Jones.

4. PIC Microcontroller Manual – Microchip.

5. Pyroelectric Sensor Module- Murata.

6. Embedded C –Michael.J.Pont.

40
APPENDEX

TRANSMETER
TITLE:TX SECTION home automation with blind stick RF (TX SECTION )
PIC16f73
RF TX = B0 TO B4,
c4=GREEN LED,
c5= RED LED,
c3=BUZZER,
A0= IR,
A1 = SWITCH,
**************************************************************************
**/
#include <16F72.h>
#fuses HS,NOWDT,PROTECT,brownout,put
#use delay (clock=20M)
//#include <flexd7_lcd.c>

void buzzer()
{
output_high(pin_c3); //buzzer on
delay_ms(300);
output_low(pin_c3); //buzzer off
delay_ms(100);

//////////////////////////////////////////////////////////////////////////
///////

//MAIN
PROGRAMMING-------------------------------------------------------------
void main()
{
float temp1,temp2,GAS,HUM;
setup_adc(ADC_CLOCK_INTERNAL);
setup_adc_ports( ALL_ANALOG );
// lcd_init();

//HEALTH CHECK UP..........................................


output_high(PIN_c3); //BUZZER ON
output_high(PIN_c4); //GREEN LED ON
output_high(PIN_c5); //RED LED ON

41
delay_ms(1000);
output_low(PIN_c3); //BUZZER OFF
output_low(PIN_c4);
output_low(PIN_c5);
delay_ms(1000);
output_high(PIN_c3); //BUZZER ON
output_high(PIN_c4); //GREEN LED ON
output_high(PIN_c5); //RED LED ON
delay_ms(1000);
output_low(PIN_c3); //BUZZER OFF
output_low(PIN_c4);
output_low(PIN_c5);
delay_ms(1000);

//ADC INITIALIZING
output_high (PIN_C4);
output_low (PIN_C5);
/*DISPLAY INITIAL MESSAGE
lcd_putc('\f'); //FORMATE LCD DISPLAY
lcd_gotoxy(1,1);
printf(lcd_putc,"WIRELESS FAN SPEED");
lcd_gotoxy(3,2);
printf(lcd_putc," CNTRL S/M");
delay_ms(1500);
lcd_putc('\f');
lcd_gotoxy(0,1);
printf(lcd_putc,"SYSTEM USING WRL ");
lcd_gotoxy(1,2);
printf(lcd_putc,"SENSOR NETWORK ");
delay_ms(1200);
*/
//RF initialization
output_high(pin_B0);
delay_ms(200);

//output_high(PIN_b2); output_high(PIN_b3);
output_high(PIN_b4);
//CONTINEOUS LOOP...........................................
while(1)
{
set_adc_channel(0); //TEMPERATURE ............................
delay_ms(1);
temp2=read_adc();
delay_ms(1);

42
//*****************************************************************

if(temp2>155)
{
//output_high(pin_C5); //RED LED ON
output_high(pin_C4); //GREEN LED OFF

output_low(pin_B0); //rf
delay_ms(10);
output_low(pin_B1); //correct
output_high(pin_B2);
output_high(pin_B3);
output_high(pin_B4);
delay_ms(500);

output_high(pin_c3);

output_high(pin_B0);
}

else
{
output_low(pin_c3);
output_low(pin_C4); //RED LED ON
output_high(pin_C5); //GREEN LED OFF

output_low(pin_B0);
output_high(pin_B1);
}

}//
WHILE.....................................................................
.

}//MAIN

43
RECEIVER

TITLE: RX SECTION home automation with blind stick RF (RX SECTION)

PIC16F73
B PORT - RF
C7,C6 - RELAYS
C5 = RED LED,
C4 = GREEN LED,

**************************************************************************
******/
#include <16F73.h> //Microcontroller Used
#fuses HS,NOWDT,PROTECT,brownout,put
#use delay(clock=20M)

unsigned int flag = 0;

void buzzer()
{
output_high(pin_c3); //buzzer on
delay_ms(700);
output_low(pin_c3); //buzzer off
delay_ms(700);

//MAIN PROGRAMMING....................................
void main()
{

unsigned int flag = 0;

output_high(PIN_c3); //BUZZER ON
output_high(PIN_c4); //GREEN LED ON
output_high(PIN_c5); //RED LED ON
delay_ms(1000);
output_low(PIN_c3); //BUZZER OFF
output_low(PIN_c4);

44
output_low(PIN_c5);
delay_ms(1000);
output_high(PIN_c3); //BUZZER ON
output_high(PIN_c4); //GREEN LED ON
output_high(PIN_c5); //RED LED ON
delay_ms(1000);
output_low(PIN_c3); //BUZZER OFF
output_low(PIN_c4);
output_low(PIN_c5);
delay_ms(100);

// output_high (PIN_b0);
//output_low (PIN_b1);

//fprintf(PC,"************************************************************
**\r\n");delay_ms(200);
// fprintf(PC,"DEVELOPEMENT OF GAS & FIRE LEAKAGE DETECTION
\r\n");delay_ms(200);
//fprintf(PC," WITH WIRELESS SENSOR NETWORK\r\n");delay_ms(200);
//
fprintf(PC,"**************************************************************
\r\n");
//delay_ms(1000);

while(1)
{

if(input(pin_b0))
{
if(!input(pin_b1))
{
output_high(pin_c4);

output_high(pin_c7);

buzzer();

45
delay_ms(3000);
output_low(pin_c4);

output_high(pin_c6);
output_high(pin_c5);

} //if rf checks
else
{
output_low(pin_c7);
output_low(pin_c6);

output_low(pin_c4);
output_low (pin_c5);

} //while

} //main

46

Вам также может понравиться