You are on page 1of 72

ABSTRACT

A remote online carbon dioxide (CO2) concentration monitoring system is


developed, based on the technologies of wireless sensor networks, in allusion to
the gas leakage monitoring requirement for CO2 capture and storage. The remote
online CO2 monitoring system consists of monitoring equipment, a data center
server, and the clients. The monitoring equipment is composed of a central
processing unit (CPU), air environment sensors array, global positioning system
(GPS) receiver module, secure digital memory card (SD) storage module, liquid
crystal display (LCD) module, and general packet radio service (GPRS) wireless
transmission module. The sensors array of CO2, temperature, humidity, and light
intensity are used to collect data and the GPS receiver module is adopted to collect
location and time information. The CPU automatically stores the collected data
in the SD card data storage module and displays them on the LCD display module
in real-time. Afterwards, the GPRS module continuously wirelessly transmits the
collected information to the data center server. The online monitoring WebGIS
clients are developed using a PHP programming language, which runs on the
Apache web server. MySQL is utilized as the database because of its speed and
reliability, and the stunning crossbrowser web maps are created, optimized, and
deployed with the OpenLayers JavaScript web-mapping library. Finally, an
experiment executed in Xuzhou city, Jiangsu province, China is introduced to
demonstrate the implementation and application.
INTRODUCTION

ATMOSPHERIC concentrations of the key greenhouse gas (GHG) carbon


dioxide (CO2) well above pre-industrial levels constitute the main cause for the
predicted rise at average surface temperature on Earth and the corresponding
change of the global climate system .CO2 Capture and Storage (CCS) is on the
one hand an effective way to realize effective greenhouse gas storage, and on the
other to improve oil and gas production .Many countries such as the United
States, Japan, and Canada are in search of effective approaches for CO2 storage in
either geological formations or ocean. In China, the first demonstrative industrial
project of CO2 storage has come into operation in Shenhua mine area. However,
once CO2 leaks from the storage reservoir, all the efforts human beings have made
to fight global warming would be go down the drain. Therefore, what is in needed
after the geological CO2 storage is long-term terrain monitoring of the greenhouse
gas leakage, which is absolutely crucial to help ensure that geologic sequestration
of CO2 is safe. For this reason, the development of remote online monitoring
system is of great significance to geological CO2 storage and leakage
warning.
\
PROPOSED SYSTEM

The main objective of this paper is to propose a remote online carbon


dioxide (CO2) concentration monitoring system based on the technologies
of wireless sensor networks, in allusion to the gas leakage monitoring
requirement for CO2 capture and storage.

The remote online CO2 monitoring system consists of monitoring


equipment, a data center server, and the clients. The monitoring equipment
is composed of a central processing unit (CPU), air environment sensors
array, secure digital memory card (SD) storage module, liquid crystal
display (LCD) module, and general packet radio service (GPRS) wireless
transmission module.
LITERATURE REVIEW

“The IEA Weyburn CO2 monitoring and storage project”, J. B. Riding and
C. A. Rochelle. At Weyburn, a comprehensive program that included time-
lapse 3-D seismic imaging, geochemical sampling and soil gas surveys was
used a multifaceted approach to demonstrate effective containment.

“NASA. (Oct. 9, 2012). AIRS: Get Airs CO2 Data, Washington, DC [Online].
Available: http://airs.jpl.nasa.gov/data/get_airs_co2_data” With the help of
Map of NASA’s Aqua satellite, Atmospheric Infrared Sounder instrument
(AIRS)is used to acquire C02 in the mid-troposphere

.” NOAA. (Jul. 21, 2012). CO2 Publication Data, Silver Spring, MD [Online].
Available: ftp://ftp.cmdl.noaa.gov/ccg/co2/trends/co2_ annmean_mlo.txt “ The
National Oceanic and Atmospheric Administration (NOAA) ESRL’s Global
Monitoring Division (GMD) tall tower network pro- vides regionally
representative measurements of CO2 and related gases in the continental
boundary layer.
Methodology

PIC16F877A

A PIC microcontroller is a processor with built in memory and RAM and you can
use it to control your projects (or build projects around it). So it saves you building
a circuit that has separate external RAM,ROM and peripheral chips.
PIC microcontrollers Includes.
 EEPROM.
 Timers.
 Analogue
comparators.
 UART.

* Frequency counter - using the internal timers and reporting through UART
(RS232) or output to LCD.

* Capacitance meter - analogue comparator oscillator.

* Event timer - using internal timers.

* Event data logger -capturing analogue data using an internal ADC and using the
internal EEPROM for storing data (using an external I2C for high data storage
capacity.

* Servo controller (Control through UART) - using the internal PWM module or
using a software created PWM.

The PIC Micro is one of the most popular microcontrollers and in case you were
wondering the difference between a microprocessor and a microcontroller is that a
microcontroller has an internal bus with in built memory and peripherals.

In fact the 8 pin (DIL) version of the 12F675 has an amazing number of internal
peripherals. These are:
 Two timers.
 One 10bit ADC with 4 selectable inputs.
 An internal oscillator (or you can use an external crystal).
 An analogue comparator.
 1024 words of program memory.
 64 Bytes of RAM.
 128 Bytes of EEPROM memory.
 External interrupt (as well as interrupts from internal peripherals).
 External crystal can go up to 20MHz.
 ICSP : PIC standard programming interface.

And all of these work from within an 8 pin DIL package!

In the mid-range devices the memory space ranges from 1k to 8k (18F parts have
more) - this does not sound like a lot but the processor has an efficient instruction
set and you can make useful projects even with 1k e.g. LM35 temperature sensing
project that reports data to the serial port easily fits within 1k.

Features

In fact a PIC microcontroller is an amazingly powerful fully featured processor


with internal RAM, EEROM FLASH memory and peripherals. One of the
smallest ones occupies the space of a 555 timer but has a 10bit ADC, 1k of
memory, 2 timers, high current I/O ports a comparator a watch dog timer... I could
go on as there is more!

Programming
One of the most useful features of a PIC microcontroller is that you can re-program
them as they use flash memory (if you choose a part with an F in the part number
e.g. 12F675 not 12C509). You can also use the ICSP serial interface built into each
PIC Microcontroller for programming and even do programming while it's still
plugged into the circuit!

You can either program a PIC microcontroller using assembler or a high level
language and I recommend using a high level language such as C as it is much
easier to use (after an initial learning curve). Once you have learned the high level
language you are not forced to use the same processor e.g. you could go to an AVR
or Dallas microcontroller and still use the same high level language.

Input / Output - I/O

A PIC Microcontroller can control outputs and react to inputs e.g. you could drive
a relay or read input buttons.

With the larger devices it's possible to drive LCDs or seven segment displays with
very few control lines as all the work is done inside the PIC Micro.

Comparing a frequency counter to discrete web designs you'll find two or three
chips for the microcontroller design and ten or more for a discrete design. So using
them saves prototype design effort as you can use built in peripherals to take care
of lots of the circuit operation.

Many now have a built in ADC so you can read analogue signal levels so you don't
need to add an external devices e.g. you can read an LM35 temperature sensor
directly with no interface logic.
Peripherals

The PIC microcontroller has many built in peripherals and this can make using
them quite daunting at first which is why I have made this introductory page with a
summary of each major peripheral block.

At the end is a short summary of the main devices used in projects shown on this
site.

The best way to start is to learn about the main features of a chip and then begin to
use each peripheral in a project. I think learning by doing is the best way.

PIC
microcontr PIC microcontroller
oller feature description
Feature
Flash Re-programmable program
memory storage.
Memory storage for
RAM
variables.
Long term stable memory :
Electrically Erasable
EEPROM
Programmable Read
Only Memory.
High current Input/Output
I/O ports ports (with pin direction
change).
Timers/
Typically 3.
Counters
Built in RS232 protocol
USART (only needs level translator
chip).
Capture/Compare/PWM
CCP
module.
SSP I2C and SPI Interfaces.
An analogue comparator and
Comparator
internal voltage reference.
Analogue to digital
ADC
converter.
Parallel Slave Port (for 8 bit
PSP
microprocessor systems).
LCD LCD interface.
Special ICSP,WDT,BOR,POR,PWR
features T,OST,SLEEP
Simple programming using
ICSP In Circuit Serial
Programming.

Flash memory

This is the program storage area and gives you the most important benefit for
using a PIC microcontroller - You program the device many times. Since when
does anyone get a program right first time ?
Devices used in projects on this site can be re-programmed up to 100,000 times
(probably more) as they use Flash memory - these have the letter F in the part
name. You can get cheaper (OTP) devices but these are One-Time-Programmable;
once programmed you can't program it again!

ICSP

In Circuit Serial Programming (ICSP) is the next most important benefit. Instead
of transferring your chip from the programmer to the development board you just
leave it in the board. By arranging the programming connections to your circuit
correctly you won't need to remove the chip!

You can re-program the device while it's still in the circuit so once your
programmer is setup you can leave it on the bench and test your programs without
moving the chip around and it makes the whole process much easier.

I/O Ports

Input / Output ports let you communicate with the outside world so you can
control leds, LCDs or just about anything with the right interface. You can also set
them as inputs to gather information.

Pin direction

Most PIC microcontroller pins can be set as an input or and output and this can be
done on the fly e.g. for a dallas 1 wire system a pin can be written to generate data
and read at a later stage. The TRIS register controls the I/O direction and setting a
bit in this register to zero sets the pin as output while setting it as one sets the pin
as input.

This allows you to use a pin for multiple operations e.g. the Real Time clock
project uses RA0, the first pin of PORTA, to output data to a seven segment
display and at a later point in the program read the analogue value as an input.

Current

The PIC I/O ports are high current ports capable of directly driving LEDs (up to
25ma output current) - the total current allowed usually ~200mA this is often for
the whole chip (or specified for several ports combined together).

Timer / Counters

Each PIC microcontroller has up to three timers that you can either use as a timer
or a counter (Timer 1 & 2) or a baud clock (Timer 2).

Timer 0

The original timer: Timer 0 was the first timer developed and you can find it in all
the earliest devices e.g. 16F84 up to the most current e,g, 16F877A.

It is an 8 bit timer with an 8 bit prescaler that can be driven from an internal
(Fosc/4) or external clock. It generates an interrupt on overflow when the count
goes from 255 to zero. Timer 0 always synchronizes the input clock (when using
external clock).Note: You can read and write timer 0 but you can not read the
prescaler.
Note: The prescaler changes its effect depending on whether it is a timer prescaler
or a watch dog prescaler - so the same prescaler setting may prescale by 2 or by 1
depending on its use!

Timer 1

This is a 16 bit timer that generates an overflow interrupt when it goes from
65535 to zero. It has an 8 bit programmable prescaler and you can drive it from
the internal clock (Fosc/4) or an external pin. To eliminate false triggering it also
has an optional input synchronizer for external pin input.This timer can be used in
sleep mode and will generate a wakeup interrupt on overflow.

Timer 1 is also read by the CCP module to capture an event time.Note: Using this
timer in sleep mode will use more current.

In addition it can be used to drive a low power watch crystal. This is something
that sounds good but I don't recommend you do it as watch crystals are extremely
difficult to drive correctly. You should only use it if you are going to make a pcb
and follow all the guidelines in making it noise free. I used a DS1307 in the Real
Time clock project which drives the crystal directly but even this is difficult to get
operating accurately.

Timer 2

This is an 8 bit timer with an 8 bit prescaler and an 8 bit postscaler. It takes its
input only from the internal oscillator (Fosc/4).
This timer is used for the timebase of a PWM when PWM is active and it can be
software selected by the SSP module as a baud clock.

It also has a period register that allows easy control of the period. When timer 2
reaches the PR2 register value then it resets. This saves having to check the timer
value in software and then reset the timer and since it is done in hardware the
operation is much faster - so you can generate fast clocks with periods that are
multiples of the main clock.

USART

The USART is a useful module and saves having to code up a software version so
it saves valuable program memory. You can find more information on RS232 here
and how to make it work. Look here for pin outs.All you need to interface it to a
PC serial port is a MAX232 chip (or equivalent).

Note: An equivalent MAX232 chip is the SP202ECP that has the same pinout as
the MAX232 but lets you use 100nF capacitors - so you don't need the large 1uF
caps.

Baud Rates
You have to be careful using the baud rates as they depend on the main clock in
use and normal oscillator values in general do not fit very well with 'real' baud
rates.

There is a table of baud rates in microchip data sheet DS33023A which indicates
the expected percentage error for a specific clock rate and in general the higher the
main clock the lower the error.

You sometimes have to play around with the register settings to get a better fit with
your clock rate and the baud rate you want. An example is for an 8MHz clock - if
you use BRGH=1 and an 8MHz clock (see the 16F88 datasheet) you get accurate
baud rates up to 38.4kbaud. You have to force this to work e.g. in mikroC the built
in USART routines use BRGH=0 so at 8MHz the baud rate is only accurate to
9.6kbaud.

If you want a super-accurate baud rate the best way is to use a clock crystal that
ends up giving you that baud rate i.e. work back through the baud rate equations to
find the crystal you need.

CCP

The Capture/Compare/PWM module has three modes of operation:

 Capture - Capture the time of an event.


 Compare - Generate an output when Timer 1 reaches a value.
 PWM - Pulse Width Modulation.

Capture
Capture mode is used to capture the value of Timer 1 when a signal at the CCP pin
goes high (or low depending on how the CCP is set up). The CCP can accurately
capture the arrival time of a signal at the CCP pin so it can be used for pulse time
measurement.

Compare

Compare mode is used to generate an output when Timer 1 reaches a value you put
into CCPR1. One special event trigger mode lets you start the ADC when the
compare mode triggers.

PWM

PWM gives you one Pulse Width Modulation output with 10 bit resolution and
with no software overhead - once started it operates all by itself unless you want to
change the duty cycle.

It uses Timer 2 to define its operation using Timer 2 period register to define the
frequency of the PWM.

Note: The duty cycle is not a percentage it is the number of periods of the PWM
clock that the output is high!

SSP

The Synchronous Serial Port lets you communicate with devices that use either the
SPI (Serial Peripheral Interface) or I2C (Inter IC communication) protocols. Note
that for full Master mode I2C operation you need to choose a PIC device that has
the MSSP device (Master Synchronous Serial Port).
SPI and I2C are shared so you can only use one at a time (or you could use the I2C
bit banged routines in the Real Time Clock project to have both at the same time).

You can find a project that uses I2C here and you can find more information on
I2C here.

Comparator and comparator voltage reference

The comparator is module that has two analogue comparators which can be set up
in one of 8 different ways. Either digital or analogue inputs can be compared to
reference voltages.

In one mode an internally generated voltage reference is used as an input to both


comparators and in the same mode multiplexing lets you monitor up to four
different input pins.

You can even send the output of the comparator to a pin so that it is used
independently from the microcontroller e.g. in a circuit where you need a
comparator you don't need an extra chip!

The analogue level must be between Vdd and Vss as protection diodes won't allow
anything else.

The module will generate an interrupt if the comparator output changes.

You can use it in sleep mode and the interrupt will wake it up.
The source impedance of the analogue signal must be smaller than 10k.

ADC

The single 10 bit Analogue to Digital Converter can have up to 8 inputs for a
device multiplexed from input pins.

The ADC can be used during sleep but you have to use the RC clock mode. One
benefit of this is that there will be no digital switching noise so you will get better
conversion accuracy.

For the 16F877A you can not just choose to use an analogue input if you feel the
need as there are only a specific and limited number of ways that the analogue
input pins can be enabled. It is best to start with AN0 and add more as necessary -
see the datasheet for which analogue inputs can be enabled e.g. if you started a
design using only AN5 you would find that you may have to enable a few more
analogue inputs as well!

The 16F675 can measure 4 analogue input pins!

PSP

The Parallel Slave Port lets you to connect the PIC microcontroller directly into a
microprocessor system. It provides an 8 bit read/write data bus and RD (read) WR
(write) and CS (chip select) inputs - all active low.

This will let you add a PIC microcontroller to a system so that the PIC
microcontroller can be treated as a memory mapped peripheral. It will let the
microcontroller behave just as though it was another microprocessor building
block e.g. some memory or ram but in this case you have full control over exactly
what the building block is i.e. you can re-program the PIC microcontroller to do
just about anything.

This provides an easy route to adding a PIC microcontroller to an 8 bit system that
already exists.

LCD

The LCD interface lets you directly interface to an LCD saving you having to use
an LCD module such as the HD44780. I have not used this feature as it is another
commercial requirement where removing a chip (HD44780) saves money in a
production run. I think it is capable of driving a graphic LCD.

Special Features

In Circuit Serial click here (jumps to


ICSP
Programming ICSP section).
WD This is a software error
Watch dog timer
T protector.
This detects if the power
BOR Brown Out reset supply dips slightly and
resets the device if so.
This starts
POR Power on reset microcontroller initializa
tion.
PW PoWeR up Time A time delay to let Vdd
RT rise.
Oscillator start up Wait for 1024 cycles
OST
timer after PWRT.
PIC
SLE
microcontroller Enter low power mode.
EP
sleep mode

WDT

If your software goes haywire then this timer resets the processor. To stop the
reset the well behaved software must periodically issue the CLRWDT instruction
to stop a resert. The WDT runs using its own oscillator. It runs during sleep and
shares Timer 0 prescaler.

POR

Power On Reset starts PIC microcontroller initialization when it detects a rising


edge on MCLR.

PWRT

If you enable this then 72ms after a POR the PIC microcontroller is started.

OST

Oscillator Startup Timer delays for 1024 oscillator cycles after PWRT (if PWRT is
enabled) ensuring that the oscillator has started and is stable. It is automatic and
only used for crystal oscillator modes and is active after POR or wake from sleep.

SLEEP
Sleep mode (or low power consumption mode) is entered by executing the 'SLEEP'
command. The device can wake from sleep caused by an external reset, Watch
Dog Timer timeout, INT pin RB port change or peripheral interrupt.

Project device overview

This site mainly uses three PIC devices out of the hundreds of different chips that
microchip produces. This does not sound like a lot but you can use the devices in
almost any project and they have so many built in peripherals that you can make
hundreds of projects with them.

The other microchip devices are all useful in different situations - perhaps they
have more memory or different peripherals - this is useful if you want to tailor your
designs to the system you build - but probably more useful in a commercial
environment where every cent counts in a production run.

All three devices are extremely powerful and the main difference is that they have
different numbers of pins and memory size.

Note: There are differences in using the devices i.e. there are some registers that
are different but in the generally you can interchange them - this is made easier
using a high level language.

The devices used in this site are:

PIC PIC PIC


microcontroll microcontro microcontrolle
er Device ller No. Pins r Flash
memory
WORDS
12F675 8 1k
16F88 18 4k
16F877A 40 8k

Note : When looking at the microchip site the memory size is kwords - ignore
kbytes - you need the kword size as this is what each instruction occupies - the
kbyte size is for comparison to other types of micros (probably). But the
microcontroller data bus is 8 bits wide so it is an 8 bit microcontroller (different
program memory and data memory due to using Harvard architecture).

(Note: that all of them have the letter F in - this means it is a Flash re-
programmable part - don't go and buy a part with O in as its OTP - programmable
only once! - only do that if you are really really sure it's the final design).

PIC Microcontroller Flash Memory size

You may think that 1k or even 8k is so tiny that it won't be useful but each PIC
microcontroller uses RISC (Reduced Instruction Set Computing) which simply
means that it has a cleverly arranged instruction set that only has a few
instructions. The mid range parts have 35 instructions.

If you use the high level language as recommended in this site then you won't need
to be too aware of the instruction set it just means you can do a lot with a small
amount of memory. Most of the projects on this site although they are fully
working projects fit within 2k words!
Note: If you need more memory you can always move to the 18F series of PIC
microcontrollers. Another option is to add an I2C serial eprom.

PIC microcontroller RAM and EEPROM size

The PIC microcontroller RAM size is also important as it stores all your variables
and intermediate data.

Note: You can usually alter the program to use less RAM by choosing the right
variable sizes or changing how your program works

For example don't use floating point alter it to use a different variable type e.g.
you can use long integers with fixed point operation to avoid floating point.

PIC microcontroller EEROM : Electrically Erasable ROM is used to store data


that must be saved between power up and power down.

This area is readable and writable and has a much longer life than the main
program store i.e. it has been designed for more frequent use.

Liquid Crystal Displays

Introduction
An LCD is a small low cost display. It is easy to interface with a micro-controller
because of an embedded controller(the black blob on the back of the board).This
controller is standard across many displays which means many micro-controllers
have libraries that make displaying messages as easy as a single line of code.LCDs
with a small number of segments, such as those used in digital watches and
pocket calculators, have individual electrical contacts for each segment.

An external dedicated circuit supplies an electric charge to control each


segment. This display structure is unwieldy for more than a few display
elements.Small monochrome displays such as those found in personal organizers,
or older laptop screens have a passive-matrix structure employing super-twisted
pneumatic (STN) or double-layer STN (DSTN) technology—the latter of which
addresses a color-shifting problem with the former—and color-STN (CSTN)—
wherein color is added by using an internal filter. Each row or column of the
display has a single electrical circuit.

The pixels are addressed one at a time by row and column addresses. This
type of display is called passive-matrix addressed because the pixel must retain its
state between refreshes without the benefit of a steady electrical charge. As the
number of pixels (and, correspondingly, columns and rows) increases, this type of
display becomes less feasible. Very slow response times and poor contrast are
typical of passive-matrix addressed LCDs.

High-resolution color displays such as modern LCD computer monitors and


televisions use an active matrix structure. A matrix of thin-film transistors (TFTs)
is added to the polarizing and color filters. Each pixel has its own dedicated
transistor, allowing each column line to access one pixel. When a row line is
activated, all of the column lines are connected to a row of pixels and the correct
voltage is driven onto all of the column lines.

Features:
 Built-in controller (KS 0066 or Equivalent)
 + 5V power supply (Also available for + 3V)
 1/16 duty cycle
 B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED) ,Optional for +
3V power supply
 Intelligent, with built-in Hitachi HD44780 compatible LCD controller and
RAM providing simple interfacing
 6.61 x 15.8 mm viewing area
 7.5 x 7 dot matrix format for 2.96 x 5.56 mm characters, plus cursor line
 8. Can display 224 different symbols
 9. Low power consumption (1 mA typical)
 10. Powerful command set and user-produced characters
 11. TTL and CMOS compatible
 12. Connector for standard 0.1-pitch pin headers
Mechanical Specifications

Pin Configurations:
Circuit Connections

Programming:

Algorithm to send data to LCD:

1.Make R/W low


2.Make RS=0 ;if data byte is command .RS=1 ;if data byte is data (ASCII value)
3.Place data byte on data register
4.Pulse E (HIGH to LOW)
5.Repeat the steps to send another data byte
LCD Initialization:

This is the pit fall for beginners. Proper working of LCD depend on the how the
LCD is initialized. We have to send few command bytes to initialize the LCD.
Simple steps to initialize the LCD

1.Specify function set: Send 38H for 8-bit,double line and 5x7 dot character
format.

2.Display On-Off control: Send 0FH for display and blink cursor on.

3.Entry mode set: Send 06H for cursor in increment position and shift is invisible.

4. Clear display: Send 01H to clear display and return cursor to home position.

LCD commands and codes:


LCD COMMANDS AND CODES:

1 Clear display screen

2 Return Home

4 Decrement cursor (shift cursor to left)

5 Increment cursor (shift cursor to right)

6 shift display right

7 shift display left

8 Display off, cursor off

A Display off, cursor on

C Display on, cursor off

E Display on, cursor blinking

F Display on, cursor blinking

10 Shift cursor position to left

14 Shift cursor position to right

18 Shift the entire display to the left

1C Shift the entire display to the right

80 Force cursor to the beginning of 1st line

C0 Force cursor to the beginning of 2nd line


38 2 lines and 5 x 7 matrix.

Interfacing LCD with the Microcontroller

Circuit Explanation

The LCD we have used in this project is HD1234. This is an alphanumeric type of
LCD with 16 pins. Of which Pins 7 to 14 are used as data pins, through which an
8-bit data can be input to the LCD. These Pins are connected to the Port 0 of Micro
controller. There are 3 control pins RS (Pin-4), RW (Pin-5) and EN (Pin-6). The
RS pin is connected to the 28th Pin of micro controller. The RW pin is usually
grounded. The Enable pin is connected to 27 th Pin. The LCD has two Rows and 16
Columns. The LCD is powered up with 5V supply connected to Pins 1(Gnd) and
2(Vcc). The Pin 3 is connected to Vcc through a Potentiometer. The potentiometer
is used to adjust the contrast level.
POWER SUPPLY UNIT

As we all know any invention of latest technology cannot be activated


without the source of power. So it this fast moving world we deliberately need a
proper power source which will be apt for a particular requirement. All the
electronic components starting from diode to Intel IC’s only work with a DC
supply ranging from _+5v to _+12. we are utilizing for the same, the most cheapest
and commonly available energy source of 230v-50Hz and stepping down ,
rectifying, filtering and regulating the voltage. This will be dealt briefly in the
forth-coming sections.

STEP DOWN TRANSFORMER

When AC is applied to the primary winding of the power transformer it can


either be stepped down or up depending on the value of DC needed. In our circuit
the transformer of 230v/15-0-15v is used to perform the step down operation
where a 230V AC appears as 15V AC across the secondary winding . One
alteration of input causes the top of the transformer to be positive and the bottom
negative. The next alteration will temporarily cause the reverse. The current rating
of the transformer used in our project is 2A. Apart from stepping down AC
voltages , it gives isolation between the power source and power supply circuitries.

RECTIFIER UNIT

In the power supply unit, rectification is normally achieved using a solid


state diode. Diode has the property that will let the electron flow easily in one
direction at proper biasing condition . As AC is applied to the diode, electrons only
flow when the anode and cathode is negative. Reversing the polarity of voltage
will not permit electron flow.
A commonly used circuit for supplying large amounts of DC power is the
bridge rectifier. A bridge rectifier of four diodes (4*IN4007) are used to achieve
full wave rectification. Two diodes will conduct during the negative cycle and the
other two will conduct during the positive half cycle. The DC voltage appearing
across the output terminals of the bridge rectifier will be somewhat lass than 90%
of the applied rms value. Normally one alteration of the input voltage will reverse
the polarities. Opposite ends of the transformer will therefore always be 180 deg
out of phase with each other.

For a positive cycle, two diodes are connected to the positive voltage at the
top winding and only one diode conducts . At the same time one of the other two
diodes conducts for the negative voltage that is applied from the bottom winding
due to the forward bias for that diode. In this circuit due to positive half cycleD1 &
D2 will conduct to give 10.8v pulsating DC. The DC output has a ripple frequency
of 100Hz. Since each altercation produces a resulting output pulse, frequency =
2*50 Hz. The output obtained is not a pure DC and therefore filtration has to be
done.

FILTERING UNIT

Filter circuits which is usually a capacitor acting as a surge arrester always follow
the rectifier unit. This capacitor is also called as a decoupling capacitor or a
bypassing capacitor, is used not only to ‘short’ the ripple with frequency of 120Hz
to ground but also to leave the frequency of the DC to appear at the output. A load
resistor R1 is connected so that a reference to the ground is maintained . C1R1 is
for bypassing ripples. C2R2 is used as a low pass filter, i.e. it passes only low
frequency signals and bypasses high frequency signals. The load resistor should be
1% to 2.5% of the load.

1000f/25v : for the reduction of ripples from the pulsating.

10f/25v : for maintaining the stability of the voltage at the load side.

O,1f : for bypassing the high frequency disturbances.

VOLTAGE REGULATORS

The voltage regulators play an important role in any power supply unit. The
primary purpose of a regulator is to aid the rectifier and filter circuit in providing a
constant DC voltage to the device. Power supplies without regulators have an
inherent problem of changing DC voltage values due to variations in the load or
due to fluctuations in the AC liner voltage. With a regulator connected to the DC
output, the voltage can be maintained within a close tolerant region of the desired
output. IC7812 and 7912 is used in this project for providing +12v and –12v DC
supply.

Specifications :

Resistors R1 and R2 maintain line load regulation.

At the secondary side of the transformer,


Applied voltage = 15v

Conducting drop across the diodes = 2*0.6


= 1.2v

without capacitor:

Vavg = (15-1.2)v = 13.8c pulsating DC

Frequency = 100Hz

With capacitor:

V=Vavg *1.414(formfactor)

= 19.51v
frequency = oHz

With 7812 voltage regulator :

V0= +12v

With 7912 voltage regulator :

V0= -12v

HUMIDIFIER
humidifier is a household appliance that increases humidity (moisture) in a single room or in the entire
home. There are point-of-use humidifiers, which are commonly used to humidify a single room, and
whole-house or furnace humidifiers, which connect to a home's HVAC system to provide humidity to the
entire house.

Relative Humidity
The relative humidity of the air affects how comfortable we feel. But what is humidity, and what is "relative humidity"
relative to?

Humidity is defined as the amount of moisture in the air. If you are standing in the bathroom after a hot shower and
can see the steam hanging in the air, or if you are outside after a heavy rain, then you are in an area of high humidity.
If you are standing in the middle of a desert that has not seen rainfall for two months, or if you are breathing air out of
a SCUBA tank, then you are experiencing low humidity.

Air contains a certain amount of water vapor. The amount of water vapor any mass of air can contain depends on the
temperature of that air: The warmer the air is, the more water it can hold. A low relative humidity means that the air is
dry and could hold a lot more moisture at that temperature.

For example, at 20 degrees C (68 degrees F), a cubic meter of air can hold a maximum of 18 grams of water. At 25
degrees C (77 degrees F), it can hold 22 grams of water. If the temperature is 25 degrees C and a cubic meter of air
contains 22 grams of water, then the relative humidity is 100 percent. If it contains 11 grams of water, the relative
humidity is 50 percent. If it contains zero grams of water, relative humidity is zero percent.

The relative humidity plays a large role in determining our comfort level. If the relative humidity is 100 percent, it
means that water will not evaporate -- the air is already saturated with moisture. Our bodies rely on the evaporation of
moisture from our skin for cooling. The lower the relative humidity, the easier it is for moisture to evaporate from our
skin and the cooler we feel.

You may have heard of the heat index. The chart below lists how hot a given temperature will feel to us in various
relative-humidity levels.
If the relative humidity is 100 percent, we feel much hotter than the actual temperature indicates because our sweat
does not evaporate at all. If the relative humidity is low, we feel cooler than the actual temperature because our sweat
evaporates easily; we can also feel extremely dry.

Low humidity has at least three effects on human beings:

 It dries out your skin and mucous membranes. If your home has low humidity, you will notice things like chapped
lips, dry and itchy skin, and a dry sore throat when you wake up in the morning. (Low humidity also dries out plants
and furniture.)
 It increases static electricity, and most people dislike getting sparked every time they touch something metallic.
 It makes it seem colder than it actually is. In the summer, high humidity makes it seem warmer than it is because
sweat cannot evaporate from your body. In the winter, low humidity has the opposite effect. If you take a look at the
chart above, you'll see that if it is 70 degrees F (21 degrees C) inside your home and the humidity is 10 percent, it
feels like it is 65 degrees F (18 degrees C). Simply by bringing the humidity up to 70 percent, you can make it feel 5
degrees F (3 degrees C) warmer in your home.
Since it costs a lot less to humidify the air than to heat it, a humidifier can save you a lot of money!

For best indoor comfort and health, a relative humidity of about 45 percent is ideal. At temperatures typically found
indoors, this humidity level makes the air feels approximately what the temperature indicates, and your skin and lungs
do not dry out and become irritated.

Most buildings can not maintain this level of humidity without help. In the winter, relative humidity is often much lower
than 45 percent, and in the summer it is sometimes higher.

Weather and Humidity

Here's what happens in winter to make it feel so dry in our houses. Let's say that the outdoor temperature is 0
degrees C, or 32 degrees F. The maximum amount of water that a cubic meter of air can hold at this temperature is 5
grams. Now you bring this cubic meter of air inside and heat it to 25 degrees C or 77 degrees F. The relative humidity
is only 23 percent:

5 grams of water in the air / 22 grams possible


= 23 percent relative humidity
It gets worse as the temperature outside falls lower. This is why the air inside any heated building in the winter feels
so dry. Any time the temperature outside is below freezing, relative humidity inside will be below 20 percent unless
you do something to increase the humidity.

The outside air might have a comfortable level of humidity,


but when that air is heated, the relative humidity drops,
causing the air to be very dry inside the house.

During the dry months, a humidifier can help maintain a comfortable level of humidity. Let's take a look at a simple
humidifier.

Inside a Humidifier
The most common type of humidifier is called an evaporative humidifier. This type of humidifier is actually quite
simple and, for the most part, self-regulating. A reservoir holds cold water and dispenses it into a basin. A wicking
filter absorbs the water from the basin. A fan then blows air through the moistened filter.
Your browser does not support JavaScript or it is disabled.

As the air passes through the filter, it evaporates some of the water there. The higher the relative humidity, the harder
it is to evaporate water from the filter, which is why a humidifier is self-regulating -- as humidity increases, the
humidifier's water-vapor output naturally decreases.

Sometimes an evaporative humidifier will be hooked up to the heating and cooling system of a house or building.
These systems work in a similar way: A metal mesh or screen is located in the duct coming from the furnace and/or
air conditioner; water from the building's pipes flows down the screen; as air coming from the duct blows across the
screen, it picks up moisture.

The most common humidifier, an "evaporative", "cool mist", or "wick humidifier", consists of
just a few basic parts: a reservoir, wick and fan.

The wick is a filter that absorbs water from the reservoir and provides a larger surface area for it
to evaporate from. The fan is adjacent to the wick and blows air onto the wick to aid in the
evaporation of the water. Evaporation from the wick is dependent on relative humidity. A room
with low humidity will have a higher evaporation rate compared to a room with high humidity.
Therefore, this type of humidifier is self-regulating: As the humidity of the room increases, the
water vapor output naturally decreases. These wicks become moldy if they are not dried out
completely between fillings, and become filled with mineral deposits over time. They regularly
need rinsing or replacement—if this does not happen, air cannot pass through them, and the
humidifier stops humidifying the area it is in and the water in the tank remains at the same level.

Types of Humidifiers
There are many different ways to raise the humidity in your home. For example, you can put a pan of water on the
stove or on the radiator, or you hang wet towels near a heater duct. But most people use a mechanical humidifier to
do the job. Here are the four most popular technologies:

 Steam
KAZ V150 steam vaporizer

Often referred to as a "vaporizer," a steam humidifier boils water and releases the warm steam into the room. This is
the simplest, and therefore the least expensive, technology for adding moisture to the air. You can find inexpensive
impeller models for less than $10 at discount stores. Another advantage of this technology is that you can use a
medicated inhalant with the unit to help reduce coughs.

 Impeller

KAZ V400 impeller humidifier

In this humidifier, a rotating disc flings water at a comb-like diffuser. The diffuser breaks the water into fine droplets
that float into the air. You normally see these droplets as a cool fog exiting the humidifier.

 Ultrasonic

KAZ 5520 ultrasonic humidifier

An ultrasonic humidifier uses a metal diaphragm vibrating at an ultrasonic frequency, much like the element in a high-
frequency speaker, to create water droplets. An ultrasonic humidifier is usually silent, and also produces a cool fog.

 Wick/Evaporative System
KAZ V3500 evaporative humidifier

The wick system uses a paper, cloth or foam wick or sheet to draw water out of the reservoir. A fan blowing over the
wick lets the air absorb moisture. The higher the relative humidity, the harder it is to evaporate water from the filter,
which is why this type of humidifier is self-regulating -- as humidity increases, the humidifier's water-vapor output
naturally decreases.

Here are some things to keep in mind as you are weighing the advantages and disadvantages of the different
technologies:

 Steam vaporizers can be dangerous around children because they can cause burns. They also have the highest
energy costs. However, there are no bacterial or mineral concerns with this technology.

 Impeller and ultrasonic designs have low energy costs but raise two concerns. First, if the water gets stagnant, these
designs will spray the stagnant water, and any bacteria it contains, into your home. This is why it is important to clean
the tank regularly and refill it with clean water when you haven't been running it. Many high-end ultrasonic units
therefore have antibacterial features built in. For example, some units use ultraviolet light to kill bacteria.

The second concern is minerals in the water. Impeller and ultrasonic designs send these minerals into the air. If the
water in your area contains a lot of minerals, you will notice them as dust. The EPA does not issue health warnings
about minerals in the air, but does recommend using low-mineral water (such as distilled water) in your humidifier.
Many ultrasonic models feature a demineralization cartridge that filters minerals out of the water to prevent the dust.

 Some humidifiers monitor the relative humidity of the air and will turn on and off as appropriate to maintain a preset
level.

 Humidifiers can be installed as small portable room units, or they can be integrated into your furnace for full-house
humidity control.

If you are interested in tracking your home's humidity, an inexpensive hygrometer will show you the relative humidity
in your house. You may be surprised to learn how low it is!

 Vaporizer (Steam Humidifier) (Warm Mist Humidifier) — Boils water, releasing steam and
moisture into the air. A medicated inhalant can also be added to the steam vapor to help reduce
coughs. Vaporizers may be more healthful than cool mist types of humidifiers because steam is
less likely to convey mineral impurities or microorganisms from the standing water in the
reservoir.[1] Boiling water requires significantly more energy than other techniques. The heat
source in poorly-designed humidifiers can overheat, causing the product to melt, leak, and start
fires.[2]
 Impeller Humidifier (Cool Mist Humidifier) — A rotating disc flings water at a diffuser, which
breaks the water into fine droplets that float into the air.
 Ultrasonic Humidifier — A metal diaphragm vibrating at an ultrasonic frequency creates water
droplets that silently exit the humidifier in the form of a cool fog. Unlike the humidifiers that boil
water, these water droplets contain any impurities that are in the reservoir, including minerals
from hard water (which then forms a white dust on nearby objects), and pathogens growing in
the stagnant tank. Ultrasonic Humidifiers should be cleaned regularly to avoid bacterial
contamination which may be projected into the air.
 hydro-pneumatic capillary system Humidifier (Non Electric Humidifier) A water powered
technology that uses no electricity at all to power the unit. Advanced valve and capillary system.

Impeller and ultrasonic humidifiers do not selectively put water in the air, they also add any
suspended material in the water to the air such as microorganisms and minerals. The amount of
minerals and other materials can be greatly reduced by using distilled water, though no water is
absolutely pure. Filters may also reduce the amount of material but the EPA warns, "the ability
of these devices to remove minerals may vary widely."[1] Depending on the volume, this dust
may have negative health effects. Wick humidifiers trap the mineral deposits in the wick;
vaporizer types tend to collect minerals on or around the heating element and require regular
cleaning with vinegar or citric acid to control buildup.

For buildings with a forced-air furnace, a humidifier may be installed into the furnace. They can
also protect wooden objects, antiques and other furnishings which may be sensitive to damage
from overly dry air. In colder months, they may provide substantial energy savings, since as
humidity increases, occupants feel warm at a lower temperature. Bypass humidifiers are
connected between the heated and cold air return ducts, using the pressure difference between
these ducts to cause some heated air to make a bypass through the humidifier and return to the
furnace. The humidifier should usually be disabled during the summer months if air conditioning
is used; air conditioners partially function by reducing indoor humidity. Common styles:

 Drum style (bypass): A pipe brings water directly to a reservoir (a pan) attached to the furnace.
The water level in the pan is controlled by a float valve, similar to a small toilet tank float. The
wick is typically a foam pad mounted on a drum and attached to a small motor; hot air enters
the drum at one end and is forced to leave through the sides of the drum. When the hygrostat
calls for humidity, the motor is turned on causing the drum to rotate slowly through the pan of
water and preventing the foam pad from drying out.

Advantages include:

 Low cost
 Inexpensive maintenance (drum-style pads are cheap and readily available)[citation needed]

Disadvantages include:

 Requirement for frequent (approximately monthly) inspections of cleanliness and pad


condition
 Water evaporation even when humidification is not required (due to the pan of water
which remains exposed to a high velocity air stream)
 Mold growth in the pan full of water (this problem is exacerbated by the large quantity
of air, inevitably carrying mold spores, passing through the humidifier whether in use or
not).

For the latter reason especially, drum-style humidifiers should always be turned off at the water
supply during summer (air conditioning) months, and should always be used with high quality
furnace air filters (MERV ratings as high as possible to ensure small numbers of mold spores
reaching the humidifier's pan) when the water supply is turned on.

 Disc Wheel Style (bypass): Very similar in design to the drum style humidifiers, this type of
furnace humidifier replaces the foam drum with a number of plastic discs with small grooves on
both sides. This allows for a very large evaporative surface area, without requiring a great deal
of space. Unlike the drum style humidifiers, the disc wheel does not need replacing.

Advantages include:

 Very low maintenance (basin of humidifier should be cleaned out periodically, unless
automatic flushing device is installed)
 No regular replacement of parts necessary
 Higher output due to large evaporative surface area
 Can be installed in hard water situations
 Maintains efficiency throughout lifespan

Disadvantages include:

 Higher price
 Water evaporation even when humidification is not required (due to the pan of water
which remains exposed to a high velocity air stream)

 Bypass Flow-Through Style (bypass - also known as "biscuit style" or many other, similar variant
names): A pipe brings water directly to an electrically-controlled valve at the top of the
humidifier. Air passes through an aluminum "biscuit" (often called a pad; using the term
"biscuit" to emphasize the solid rather than foamy form) which is similar to a piece of extremely
coarse steel wool. The biscuit has a coating of a matte ceramic, resulting in an extremely large
surface area within a small space. When the hygrostat calls for humidity, the valve is opened
and causes a spray of water onto the biscuit. Hot air is passed through the biscuit, causing the
water to evaporate from the pad and be carried into the building.

Advantages include:

 Reduced maintenance (new biscuit only when clogged with dust or mineral deposits,
typically once per year)
 Lack of a pan of potentially stagnant water to serve as a breeding ground for mold as
with a drum-style humidifier
 No incidental humidification caused by a constantly-replenished pan of water in a high
velocity air stream
 Reduced requirement for expensive air filters
 Uses little electricity

Disadvantages include:

 A somewhat higher purchase price


 Manufacturer and model-specific replacement biscuits versus the relatively generic
drum-style pads
 A portion of the water supplied to the unit is not evaporated. This can generate a
considerable amount of waste water, and does require connection to a drain.

 Spray Mist Type: A pipe, usually a small plastic tube, brings water directly to an electrically-
controlled valve in the humidifier. Water mist is sprayed directly into the supply air, and the mist
is carried into the premises by the air flow.

Advantages include:

 Low cost.
 Simpler than bypass types to install - single cut hole for installation, no additional
ducting.
 Uses little electricity.
 Small, compact unit - fits where other types cannot. (Approx 6 inches square.)
 Because it does not require bypass ducting it does not undermine the pressure
separation (and therefore, blower efficiency) of the return and supply ducts.
 Does not require use of moisture pads (on-going expense).
 Highly efficient usage of water. Does not generate waste water and does not require
separate connection to a drain.
 Requires little maintenance. Periodic cleaning of nozzle may be required in hard water
environments.
 Lack of a pan of potentially stagnant water to serve as a breeding ground for mold as
with a drum-style humidifier.

Disadvantages include:

 Spray nozzle can become clogged in hard water situations, necessitating the use of
water filter, periodic cleaning of nozzle, or nozzle replacement.

If the relative humidity is over 60% vol, then the use of a humidifier can allow the reproduction
of dust mites or the growth of harmful mold, which can be especially harmful for children and
the elderly. The relative humidity should be kept between 40% and 60%.[3] Can also cause
Hypersensitivity pneumonitis (humidifier lung).[4]

Some humidifiers now use Microban technology to reduce mold and bacteria growth within the
humidifier.
The EPA provides detailed information of the risks as well as recommended maintenance
procedures[1]. If the tap water contains a lot of minerals, also known as hard water, then the
ultrasonic or impeller humidifiers will produce a "white dust" (calcium is the most common
mineral in tap water), which usually spreads over furniture, and is attracted to static electricity
generating devices such as CRT monitors. The white dust can usually be prevented by using
distilled water and a demineralization cartridge in ultrasonic humidifiers

Humidistat

A controller that measures and controls relative humidity. A humidistat may be used to control
either humidifying or dehumidifying equipment by the regulation of electric or pneumatic
switches, valves, or dampers.

An electronic humidistat includes a sensing element and a relay amplifier. The sensing element
consists of alternate metal conductors on a small flat plate. An increase or decrease of the
relative humidity causes a decrease or increase in the electrical resistance between the two sets of
conductors and the change in resistance is measured by the relay amplifier.

LM34/LM35 Precision Monolithic Temperature Sensors:

INTRODUCTION:

Most commonly-used electrical temperature sensors are difficult to apply. For example, thermocouples
have low output levels and require cold junction compensation. Thermistors are nonlinear. In addition,
the outputs of these sensors are not linearly proportional to any temperature scale. Early monolithic
sensors, such as the LM3911, LM134 and LM135, overcame many of these difficulties, but their outputs
are related to the Kelvin temperature scale rather than

the more popular Celsius and Fahrenheit scales. Fortunately, in 1983 two I.C.'s, the LM34 Precision
Fahrenheit Temperature Sensor and the LM35 Precision Celsius Temperature Sensor, were introduced.
This application note will discuss the LM34, but with the proper scaling factors can easily be adapted to
the LM35. The LM34 has an output of 10 mV/ 0F with a typical nonlinearity of only g0.35 0F over a b50 to
a3000F temperature range, and is accurate to within g0.4 0F typically at room temperature (77 0F). The
LM34's low output impedance and linear output characteristic make interfacing with readout or control
circuitry easy. An inherent strength of the LM34 over other currently available temperature sensors is
that it is not as susceptible to large errors in its output from low level leakage currents. For instance,
many monolithic temperature sensors have an output of only 1 mA/ 0K. This leads to a 10K error for only
1 m-Ampere of leakage current. On the other hand, the LM34 may be operated as a current mode
device providing 20 mA/0F of output current. The same 1 mA of leakage current will cause an error in
the LM34's output of only 0.050F (or 0.030K after scaling). Low cost and high accuracy are maintained by
performing trimming and calibration procedures at the wafer level. The device may be operated with
either single or dual supplies. With less than 70 mA of current drain, the LM34 has very little self-heating
(less than 0.20F in still air), and comes in a TO-46 metal can package, a SO-8 small outline package and a
TO-92 plastic package.

CIRCUIT OPERATION:

Since the two circuits are very similar, only the LM34 Fahrenheit temperature sensor will be discussed in
greater detail. The circuit operates as follows:

Transistor Q1 has 10 times the emitter area of transistor Q2, and therefore, one-tenth the
current density. From Figure 4 , it is seen that the difference in the current densities of Q1 and Q2 will
develop a voltage which is proportional to absolute temperature across resistor R1. At 77 0F this voltage
will be 60 mV. As in the Kelvin temperature sensor, an amplifier, A1, is used to insure that this is the
case by servoing the base of transistor Q1 to a voltage level, VPTAT, of DVBE c n. The value of n will be
trimmed during calibration of the device to give the correct output for any temperature.
For purposes of discussion, suppose that a value of VPTAT equal to 1.59V will give a correct output of
770 mV at 770F. Then n will be equal to VPTAT/DVBE or 1.59V/60 mV e 26.5, and VPTAT will have a
temperature coefficient (temp-co) of:
Subtracting two diode drops of 581 mV (at 770F) with tempcos of b2.35 mV/0C each, will result in
a voltage of 428 mV with a tempco of 10 mV/§C at the non-inverting input of amplifier A2. As shown,
amplifier A2 has a gain of 1.8 which provides the necessary conversion to 770 mV at 77F (25C). A further
example would be if the temperature were 32§F (0 0C), then the voltage at the input of A2 would be 428
mV±(10 mV/§C) (25§C) e 0.178, which would give VOUT e (0.178) (1.8) e 320 mV Ð the correct value for
this temperature.

ZigBee

ZigBee is a specification for a suite of high level communication protocols using small, low-
power digital radios based on an IEEE 802 standard for personal area networks. ZigBee devices
are often used in mesh network form to transmit data over longer distances, passing data through
intermediate devices to reach more distant ones. This allows ZigBee networks to be formed ad-
hoc, with no centralized control or high-power transmitter/receiver able to reach all of the
devices. Any ZigBee device can be tasked with running the network.

ZigBee is targeted at applications that require a low data rate, long battery life, and secure
networking. ZigBee has a defined rate of 250 kbit/s, best suited for periodic or intermittent data
or a single signal transmission from a sensor or input device. Applications include wireless light
switches, electrical meters with in-home-displays, traffic management systems, and other
consumer and industrial equipment that requires short-range wireless transfer of data at relatively
low rates. The technology defined by the ZigBee specification is intended to be simpler and less
expensive than other WPANs, such as Bluetooth or Wi-Fi.

ZigBee is a low-cost, low-power, wireless mesh network standard. The low cost allows the technology to
be widely deployed in wireless control and monitoring applications. Low power-usage allows longer life
with smaller batteries. Mesh networking provides high reliability and more extensive range. ZigBee chip
vendors typically sell integrated radios and microcontrollers with between 60 KB and 256 KB flash
memory.

ZigBee operates in the industrial, scientific and medical (ISM) radio bands; 868 MHz in Europe, 915 MHz
in the USA and Australia and 2.4 GHz in most jurisdictions worldwide. Data transmission rates vary from
20 to 250 kilobits/second.

The ZigBee network layer natively supports both star and tree typical networks, and generic mesh
networks. Every network must have one coordinator device, tasked with its creation, the control of its
parameters and basic maintenance. Within star networks, the coordinator must be the central node.
Both trees and meshes allows the use of ZigBee routers to extend communication at the network level.

ZigBee protocol stack

ZigBee builds upon the physical layer and medium access control defined in IEEE standard 802.15.4
(2003 version) for low-rate WPANs. The specification goes on to complete the standard by adding four
main components: network layer, application layer, ZigBee device objects (ZDOs) and manufacturer-
defined application objects which allow for customization and favor total integration. Besides adding
two high-level network layers to the underlying structure, the most significant improvement is the
introduction of ZDOs. These are responsible for a number of tasks, which include keeping of device
roles, management of requests to join a network, device discovery and security. ZigBee is not intended
to support power line networking but to interface with it at least for smart metering and smart
appliance purposes.

Because ZigBee nodes can go from sleep to active mode in 30 ms or less, the latency can be low and
devices can be responsive, particularly compared to Bluetooth wake-up delays, which are typically
around three seconds. Because ZigBee nodes can sleep most of the time, average power consumption
can be low, resulting in long battery life.

UART Data Flow

Serial Data Devices


that have a UART interface can connect directly to the pins of the RF module as
shown in the figure below.

Data enters the module UART through the DI pin (pin 3) as an asynchronous serial signal. The sig-nal
should idle high when no data is being transmitted. Each data byte consists of a start bit (low), 8 data
bits (least significant bit first) and a stop bit (high). The following figure illustrates the serial bit pattern of
data passing through the module. The module UART performs tasks, such as timing and parity checking,
that are needed for data communications. Serial communications depend on the two UARTs to be
configured with compati-ble settings (baud rate, parity, start bits, stop bits, data bits) Both the module
and host (PC) settings can be viewed and adjusted using MaxStream's proprietary X-CTU Software. Use
the "PC Settings" tab to configure host settings. Use the "Terminal" or "RF Module Configuration" tab to
configure the module settings.

ZigBee Module

This is an FSK Transceiver module, which is designed using the ChipconIC(CC2500). It is a true single-chip
transceiver, It is based on 3 wire digital serial interface and an entire Phase-Locked Loop (PLL) for precise
local oscillator generation .so the frequency could be setting. It can use in UART / NRZ / Manchester
encoding / decoding. It is a high performance and low cost module. It gives 30 meters range with
onboard antenna. In a typical system, this trans-receiver will be used together with a microcontroller. It
provides extensive hardware support for packet handling, data buffering, burst transmissions ,clear
channel assessment, link quality indication and wake on radio . It can be used in 2400-2483.5 MHz
ISM/SRD band systems. (eg. RKE-two way Remote Keyless Entry, wireless alarm and security systems,
AMR-automatic Meter Reading, Consumer Electronics, Industrial monitoring and control, Wireless Game
Controllers, Wireless Audio/Keyboard/Mouse). It could easily to design product requiring wireless
connectivity. It can be used on wireless security system or specific remote-control function and others
wireless system.Operating Range is 30 meters without requiring any external antenna.
Features
Low power consumption.
Integrated bit synchronizer.
Integrated IF and data filters.
High sensitivity (type -104dBm)
Programmable output power -20dBm~1dBm
Operation temperature range : -40~+85 deg C
Operation voltage: 1.8~3.6 Volts.
Available frequency at : 2.4~2.483 GHz
Digital RSSI

Pin Details
1 VCC Power 1.8~3.6V power supply
2 SI - digital Input - Serial configuration interfaces, data input
3 SCLK - Digital Input - Serial configuration interface, clock input
4 SO - Digital Output - Serial configuration interface, clock input
Optional general output pin when CSN is high
5 GDO2 - Digital I/O - Digital output pin for general use Test signals
FIFO status signals

Clear Channel indicator

Clock output, down-divided from Xosc

Serial output RX data

6 GND - Ground
7 GDO0 - Digital I/O Digital output pin for general use:
Test signals
FIFO status signals
Clear Channel indicator
Clock output RX data
Serial output RX data
Serial input TX data
Also used as analog test I/O for prototype/production testing
8 CSn Digital Input Serial configuration interface ,chip select
ZigBee protocols are intended for embedded applications requiring low data rates and low power
consumption. The resulting network will use very small amounts of power — individual devices must
have a battery life of at least two years to pass ZigBee certification.

Typical application areas include:

 Home Entertainment and Control — Home automation, smart lighting, advanced temperature
control, safety and security, movies and music
 Wireless sensor networks — Starting with individual sensors like Telosb/Tmote and Iris from
Memsic
 Industrial control
 Embedded sensing
 Medical data collection
 Smoke and intruder warning
 Building automation

MPLAB IDE

MPLAB Integrated Development Environment (IDE) is a free, integrated toolset


for the development of embedded applications employing Microchip's PIC® and
dsPIC® microcontrollers. MPLAB IDE runs as a 32-bit application on MS Windows®,
is easy to use and includes a host of free software components for fast application
development and super-charged debugging. MPLAB IDE also serves as a single,
unified graphical user interface for additional Microchip and third party software
and hardware development tools. Moving between tools is a snap, and upgrading
from the free software simulator to hardware debug and programming tools is
done in a flash because MPLAB IDE has the same user interface for all tools.

MPLAB IDE features include:

FLEXIBLE CUSTOMIZABLE PROGRAMMER'S TEXT EDITOR:

Fully integrated debugging with right mouse click menus for breakpoints, trace
and editor functions
Tabbed editor option or separate source windows
Recordable macros
Context sensitive color highlighting for assembly, C and BASIC code readability
Mouse over variable to instantly evaluate the contents of variables and registers
Set breakpoints and trace points directly in editor to instantly make changes and
evaluate their effects
Graphical project manager
Version control support for MS Source Safe, CVS, PVCS, Subversion

FREE COMPONENTS:

Programmer’s text editor


MPLAB SIM, high speed software simulator for PIC and dsPIC devices with
peripheral simulation, complex stimulus injection and register logging
Full featured debugger
MPASM™ and MPLINK for PIC MCUs and dsPIC DSC devices
HI-TECH C PRO for PIC10/12/16 MCU Families running in lite mode
CCS PCB C Compiler
Labcenter Electronic’s Proteus VSM spice simulator
Many Powerful Plug-Ins including
○ AN851 Bootloader programmer
○ AN901 BLDC Motor Control Interface
○ AN908 ACIM Tuning Interface
○ KeeLoq support

SIMPLE, POWERFUL SOURCE LEVEL DEBUGGING:


Auto alignment of breakpoints after source code modification
Mouse-over variable inspection
Drag and drop variables to watch windows
Watch variables, structures and arrays
Mixed source code/disassembly view
Stack symbolic return label display
Automatic single-step "animate" feature
Pass counts and break on PIC18F, PIC24 and dsPIC file register R/W for MPLAB
ICD 2
Step-Out-Of function
Custom hot keys
Powerful simulator stimulus generator
Trace to source correlation to compare real time data collected with original
source code and comments

BUILT IN SUPPORT FOR HARDWARE AND ADD-ON COMPONENTS:

MPLAB C Compilers (free student editions available for download)


MPLAB REAL ICE™ in-circuit emulator
MPLAB ICD 2 and MPLAB ICD 3 in-circuit debuggers and engineering
programmers for selected Flash devices
PICkit 2 and PICkit 3 Debug Express economy debug/programmers
PICSTART Plus development programmer
MPLAB PM3 device programmer
Third Party tools, including HI-TECH, IAR, Byte Craft, B. Knudsen, CCS, Micrium,
microEngineering Labs, Labcenter, MATLAB, Segger
A host of low cost starter boards, demonstration and evaluation kits

CCS COMPILER

The PCB, PCM, and PCH are separate compilers. PCB is for 12-bit opcodes, PCM
is for 14-bit opcodes, 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.

File Formats

The compiler can output 8-bet hex, 16-bit hex, and binary files. Three listing
formats are available:

1) Standard format resembles the Microchip tools, and may be required by


other Third-Party tools.

2) Simple format is generated by compiler and is easier to read.

3) Symbolic format uses names versus addresses for registers. The debug
files may be output as Microchip .COD file, Advanced Transdata .MAP file,
expanded .COD file for CCS debugging or MPLAB 7.xx .COF file. All file
formats and extensions may be selected via Options File Associations option
in Windows IDE.

.C This is the source file containing user C source code.

.H These are standard or custom header files used to define pins, register,
register bits, functions and preprocessor directives.

.PJT This is the project file which contains information related to the project.
.LST This is the listing file which shows each C source line and the associated
assembly code generated for that line.

.SYM This is the symbol map which shows each register location and what
program variables are stored in each location.

.STA The statistics file shows the RAM, ROM, and STACK usage. It provides
information on the source codes structural and textual complexities using
Halstead and McCabe metrics.

.TRE The tree file shows the call tree. it details each function and what
functions it calls along with the ROM and RAM usage for each function.

.HEX The compiler generates standard HEX files that are compatible with all
programmers.

.COF This is a binary containing machine code and debugging information.

.COD This is a binary file containing debug information.

.RTF The output of the Documentation Generator is exported in a Rich Text


File format which can be viewed using the RTF editor or wordpad.

.RVF The Rich View Format is used by the RTF Editor within the IDE to view the
Rich Text File.
.DGR The .DGR file is the output of the flowchart maker.

.ESYM This file is generated for the IDE users. The file contains Identifiers and
Comment information. This data can be used for automatic
documentation generation and for the IDE helpers.

.OSY This file is generated when the compiler is set to export a relocatable
M object file. This file contains a list of symbols for that object.
PIC KIT 2

The PICkit™ 2 Development Programmer/Debugger is a low-cost development


tool with an easy to use interface for programming and debugging Microchip’s
Flash families of microcontrollers. The full featured Windows ® programming
interface supports baseline (PIC10F, PIC12F5xx, PIC16F5xx), midrange (PIC12F6xx,
PIC16F), PIC18F, PIC24, dsPIC30, dsPIC33, and PIC32 families of 8-bit, 16-bit, and
32-bit microcontrollers, and many Microchip Serial EEPROM products.

With Microchip’s powerful MPLAB Integrated Development Environment (IDE)


the PICkit™ 2 enables in-circuit debugging on most PIC® microcontrollers. In-
Circuit-Debugging runs, halts and single steps the program while the PIC
microcontroller is embedded in the application. When halted at a breakpoint, the
file registers can be examined and modified.

The PICkit 2 — introduced in May 2005 — replaced the PICkit 1. The most
notable difference between the two is that the PICkit 2 has a separate
programmer/debugger unit which plugs into the board carrying the chip to be
programmed, whereas the PICkit 1 was a single unit. This makes it possible to use
the programmer with a custom circuit board via an In Circuit Serial Programming
(ICSP) header. This feature is not intended [3] for so-called "production"
programming, however the PICkit 2 uses an internal PIC18F2550 with FullSpeed
USB. The latest PICkit 2 firmware allows the user to program and debug most of
the 8 and 16 bit PICmicro and dsPIC members of the Microchip product line.

The PICkit 2 is open to the public, including its hardware schematic, firmware
source code (in C language) and application programs (in C# language). End users
and third parties can easily modify both the hardware and software for enhanced
features. e.g. GNU/Linux version of PICKit 2 application software, DOS style
CMD support, etc.The PICkit 2 has a programmer-to-go (PTG) feature, which can
download the hex file and programming instructions into on-board memory (128K
byte I2C EEPROM or 256K byte I2C EEPROM), so that no PC is required at the
end application.

The Microchip version of PICkit 2 has a standard 128K byte memory. 256K byte
memory can be achieved by modifying the hardware or from third
party.Additionally, a 500 kHz three-channel logic analyser and a UART tool are
built into the PICKit 2. These features are missing from the PICkit 3.Since release
of V2.61, PICkit 2 PC software now support maximum 4M bytes of memory for
programmer-to-go feature. This modification makes the PICKit 2 support 8x more
memory than the PICKit 3. This enhancement has been contributed by Au Group
Electronics and the PICkit 2 firmware is also reported to be submitted to Microchip
PICkit 2 team in the middle of March 2009. Hopefully this enhancement will be
integrated into future firmware releases too
Circuit diagram
Circuit explanation
PIC16F877A:

PIC16F877A is a 40 Pin DIP pack IC with 33 I/O pins. Out of which 8 pins can be used either as Digital I/O
pins or Analog Input pins. The micro controller is having 5 ports Port A, Port B, Port C, Port D and Port E.
Here Port A consists of 6Pins and can be used as Analog Pins and Digital Pins, in the same way Port E
consists of 3Pins all of them can either be used as Analog Pins or Digital Pins. The Port pins of Port D are
connected to LCD pins. RD4 to RD7 as data pins and RD0 to RD2 as control pins. The Pins of Port B are
connected to relay drivers, which in turn drives the relays. The Pins 13 and 14 are connected to
Oscillators. This Oscillator provides required clock reference for the PIC micro controller. Either Pins 11
and 12 or 31 and 32 can be used as power supply pins. Pins 25 and 26 of Port C are used for serial Port
communications; these pins are interfaced with MAX232 for PC based communications. Pins 37,38,39
and 40 are used for In-Circuit Debugger Operations, with which the hex code is downloaded to the Chip.
Pin 33 is used as external Interrupt Pin. Pin 1 is used as Reset Pin. This Pin is connected to Vcc through a
resistor.

LCD_PIC:

The LCD we have used in this project is HD1234. This is an alphanumeric type of
LCD with 16 pins. Of which Pins 7 to 14 are used as data pins, through which an
8-bit data can be input to the LCD. These Pins are connected to the Port 0 of Micro
controller. There are 3 control pins RS (Pin-4), RW (Pin-5) and EN (Pin-6). The
RS pin is connected to the 28th Pin of micro controller. The RW pin is usually
grounded. The Enable pin is connected to 27th Pin. The LCD has two Rows and 16
Columns. The LCD is powered up with 5V supply connected to Pins 1(Gnd) and
2(Vcc). The Pin 3 is connected to Vcc through a Potentiometer. The potentiometer
is used to adjust the contrast level. Here in our project we use the PIC controller in
4-bit mode. Here only 4 data pins are connected and are used as Data Port.

MAX 232:

The MAX232 family of line drivers/receivers is intended


for all EIA/TIA-232E and V.28/V.24 communications
interfaces, particularly applications where ±12V is not
available. The Max-232 can simultaneously be interfaced
with two channels. This is a 16-pin DIP pack IC. Here
five 10uF capacitors are connected to the IC for level
conversions. The Pin 10 from the micro controller is
connected to pin 25 of the Max-232. The Pin 14 of Max-
232 is connected to Pin 26 of the micro controller. Pins 25
and 26 are connected to the PC’s Serial Port. The
connection between the micro controller and the PC is a
Null Modem configuration. (Only Tx, Rx and Ground
pins are interfaced).

POWER SUPPLY:
When AC is applied to the primary winding of the power transformer it can either
be stepped down or up depending on the value of DC needed. In our circuit the
transformer of 230v/15-0-15v is used to perform the step down operation where a
230V AC appears as 15V AC across the secondary winding. In the power supply
unit, rectification is normally achieved using a solid-state diode. Diode has the
property that will let the electron flow easily in one direction at proper biasing
condition. As AC is applied to the diode, electrons only flow when the anode and
cathode is negative. Reversing the polarity of voltage will not permit electron flow.A
commonly used circuit for supplying large amounts of DC power is the bridge
rectifier. A bridge rectifier of four diodes (4*IN4007) is used to achieve full wave
rectification. Two diodes will conduct during the negative cycle and the other two
will conduct during the positive half cycle. The DC voltage appearing across the
output terminals of the bridge rectifier will be somewhat less than 90% of the
applied RMS value. Filter circuits, which is usually capacitor acting as a surge
arrester always follow the rectifier unit. This capacitor is also called as a decoupling
capacitor or a bypassing capacitor, is used not only to ‘short’ the ripple with
frequency of 120Hz to ground but also to leave the frequency of the DC to appear at
the output. The voltage regulators play an important role in any power supply unit.
The primary purpose of a regulator is to aid the rectifier and filter circuit in
providing a constant DC voltage to the device. Power supplies without regulators
have an inherent problem of changing DC voltage values due to variations in the
load or due to fluctuations in the AC liner voltage. With a regulator connected to the
DC output, the voltage can be maintained within a close tolerant region of the
desired output. IC7812 and 7805 are used in this project for providing +12v and +5v
DC supply.
Conclusion:
The project “project title” has been completed successfully and the output
results are verified. The results are in line with the expected output. The project
has been checked with both software and hardware testing tools. In this work
“I/O devices” are chosen are proved to be more appropriate for the intended
application. The project is having enough avenues for future enhancement. The
project is a prototype model that fulfills all the logical requirements. The project
with minimal improvements can be directly applicable for real time applications.
Thus the project contributes a significant step forward in the field of “Project
Domain”, and further paves a road path towards faster development s in the
same field. The project is further adaptive towards continuous performance and
peripheral up gradations. This work can be applied to variety of industrial and
commercial applications.

You might also like