E2em003 Report

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 174

CHAPTER-1

INTRODUCTION

INTRODUCTION

1
The security management system is described in this paper. System structure of wireless security adopts
two level structures. The first level is consist of some remote controllers and a launcher ,which is include
wireless burglar alarm, fault alarm, power-off alarm, self-checking alarm and some wireless night patrol
point. The second level is consisting of a wireless receiver and a wireless alarm controller in the system.

The core of a wireless receiver and some launchers adopt advanced embedded technology. It
can improve the level of oilfield’ security, enhance it’s the security checking, strengthen the
management of it’s the digitalization and informatization; It has the important significance and social
and economic benefits for the dependability and the controllability of remote communication.

The security management system for oilfield using wireless communication. It consists of two
levels. The first level is consist of a launcher and some remote controllers ,which include wireless burglar
alarm, fault alarm, power-off alarm, self-checking alarm and some wireless night patrol point. The
launcher, which is more than 1W, is a wireless receiver, another is a wireless transmitter, it receives the
information of the front-end alarm equipments and can send message by the wireless transmitter.

The second level is consisting of a wireless receiver and a wireless alarm controller in the
system. Theft sensor is used to detect if there is any theft occurred by human and the level sensor used
for the filling of the oilfield and also two GAS sensors are used for detecting the hazards gas present in
the oilfield. The function of a wireless receiver can receive the information of some front end launchers
and send it to PC through MAX232 communication.

This system can improve the level of oilfield’ security, enhance the security checking, strengthen
the management of digitalization and informatization, The method could solve problems with highly
efficient and rapid, also could reduce the loss of country with effective, So It has the important
significance and social and economic benefits for the dependability and the controllability of remote
communication.

2
CHAPTER-2

LITERATURE SURVEY

3
LITERATURE SURVEY

2.1 Introduction

Most oil pumping units (OPUs) have been using manual control in the oilfield.
This existing oil-pumping system,
a high power-consuming process, has the incapability of OPU’s structural health
monitoring. In this paper, a sensor network based intelligent control is proposed for
power economy and efficient oilwell health monitoring. The proposed sensor
network consists of three-level sensors: 1) several types of basic sensors, such as
load sensor, angular sensor, voltage sensor, current sensor and oil pressure sensor,
which are the first level sensors (FLS), are used for oilwell data sensing; 2) our
developed intelligent sensors (IS), which belong to the second level sensor, are
designed mainly
for an oilwell’s data elementary processing, main fault alarm/indication,typical
data storage/indication, data/status transmission up to the third level sensor (TLS),
data/status transmission between IS, and comman d transmission down to the OPU
motor; and3) our developed software-defined (SD) control centers with an
embedded database, i.e., the TLS, are designed for hundreds of oilwells data
storage/management, data processing, malfunction detection, malfunction
alarm/indication, stroke-adjustment command transmission down to a specific IS
for power economy and the malfunction report to the maintenance staff via global
system for mobile communications (GSM) short message service (SMS).
Experiment results at the Chinese Petroleum’s Changqing Oilfield demonstrate
our proposed sensor network based system.

From the literature survey,

4
2.2.Salient Features of the System

1. Multiple applications which is used to achieve the automatic.

2. compact.

3. Low power consumption and low cost.

BLOCK DIAGRAM

Transmitter Section

5
LEVEL SENSOR
TEMPERATURE
MIWI
SENSOR

UART
GAS SENSOR
(C02)

VOICE BOARD
ADC

ATMEL

AT89S52 RELAY

PH SENSOR

VOLTAGE SENSOR
EXHAUST FAN COOLING FAN

CURRENT SENSOR

Receiver Section

6
MIWI UART PC

Figure.2.1.Block diagram

CHAPTER-3
HARDWARE DESIGN DETAILS

7
HARDWARE DESIGN DETAILS

3.1.Hardware description

8
POWER SUPPLY:

Power supply is a reference to a source 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.

Figure 3.3 Power supply

A 230v, 50Hz Single phase AC power supply is given to a step down


transformer to get 12v supply. This voltage is converted to DC voltage using a
Bridge Rectifier. The converted pulsating DC voltage is filtered by a 2200uf
capacitor and then given to 7805 voltage regulator to obtain constant 5v supply.
This 5v supply is given to all the components in the circuit. A RC time constant
circuit is added to discharge all the capacitors quickly. To ensure the power supply
a LED is connected for indication purpose.

9
BRIDGE RECTIFIER

A bridge rectifier makes use of four diodes in a bridge arrangement to


achieve full-wave rectification. This is a widely used configuration, both with
individual diodes wired as shown and with single component bridges where the
diode bridge is wired internally.

Figure 3.4 Circuit of bridge rectifier

VOLTAGE REGULATOR:

10
LM7805: 3-Terminal 1A Positive Voltage Regulator

Figure 3.5 Diagram of voltage regulator

Features:

• Output Current up to 1A

• Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V

• Thermal Overload Protection

• Short Circuit Protection

• Output Transistor Safe Operating Area Protection

11
Figure 3.6 Block diagram of voltage regulator

Description:

The KA78XX/KA78XXA series of three-terminal positive regulator are


available in the TO-220/D-PAK package and with several fixed output voltages,
making them useful in a wide range of applications. Each type employs internal
current limiting, thermal shut down and safe operating area protection, making it
essentially indestructible. If adequate heat sinking is provided, they can deliver
over 1A output current. Although designed primarily as fixed voltage regulators,

12
these devices can be used with external components to obtain adjustable voltages
and currents.

VOLTAGE SENASOR

Introduction

The interface of various sensors to a controller like the BrainStem GP 1.0 module typically
involves either conditioning or converting voltage levels into the range the controller requires.
Many systems use A/D converters to make the sensor value relevant in a program or data logging
configuration. These converters have a fixed range of voltages they can convert from with 0-5V
being by far the most common.

Sensors often create voltages in different ranges than those required by the controllers they are
being interfaced to which requires the conversion of one voltage to another. This conversion
often breaks down into a combination one or more of three types, amplification, dividing, and
shifting.

Contents

Dividing Voltages

Voltage dividing is probably the easiest transformation you can perform on sensor outputs to
alter the value being connected to a microcontroller or other circuit.

The mathematical equivalent of what you are trying to achieve when dividing voltages is a
simple division. For instance, say you have a sensor that outputs 0-100V and you want to
convert this to 0-5V for interface to the A/D input on your BrainStem. The goal would be to
create a 20:1 ratio of voltage which means dividing the original sensor output voltage by a factor
of 20. So we need a small circuit that will accomplish the following pictorially:

The easiest way to accomplish this division is using a few resistors to form a voltage divider.
The resistors are wired up in series to create intermediate voltages based with the desired
division. The above example could be accomplished as follows:

13
This voltage divider uses the input as the top of the resistor ladder and ground as the bottom.
The actual division is defined by the proportion of resistance between the two resistors.

Notice the above circuit does not work out to an exact division by 20. This is because the
resistors used are commonly found resistor values. Precision resistors with exact tolerances can
be used but are often not needed since the original output of sensors typically varies. Here the
resulting output voltage is slightly below the maximum of 5V but with a reasonable A/D
converter like the 10-bit converters used in the BrainStem GP 1.0 module would still offer plenty
of dynamic range in the sensor readings.

Contents

Amplifying Voltages

Voltage amplification is required for a class of sensors that create small voltages. Often sensors
of this type are converting some sort of physical energy such as acceleration, temperature, or
other minimal physical force into a voltage. This conversion is often an inefficient conversion
and the measured energy is minimal which results in very small voltages generated by the
sensor. To make these small voltages meaningful, they must be amplified to a usable level.

The equation for amplification is the exact opposite of dividing. You want to multiply the output
voltage from a sensor to gain the full range of your A/D input or other interfaced circuit. Lets
say you have an accelerometer which measures accelerations in g (gravity) units. A sensor like
this may have a response of 312mV/g which means the sensor will generate 0.312V for each
gravity unit of force it encounters. Now, say you would like to measure up to 2 gravity units
(2g) with your detector with the full range of your 0-5V A/D converter. This means you need to
multiply the output voltage of your accelerometer by a factor of about 16 to get the desired range
and sensitivity in your measurements. So we want to accomplish the following pictorially:

Probably the most common way to multiply a voltage is using an amplifier. Here, we will use a
common Operational Amplifier (Op Amp) to multiply the voltage. These Op Amp circuits are
extremely common in electronics and there are volumes of literature devoted specifically to the

14
various characteristics and performance of each. We use one of the original versions which is
widely available and easy to interface called the 741. Here is one circuit that will amplify the
voltage by a factor of about 16:

There are some things to note about this circuit. Again, changing resistance values gives a
different voltage amplification (multiplication). The small numbers indicate the pins of the 741
package that you would connect to for this circuit (it is an 8 pin chip). Also, notice the additional
power supply which is both positive and negative. This is very common for Op Amp circuits.
Since the Op Amp is powered by a plus/minus voltage of 9V, the absolute output can at best be
9V. In practice, the output voltage will probably be slightly less.

The gain for this amplifier may not be exactly linear, depending on the input and output
voltages. This can often be hidden in the noise of the sensor and accuracy of the A/D conversion
on the other end but it should be considered. The higher the gain of an amplifier, the larger the
margin of error and noise.

Contents

Shifting Voltages

Shifting voltages can be a requirement for sensor data that are generated symmetrically about a
common (often ground) voltage. A simple example of this would be a motor acting as a
generator where spinning in one direction creates a positive voltage and spinning in the other
direction creates a negative voltage. Since most common A/D converters in microcontrollers
deal with a 0-VCC range for conversions, sensors that are symmetric about the ground voltage
reference need to be shifted into the 0-VCC range.

The equation for shifting is then then the addition or subtraction of an offset from the original
sensor's voltage. For example, if your sensor produces -2 to 2V, you would want to add 2V to
the output for reading with a common 0-5V A/D converter. This addition would result in a final
output of 0-4V which the A/D converter could then use. This conversion looks like this
pictorially:

15
This circuit is a two-stage summing amplifier using an Op-Amp chip (the 1458) that houses two
op-amps on a single chip. Notice there are some fixed values of resistors that essentially create a
voltage summing circuit. The input on one side is a resistor network that creates a fixed voltage
to sum with the input voltage. The variable resistor values change this resistor network's set
voltage. You could substitute a potentiometer for R1 and R2 to make the addition variable, by
twisting the potentiometer.

The addition circuit also requires a plus/minus 9V power supply for the op-amps. In addition, a
tap from the 5V supply used for the logic is used although this could be done with the positive
9V side as well, provided the voltages are computed correctly.

Contents

Combining Conversions

So the above conversions define addition, subtraction, multiplication, and division of a voltage.
Each of these conversions can be thought of in isolation as shown above or they can be
combined to create composite conversions. We essentially have an algebra of blocks we can use
to achieve a wide variety of overall conversions.

Say you have a sensor that creates -100 to 100V and you want to read the value with a 0-5V A/D
converter. You would need to scale down the original voltage to -2.5 to 2.5V first and then
offset the result by adding 2.5V to get the result into the desired range of 0-5V for your A/D
converter. You can chain together the conversions for such an effect which would look like this
pictorially:

16
Contents

Conversion Impurities

The above conversions all introduce impurities in the resulting signal in the form of noise, non-
linearity, and other corruptions of the original input voltage. Care must be taken to minimize the
number of stages and also to order them for reduced error. Testing and careful thought can
typically reduce these impurities to a minimum but they cannot be disregarded.

There is a general rule of thumb with regard to these introduced impurities. The more you are
changing the original voltage, the more impurities you will introduce. For instance, an
amplification of 100x would be generally more noisy than one of 2x.

Contents

Power Supply Issues

Several of these circuits require a plus/minus 9V supply for the Op Amps. This can readily be
accomplished using two standard 9V batteries. More sophisticated options include standard
power supplies, charge pumps and inverters and several other options. The 9V battery is cheap,
simple and it works well. Op Amp circuits tend to be pretty efficient so the batteries should last
quite some time.

Contents

Further Reading

The subject of sensor interfaces is vast. This article attempts to give some basics that are easy,
practical, and quick to implement. Here are two great references to consider:

 The Art of Electronics, by Horowitz and Hill


 Op Amp IC Circuits, by Forrest M. Mims III

17
Contents

Additional Information

A short workshop converting this material was held at the Colorado School of Mines (CSM).
The handout used for the class is available for download.

SensorWorkshop.pdf
125.09K Bytes

PDF Summary use in Colorado School of Mines Class

Revision History:

 2004-03-25: Page Created


 2007-03-23: Added the CSM workshop PDF handout.

Related Links:

How To: Connecting a Photoresistor

voice: 720-564-0373, email: sales@acroname.com, address: 4822 Sterling Dr., Boulder CO, 80301-2350,
privacy
© Copyright 1994-2010 Acroname

ZIGBEE:

ZigBee is a specification for a suite of high level communication


protocols using small, low-power digital radios based on the IEEE 802.15.4-2003
standard for Low-Rate Wireless Personal Area Networks (LR-WPANs), such as
wireless light switches with lamps, electrical meters with in-home-displays,
consumer electronics equipment via short-range radio needing low rates of data
transfer.

The technology defined by the ZigBee specification is intended to be


simpler and less expensive than other WPANs, such as Bluetooth. ZigBee is
targeted at radio-frequency (RF) applications that require a low data rate, long
battery life, and secure networking.

18
ZigBee is a low-cost, low-power, wireless mesh networking
standard. First, the low cost allows the technology to be widely deployed in
wireless control and monitoring applications. Second, the low power-usage allows
longer life with smaller batteries. Third, the mesh networking provides high
reliability and more extensive range.

It is not capable of powerline networking though other elements of the


OpenHAN standards suite promoted by openAMI and UtilityAMI deal with
communications co-extant with AC power outlets. In other words, ZigBee is
intended not to support powerline networking but to interface with it at least for
smart metering and smart appliance purposes. Utilities, e.g. Penn Energy, have
declared the intent to require them to interoperate again via the openHAN
standards.

The relationship between IEEE 802.15.4 and ZigBee is similar to that


between IEEE 802.11 and the Wi-Fi Alliance. The ZigBee 1.0 specification was
ratified on 14 December 2004 and is available to members of the ZigBee Alliance.
Most recently, the ZigBee 2007 specification was posted on 30 October 2007. The
first ZigBee Application Profile, Home Automation, was announced 2 November
2007. As amended by NIST, the Smart Energy Profile 2.0 specification will
remove the dependency on IEEE 802.15.4. Device manufacturers will be able to
implement any MAC/PHY, such as IEEE 802.15.4(x) and IEEE P1901, under an
IP layer based on 6LoWPAN.

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. The technology is intended to be simpler and less
19
expensive than other WPANs such as Bluetooth. ZigBee chip vendors typically
sell integrated radios and microcontrollers with between 60 KB and 256 KB flash
memory.

Radios are also available as stand-alone components to be used with any


processor or microcontroller. Generally, the chip vendors also offer the ZigBee
software stack, although independent ones are also available.

Because ZigBee can activate (go from sleep to active mode) in 30 msec or
less, the latency can be very low and devices can be very responsive — particularly
compared to Bluetooth wake-up delays, which are typically around three seconds.
[3]
Because ZigBees can sleep most of the time, average power consumption can be
very low, resulting in long battery life.

The first stack release is now called ZigBee 2004. The second stack release
is called ZigBee 2006, and mainly replaces the MSG/KVP structure used in 2004
with a "cluster library". The 2004 stack is now more or less obsolete.

ZigBee 2007, now the current stack release, contains two stack profiles,
stack profile 1 (simply called ZigBee), for home and light commercial use, and
stack profile 2 (called ZigBee Pro). ZigBee Pro offers more features, such as multi-
casting, many-to-one routing and high security with Symmetric-Key Key
Exchange (SKKE), while ZigBee (stack profile 1) offers a smaller footprint in
RAM and flash. Both offer full mesh networking and work with all ZigBee
application profiles.

ZigBee 2007 is fully backward compatible with ZigBee 2006 devices: A


ZigBee 2007 device may join and operate on a ZigBee 2006 network and vice
versa. Due to differences in routing options, ZigBee Pro devices must become non-
routing ZigBee End-Devices (ZEDs) on a ZigBee 2006 network, the same as for
ZigBee 2006 devices on a ZigBee 2007 network must become ZEDs on a ZigBee
Pro network. The applications running on those devices work the same, regardless
of the stack profile beneath them.

Licensing

For non-commercial purposes, the ZigBee specification is available free to


the general public.An entry level membership in the ZigBee Alliance, called

20
Adopter, provides access to the as-yet unpublished specifications and permission to
create products for market using the specifications.

The click through license on the ZigBee specification requires a


commercial developer to join the ZigBee Alliance. "No part of this specification
may be used in development of a product for sale without becoming a member of
ZigBee Alliance." .

This causes problems for open-source developers because the annual fee
conflicts with the GNU General Public License. From the GPL v2, "b) You must
cause any work that you distribute or publish, that in whole or in part contains or is
derived from the Program or any part there of, to be licensed as a whole at no
charge to all third parties under the terms of this License." Since the GPL makes no
distinction between commercial and non-commercial use it is impossible to
implement a GPL licensed ZigBee stack or combine a ZigBee implementation with
GPL licensed code. The requirement for the developer to join the ZigBee Alliance
similarly conflicts with most other Free software licenses.

ZigBee protocols are intended for use in embedded applications requiring


low data rates and low power consumption. ZigBee's current focus is to define a
general-purpose, inexpensive, self-organizing mesh network that can be used for
industrial control, embedded sensing, medical data collection, smoke and intruder
warning, building automation, home automation, etc. 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 — 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.

Device types

There are three different types of ZigBee devices:

ZigBee coordinator (ZC):

21
The most capable device, the coordinator forms the root of the network
tree and might bridge to other networks. There is exactly one ZigBee coordinator
in each network since it is the device that started the network originally. It is able
to store information about the network, including acting as the Trust Center &
repository for security keys.

ZigBee Router (ZR):

As well as running an application function, a router can act as an


intermediate router, passing on data from other devices.

ZigBee End Device (ZED):

Contains just enough functionality to talk to the parent node (either the
coordinator or a router); it cannot relay data from other devices. This relationship
allows the node to be asleep a significant amount of the time thereby giving long
battery life. A ZED requires the least amount of memory, and therefore can be less
expensive to manufacture than a ZR or ZC.

Protocols

The protocols build on recent algorithmic research (Ad-hoc On-demand Distance


Vector, neuRFon) to automatically construct a low-speed ad-hoc network of nodes.
In most large network instances, the network will be a cluster of clusters. It can
also form a mesh or a single cluster. The current profiles derived from the ZigBee
protocols support beacon and non-beacon enabled networks.

In non-beacon-enabled networks (those whose beacon order is 15), an


unslotted CSMA/CA channel access mechanism is used. In this type of network,
ZigBee Routers typically have their receivers continuously active, requiring a more
robust power supply. However, this allows for heterogeneous networks in which
some devices receive continuously, while others only transmit when an external
stimulus is detected. The typical example of a heterogeneous network is a wireless
light switch: The ZigBee node at the lamp may receive constantly, since it is
connected to the mains supply, while a battery-powered light switch would remain
asleep until the switch is thrown. The switch then wakes up, sends a command to
the lamp, receives an acknowledgment, and returns to sleep. In such a network the

22
lamp node will be at least a ZigBee Router, if not the ZigBee Coordinator; the
switch node is typically a ZigBee End Device.

In beacon-enabled networks, the special network nodes called ZigBee


Routers transmit periodic beacons to confirm their presence to other network
nodes. Nodes may sleep between beacons, thus lowering their duty cycle and
extending their battery life. Beacon intervals may range from 15.36 milliseconds to
15.36 ms * 214 = 251.65824 seconds at 250 kbit/s, from 24 milliseconds to 24 ms *
214 = 393.216 seconds at 40 kbit/s and from 48 milliseconds to 48 ms * 2 14 =
786.432 seconds at 20 kbit/s. However, low duty cycle operation with long beacon
intervals requires precise timing, which can conflict with the need for low product
cost.

In general, the ZigBee protocols minimize the time the radio is on so as to


reduce power use. In beaconing networks, nodes only need to be active while a
beacon is being transmitted. In non-beacon-enabled networks, power consumption
is decidedly asymmetrical: some devices are always active, while others spend
most of their time sleeping.

Except for the Smart Energy Profile 2.0, which will be MAC/PHY
agnostic, ZigBee devices are required to conform to the IEEE 802.15.4-2003 Low-
Rate Wireless Personal Area Network (WPAN) standard. The standard specifies
the lower protocol layers—the physical layer (PHY), and the media access control
(MAC) portion of the data link layer (DLL). This standard specifies operation in
the unlicensed 2.4 GHz (worldwide), 915 MHz (Americas) and 868 MHz (Europe)
ISM bands. In the 2.4 GHz band there are 16 ZigBee channels, with each channel
requiring 5 MHz of bandwidth. The center frequency for each channel can be
calculated as, FC = (2405 + 5 * (ch - 11)) MHz, where ch = 11, 12, ..., 26.

The radios use direct-sequence spread spectrum coding, which is managed


by the digital stream into the modulator. BPSK is used in the 868 and 915 MHz
bands, and OQPSK that transmits four bits per symbol is used in the 2.4 GHz band.
The raw, over-the-air data rate is 250 kbit/s per channel in the 2.4 GHz band, 40
kbit/s per channel in the 915 MHz band, and 20 kbit/s in the 868 MHz band.
Transmission range is between 10 and 75 meters (33 and 246 feet) and up to 1500

23
meters for zigbee pro, although it is heavily dependent on the particular
environment. The output power of the radios is generally 0 dBm (1 mW).

The basic channel access mode is "carrier sense, multiple access/collision


avoidance" (CSMA/CA). That is, the nodes talk in the same way that people
converse; they briefly check to see that no one is talking before they start. There
are three notable exceptions to the use of CSMA. Beacons are sent on a fixed
timing schedule, and do not use CSMA. Message acknowledgments also do not
use CSMA. Finally, devices in Beacon Oriented networks that have low latency
real-time requirements may also use Guaranteed Time Slots (GTS), which by
definition do not use CSMA.

ZigBee RF4CE:

On March 3, 2009 the RF4CE (Radio Frequency for Consumer Electronics)


Consortium agreed to work with the ZigBee Alliance to jointly deliver a
standardized specification for radio frequency-based remote controls. ZigBee
RF4CE is designed to be deployed in a wide range of remotely-controlled
audio/visual consumer electronics products, such as TVs and set-top boxes. It
promises many advantages over existing remote control solutions, including richer
communication and increased reliability, enhanced features and flexibility,
interoperability, and no line-of-sight barrier.

Software and hardware

The software is designed to be easy to develop on small, inexpensive


microprocessors. The radio design used by ZigBee has been carefully optimized
for low cost in large scale production. It has few analog stages and uses digital
circuits wherever possible.

Even though the radios themselves are inexpensive, the ZigBee Qualification
Process involves a full validation of the requirements of the physical layer. This
amount of concern about the Physical Layer has multiple benefits, since all radios
derived from that semiconductor mask set would enjoy the same RF
characteristics. On the other hand, an uncertified physical layer that malfunctions
could cripple the battery lifespan of other devices on a ZigBee network. Where

24
other protocols can mask poor sensitivity or other esoteric problems in a fade
compensation response, ZigBee radios have very tight engineering constraints:
they are both power and bandwidth constrained. Thus, radios are tested to the ISO
17025 standard with guidance given by Clause 6 of the 802.15.4-2006 Standard.
Most vendors plan to integrate the radio and microcontroller onto a single chip
getting smaller devices.

History

ZigBee-style networks began to be conceived around 1998, when many


installers realized that both Wi-Fi and Bluetooth were going to be unsuitable for
many applications. In particular, many engineers saw a need for self-organizing ad-
hoc digital radio networks.

The IEEE 802.15.4-2003 standard was completed in May 2003 and has been
superseded by the publication of IEEE 802.15.4-2006.

In the summer of 2003, Philips Semiconductors, a major mesh network


supporter, ceased the investment. Philips Lighting has, however, continued Philips'
participation, and Philips remains a promoter member on the ZigBee Alliance
Board of Directors.

The ZigBee Alliance announced in October 2004 that the membership had
more than doubled in the preceding year and had grown to more than 100 member
companies, in 22 countries. By April 2005 membership had grown to more than
150 companies, and by December 2005 membership had passed 200 companies.

The ZigBee specifications were ratified on 14 December 2004.

The ZigBee Alliance announces public availability of Specification 1.0 on


13 June 2005, known as ZigBee 2004 Specification.

The ZigBee Alliance announces the completion and immediate member


availability of the enhanced version of the ZigBee Standard in September 2006,
known as ZigBee 2006 Specification.During the last quarter of 2007, ZigBee PRO,
the enhanced ZigBee specification was finalized.

25
ELECTRICAL CHARACTERSTICS:

26
DEVICE OVERVIEW:

The MRF24J40MA is a 2.4 GHz IEEE Std. 802.15.4™ compliant, surface


mount module with integrated crystal, internal voltage regulator, matching
circuitry and PCB antenna.

The MRF24J40MA module operates in the non-licensed 2.4 GHz frequency


band and is FCC, IC and ETSI compliant. The integrated module design frees the
integrator from extensive RF and antenna design, and regulatory compliance
testing, allowing quicker time to market.

MRF24J40MA BLOCK DIAGRAM:

RECOMMANDED PCB FOOT PRINT:


27
MODULE DETAILS:

MOUNTING DETAILS:

28
CIRCUIT DIAGRAM:

FEATURES:
29
2.4 GHz IEEE Std. 802.15.4™ RF Transceiver Module :

 IEEE Std. 802.15.4™ Compliant RF Transceiver .


 Supports ZigBee®, MiWi™, MiWi™ P2P and
 Proprietary Wireless Networking Protocols
 Small Size: 0.7” x 1.1” (17.8 mm x 27.9 mm),
 Surface Mountable
 Integrated Crystal, Internal Voltage Regulator,
 Matching Circuitry and PCB Antenna
 Easy Integration into Final Product – Minimize
 Product Development, Quicker Time to Market
 Radio Regulation Certification for United States
 (FCC), Canada (IC) and Europe (ETSI)
 Compatible with Microchip Microcontroller
 Families (PIC16F, PIC18F, PIC24F/H, dsPIC33 and PIC32)
 Up to 400 ft. Range
 Operating Voltage: 2.4-3.6V (3.3V typical)
 Temperature Range: -40°C to +85°C Industrial
 Simple, Four-Wire SPI Interface
 Low-Current Consumption:
 -RX mode: 19 mA (typical)
 -TX mode: 23 mA (typical)
 -Sleep: 2 µA (typical)

RF/Analog Features:

 ISM Band 2.405-2.48 GHz Operation


 Data Rate: 250 kbps
 -94 dBm Typical Sensitivity with +5 dBm
 Maximum Input Level
 +0 dBm Typical Output Power with
 36 dB TX Power Control Range
 Integrated Low Phase Noise VCO, Frequency Synthesizer and PLL Loop
Filter .

30
 Digital VCO and Filter Calibration .
 Integrated RSSI ADC and I/Q DACs
 Integrated LDO .
 High Receiver and RSSI Dynamic Range .

MAC/Baseband Features:

 Hardware CSMA-CA Mechanism, Automatic ACK Response and FCS


Check
 Independent Beacon, Transmit and GTS FIFO
 Supports all CCA modes and RSS/LQI
 Automatic Packet Retransmit Capable
 Hardware Security Engine (AES-128) with CTR, CCM and CBC-MAC
modes .
 Supports Encryption and Decryption for MAC Sublayer and Upper Layer .

Applications

 ·2.4-GHz IEEE 802.15.4 systems


 ·RF4CE remote control systems (64-KB flash and higher)
 ·ZigBee systems (256-KB flash)
 ·Home/Building automation
 ·Lighting systems
 ·Industrial control and monitoring
 ·Low-Power wireless sensor networks
 ·Consumer electronics
 ·Health care

ADC 0808/0809

31
The ADC0809 data acquisition component is a monolithic CMOS
device with an 8-bit analog-to-digital converter, 8-channel multiplexer and
microprocessor compatible control logic. The 8-bit A/D converter uses successive
approximation as the conversion technique.

The converter features a high impedance chopper stabilized


comparator, a 256R voltage divider with analog switch tree and a successive
approximation register. The 8-channel multiplexer can directly access any of 8-
single-ended analog signals.

The device eliminates the need for external zero and full-scale
adjustments. Easy interfacing to microprocessors is provided by the latched and
decoded multiplexer address inputs and latched TTL TRI-STATE® outputs.

The design of the ADC0808, ADC0809 has been optimized by


incorporating the most desirable aspects of several A/D conversion techniques. The
ADC0808, ADC0809 offers high speed, high accuracy, minimal temperature
dependence, excellent long-term accuracy and repeatability, and consumes
minimal power.

Features

 Easy interface to all microprocessors


 Operates ratio metrically or with 5 VDC or analog span
 No zero or full-scale adjust required

32
 8-channel multiplexer with address logic
 0V to 5V input range with single 5V power supply
Key Specifications

 Resolution 8 Bits
 Total Unadjusted Error ±1⁄2 LSB and ±1 LSB
 Single Supply 5 VDC
 Low Power 15 mW
 Conversion Time 100 μs
Block Diagram

Figure.3.1.Block Diagram of ADC 0809

Pin Diagram

33
Figure.3.2.Pin Diagram of ADC 0809

The ADC0808, ADC0809 data acquisition component is a monolithic


CMOS device with an 8-bit analog-to-digital converter, 8-channel multiplexer and
microprocessor compatible control logic.

34
Functional Description

Multiplexer

The device contains an 8-channel single-ended analog signal


multiplexer. A particular input channel is selected by using the address decoder.
Table 1 shows the input states for the address lines to select any channel. The
address is latched into the decoder on the low-to-high transition of the address
latch enable signal.

Table.3.1.Adddress line of ADC

35
The successive approximation register (SAR) performs eight iterations
to determine the digital code for input value. The SAR is reset on the positive edge
of START pulse and start the conversion process on the falling edge of START
pulse.

A conversion process will be interrupted on receipt of new START


pulse.

The End-Of-Conversion (EOC) will go low between 0 and 8 clock


pulses after the positive edge of START pulse.

The ADC can be used in continuous conversion mode by tying the EOC
output to START input. In this mode an external START pulse should be applied
whenever power is switched ON.

The comparator in ADC0809/ADC0808 is a chopper- stabilized


comparator. It converts the DC input signal into an AC signal, and amplifies the
AC sign using high gain AC amplifier. Then it converts AC signal to DC signal.
This technique limits the drift component of the amplifier, because the drift is a DC
component and it is not amplified/passed by the AC amp1ifier. This makes the
ADC extremely insensitive to temperature, long term drift and input offset errors.
In ADC conversion process the input analog value is quantized and
each quantized analog value will have a unique binary equivalent.

36
Application

 ADCs are integral to current music reproduction technology. Since


much music production is done on computers, when an analog recording is
used, an ADC is needed to create the PCM data stream that goes onto a
compact disc or digital music file.

 High bandwidth headroom allows the use of cheaper or faster anti-


aliasing filters of less severe filtering slopes.

 Considerable literature exists on these matters, but commercial


considerations often play a significant role. Most high-profile recording
studios record in 24-bit/192-176.4 kHz PCM or in DSD formats, and then
down sample or decimate the signal for Red-Book CD production (44.1 kHz
or at 48 kHz for commonly used for radio/TV broadcast applications).

 Digital Signal Processing: AD converters are used virtually


everywhere where an analog signal has to be processed, stored, or
transported in digital form. Fast video ADCs are used, for example, in TV
tuner cards. Slow on-chip 8, 10, 12, or 16 bit ADCs are common in
microcontrollers. Very fast ADCs are needed in digital oscilloscopes

37
VOLTAGE SENSOR

Introduction

The interface of various sensors to a controller like the BrainStem GP 1.0 module typically
involves either conditioning or converting voltage levels into the range the controller requires.
Many systems use A/D converters to make the sensor value relevant in a program or data logging
configuration. These converters have a fixed range of voltages they can convert from with 0-5V
being by far the most common.

Sensors often create voltages in different ranges than those required by the controllers they are
being interfaced to which requires the conversion of one voltage to another. This conversion
often breaks down into a combination one or more of three types, amplification, dividing, and
shifting.

Contents

Dividing Voltages

Voltage dividing is probably the easiest transformation you can perform on sensor outputs to
alter the value being connected to a microcontroller or other circuit.

The mathematical equivalent of what you are trying to achieve when dividing voltages is a
simple division. For instance, say you have a sensor that outputs 0-100V and you want to
convert this to 0-5V for interface to the A/D input on your BrainStem. The goal would be to
create a 20:1 ratio of voltage which means dividing the original sensor output voltage by a factor
of 20. So we need a small circuit that will accomplish the following pictorially:

The easiest way to accomplish this division is using a few resistors to form a voltage divider.
The resistors are wired up in series to create intermediate voltages based with the desired
division. The above example could be accomplished as follows:

38
This voltage divider uses the input as the top of the resistor ladder and ground as the bottom.
The actual division is defined by the proportion of resistance between the two resistors.

Notice the above circuit does not work out to an exact division by 20. This is because the
resistors used are commonly found resistor values. Precision resistors with exact tolerances can
be used but are often not needed since the original output of sensors typically varies. Here the
resulting output voltage is slightly below the maximum of 5V but with a reasonable A/D
converter like the 10-bit converters used in the BrainStem GP 1.0 module would still offer plenty
of dynamic range in the sensor readings.

Contents

Amplifying Voltages

Voltage amplification is required for a class of sensors that create small voltages. Often sensors
of this type are converting some sort of physical energy such as acceleration, temperature, or
other minimal physical force into a voltage. This conversion is often an inefficient conversion
and the measured energy is minimal which results in very small voltages generated by the
sensor. To make these small voltages meaningful, they must be amplified to a usable level.

The equation for amplification is the exact opposite of dividing. You want to multiply the output
voltage from a sensor to gain the full range of your A/D input or other interfaced circuit. Lets
say you have an accelerometer which measures accelerations in g (gravity) units. A sensor like
this may have a response of 312mV/g which means the sensor will generate 0.312V for each
gravity unit of force it encounters. Now, say you would like to measure up to 2 gravity units
(2g) with your detector with the full range of your 0-5V A/D converter. This means you need to
multiply the output voltage of your accelerometer by a factor of about 16 to get the desired range
and sensitivity in your measurements. So we want to accomplish the following pictorially:

Probably the most common way to multiply a voltage is using an amplifier. Here, we will use a
common Operational Amplifier (Op Amp) to multiply the voltage. These Op Amp circuits are
extremely common in electronics and there are volumes of literature devoted specifically to the
various characteristics and performance of each. We use one of the original versions which is
widely available and easy to interface called the 741. Here is one circuit that will amplify the
voltage by a factor of about 16:

39
There are some things to note about this circuit. Again, changing resistance values gives a
different voltage amplification (multiplication). The small numbers indicate the pins of the 741
package that you would connect to for this circuit (it is an 8 pin chip). Also, notice the additional
power supply which is both positive and negative. This is very common for Op Amp circuits.
Since the Op Amp is powered by a plus/minus voltage of 9V, the absolute output can at best be
9V. In practice, the output voltage will probably be slightly less.

The gain for this amplifier may not be exactly linear, depending on the input and output
voltages. This can often be hidden in the noise of the sensor and accuracy of the A/D conversion
on the other end but it should be considered. The higher the gain of an amplifier, the larger the
margin of error and noise.

Contents

Shifting Voltages

Shifting voltages can be a requirement for sensor data that are generated symmetrically about a
common (often ground) voltage. A simple example of this would be a motor acting as a
generator where spinning in one direction creates a positive voltage and spinning in the other
direction creates a negative voltage. Since most common A/D converters in microcontrollers
deal with a 0-VCC range for conversions, sensors that are symmetric about the ground voltage
reference need to be shifted into the 0-VCC range.

The equation for shifting is then then the addition or subtraction of an offset from the original
sensor's voltage. For example, if your sensor produces -2 to 2V, you would want to add 2V to
the output for reading with a common 0-5V A/D converter. This addition would result in a final
output of 0-4V which the A/D converter could then use. This conversion looks like this
pictorially:

40
This circuit is a two-stage summing amplifier using an Op-Amp chip (the 1458) that houses two
op-amps on a single chip. Notice there are some fixed values of resistors that essentially create a
voltage summing circuit. The input on one side is a resistor network that creates a fixed voltage
to sum with the input voltage. The variable resistor values change this resistor network's set
voltage. You could substitute a potentiometer for R1 and R2 to make the addition variable, by
twisting the potentiometer.

The addition circuit also requires a plus/minus 9V power supply for the op-amps. In addition, a
tap from the 5V supply used for the logic is used although this could be done with the positive
9V side as well, provided the voltages are computed correctly.

Contents

Combining Conversions

So the above conversions define addition, subtraction, multiplication, and division of a voltage.
Each of these conversions can be thought of in isolation as shown above or they can be
combined to create composite conversions. We essentially have an algebra of blocks we can use
to achieve a wide variety of overall conversions.

Say you have a sensor that creates -100 to 100V and you want to read the value with a 0-5V A/D
converter. You would need to scale down the original voltage to -2.5 to 2.5V first and then
offset the result by adding 2.5V to get the result into the desired range of 0-5V for your A/D
converter. You can chain together the conversions for such an effect which would look like this
pictorially:

Contents

41
Conversion Impurities

The above conversions all introduce impurities in the resulting signal in the form of noise, non-
linearity, and other corruptions of the original input voltage. Care must be taken to minimize the
number of stages and also to order them for reduced error. Testing and careful thought can
typically reduce these impurities to a minimum but they cannot be disregarded.

There is a general rule of thumb with regard to these introduced impurities. The more you are
changing the original voltage, the more impurities you will introduce. For instance, an
amplification of 100x would be generally more noisy than one of 2x.

Contents

Power Supply Issues

Several of these circuits require a plus/minus 9V supply for the Op Amps. This can readily be
accomplished using two standard 9V batteries. More sophisticated options include standard
power supplies, charge pumps and inverters and several other options. The 9V battery is cheap,
simple and it works well. Op Amp circuits tend to be pretty efficient so the batteries should last
quite some time.

Contents

Further Reading

The subject of sensor interfaces is vast. This article attempts to give some basics that are easy,
practical, and quick to implement. Here are two great references to consider:

 The Art of Electronics, by Horowitz and Hill


 Op Amp IC Circuits, by Forrest M. Mims III

Contents

Additional Information

A short workshop converting this material was held at the Colorado School of Mines (CSM).
The handout used for the class is available for download.

42
SensorWorkshop.pdf
125.09K Bytes

PDF Summary use in Colorado School of Mines Class

Revision History:

 2004-03-25: Page Created


 2007-03-23: Added the CSM workshop PDF handout.

Related Links:

How To: Connecting a Photoresistor

voice: 720-564-0373, email: sales@acroname.com, address: 4822 Sterling Dr., Boulder CO, 80301-2350,
privacy
© Copyright 1994-2010 Acroname

CURRENT SENSOR

A current sensor is a device that detects electrical current (AC or


DC) in a wire, and generates a signal proportional to it.

The sensed current and the output signal can be:

 AC current input,
o analog output, which duplicates the wave shape of the sensed
current
o unipolar output, which is proportional to the average or RMS
value of the sensed current
 DC current input,
o unipolar, with a unipolar output, which duplicates the wave
shape of the sensed current

43
o bipolar output, which duplicates the wave shape of the sensed
current
o digital output, which switches when the sensed current
exceeds a certain threshold

UART

A universal asynchronous receiver/transmitter is a type of


"asynchronous receiver/transmitter", a piece of computer hardware that translates
data between parallel and serial forms. UARTs are commonly used in conjunction
with other communication standards such as EIA RS-232.

A UART is usually an individual (or part of an) integrated circuit used


for serial communications over a computer or peripheral device serial port.

UARTs are now commonly included in microcontrollers. A dual UART


or DUART combines two UARTs into a single chip. Many modern ICs now come
with a UART that can also communicate synchronously; these devices are called
USARTs.

The Universal Asynchronous Receiver/Transmitter (UART) controller


is the key component of the serial communications subsystem of a computer. The
UART takes bytes of data and transmits the individual bits in a sequential fashion.
At the destination, a second UART re-assembles the bits into complete bytes.

44
Serial transmission of digital information (bits) through a single wire or
other medium is much more cost effective than parallel transmission through
multiple wires. A UART is used to convert the transmitted information between its
sequential and parallel form at each end of the link.

Each UART contains a shift register which is the fundamental method


of conversion between serial and parallel forms.

MAX232

The MAX232 is an integrated circuit that converts signals from an RS-


232 serial port to signals suitable for use in TTL compatible digital logic circuits.
The MAX232 is a dual driver/receiver and typically converts the RX, TX, CTS and
RTS signals.

The drivers provide RS-232 voltage level outputs (approx. ± 7.5 V)


from a single + 5 V supply via on-chip charge pumps and external capacitors. This
makes it useful for implementing RS-232 in devices that otherwise do not need any
voltages outside the 0 V to + 5 V range, as power supply design does not need to
be made more complicated just for driving the RS-232 in this case.

The receivers reduce RS-232 inputs (which may be as high as ± 25 V),


to standard 5 V TTL levels. These receivers have a typical threshold of 1.3 V, and
a typical hysteresis of 0.5 V.

The later MAX232A is backwards compatible with the original


MAX232 but may operate at higher baud rates and can use smaller external
capacitors – 0.1 μF in place of the 1.0 μF capacitors used with the original device.

45
Block Diagram

Figure.3.3.Block Diagram of UART

Transmitter

Parallel-to-serial conversion

 CPU to serial port


 Transmit (TX) FIFO and Transmit ShiftRegister (TSR)
46
 16X timing for bit shifting
 Parity Insertion

 FIFO empty report (TXRDY and INT)

TX Character Framing

Start Bit

 Data Bits of 5, 6, 7 or 8
 Parity Bit
 Stop Bit of 1, 1.5 or 2
 Example:

 Start, 8 data, parity, with 1 stop bit (8P1)

Receiver

Serial-to-Parallel Conversion

 Serial to CPU
 Receive (RX) FIFO and Receive Shift Register (RSR)with error tags
 16X timing clock for mid bit sampling and verification
 Start-bit detection and verification
 Data-bit sampling
 Parity sampling & verification (parity error)
 Stop bit sampling & verification
 Framing check and error(s) report

47
 FIFO status report (RXRDY and INT)

RX Character Validation

Start bit detection and validation

 HIGH to LOW transition indicates a start bit


 Start bit validated if RX input is still LOW during mid bit sampling
 Data, parity and stop bits are sampled at mid bit

Pin Diagram

Figure.3.4.PinDiagram of MAX232

Applicability

48
This module is primary of interest for people building their own
electronics with an RS-232 interface. Off-the-shelf computers with RS-232
interfaces already contain the necessary electronics, and there is no need to add the
circuitry as described here.

A MAX232 integrated circuit

The MAX232 from Maxim was the first IC which in one package
contains the necessary drivers (two) and receivers (also two), to adapt the RS-232
signal voltage levels to TTL logic. It became popular, because it just needs one
voltage (+5V) and generates the necessary RS-232 voltage levels (approx. -10V
and +10V) internally.

This greatly simplified the design of circuitry. Circuitry designers no


longer need to design and build a power supply with three voltages (e.g. -12V,
+5V, and +12V), but could just provide one +5V power supply, e.g. with the help
of a simple 78x05 voltage converter.

The MAX232 has a successor, the MAX232A. The ICs are almost
identical, however, the MAX232A is much more often used (and easier to get) than
the original MAX232, and the MAX232A only needs external capacitors 1/10th
the capacity of what the original MAX232 needs.

It should be noted that the MAX232(A) is just a driver/receiver. It does


not generate the necessary RS-232 sequence of marks and spaces with the right
timing, it does not decode the RS-232 signal, it does not provide a serial/parallel
conversion.

49
The MAX232 and MAX232A were once rather expensive ICs, but
today they are cheap. It has also helped that many companies now produce clones
(ie. Sipex).

These clones sometimes need different external circuitry, e.g. the


capacities of the external capacitors vary.

The MAX233 is also between three and ten times more expensive in
electronic shops than the MAX232A because of its internal capacitors. It is also
more difficult to get the MAX233 than the garden variety MAX232A.

A Typical Application

The MAX232(A) has two receivers (converts from RS-232 to TTL


voltage levels) and two drivers (converts from TTL logic to RS-232 voltage
levels).

This means only two of the RS-232 signals can be converted in each
direction. The old MC1488/1498 combo provided four drivers and receivers.

Typically a pair of a driver/receiver of the MAX232 is used for

 TX and RX

and the second one for

 CTS and RTS.

There are not enough drivers/receivers in the MAX232 to also connect


the DTR, DSR, and DCD signals. Usually these signals can be omitted when e.g.
communicating with a PC's serial interface.

50
If the DTE really requires these signals either a second MAX232 is
needed, or some other IC from the MAX232 family can be used (if it can be found
in consumer electronic shops at all). An alternative for DTR/DSR is also given
below.

Maxim's data sheet explains the MAX232 family in great detail, including

the pin configuration and how to connect such an IC to external circuitry. This
information can be used as-is in own design to get a working RS-232 interface.

Table.3.2.Datasheet of MAX232

AT89s52 Microcontroller:

51
The AT89S52 is a low-power, high-performance CMOS 8-bit
microcontroller with 8K bytes of in-system programmable Flash memory. The
device is manufactured using Atmel’s high-density nonvolatile memory
technology and is compatible with the Indus-try-standard 80C51 instruction set and
pin out.

Features:

 Compatible with MCS®-51 Products.

 8K Bytes of In-System Programmable (ISP) Flash Memory –


Endurance: 1000 Write/Erase Cycles.

 4.0V to 5.5V Operating Range.

 Fully Static Operation: 0 Hz to 33 MHz.

 Three-level Program Memory Lock.

 256 x 8-bit Internal RAM.

 32 Programmable I/O Lines.]

52
 Three 16-bit Timer/Counters.

 Eight Interrupt Sources.


 Full Duplex UART Serial Channel.

 Low-power Idle and Power-down Modes.

 Interrupt Recovery from Power-down Mode.

 Watchdog Timer.

 Dual Data Pointer.

 Power-off Flag.

 Fast Programming Time.

 Flexible ISP Programming (Byte and Page Mode).

 Green (Pb/Halide-free) Packaging Option.

Description:

The AT89S52 is a low-power, high-performance CMOS 8-bit


microcontroller with 8K bytes of in-system programmable Flash memory.

The device is manufactured using Atmel’s high-density nonvolatile memory


technology and is compatible with the Indus-try-standard 80C51 instruction set and
pin out.

The on-chip Flash allows the program memory to be reprogrammed in-


system or by a conventional nonvolatile memory pro-grammer. By combining a
53
versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the
Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible
and cost-effective solution to many embedded control applications.

The AT89S52 provides the following standard features: 8K bytes of Flash,


256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit
timer/counters, a six-vector two-level interrupt architecture, a full duplex serial
port, on-chip oscillator, and clock circuitry.

In addition, the AT89S52 is designed with static logic for operation down to
zero frequency and supports two software selectable power saving modes. The Idle
Mode stops the CPU while allowing the RAM, timer/counters, serial port, and
interrupt system to continue functioning.

The Power-down mode saves the RAM con-tents but freezes the oscillator,
disabling all other chip functions until the next interrupt or hardware reset.

Pin configuration:

54
Block diagram:

55
Pin Description:
56
VCC:

Supply voltage.

GND:

Ground.

Port 0:

Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each
pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be
used as high-impedance inputs.

Port 0 can also be configured to be the multiplexed low-order address/data


bus during accesses to external program and data memory. In this mode, P0 has
internal pull-ups.

Port 0 also receives the code bytes during Flash programming and outputs
the code bytes during program verification. External pull-ups are required during
program verification.

Port 1:

57
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1
output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins,
they are pulled high by the inter-nal pull-ups and can be used as inputs.

As inputs, Port 1 pins that are externally being pulled low will source current
(IIL) because of the internal pull-ups. In addition, P1.0 and P1.1 can be configured
to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2
trigger input (P1.1/T2EX), respectively, as shown in the following table.

Port 1 also receives the low-order address bytes during Flash programming
and verification.

Port 2:

Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2
output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins,
they are pulled high by the internal pull-ups and can be used as inputs.

58
As inputs, Port 2 pins that are externally being pulled low will source current
(IIL) because of the internal pull-ups. Port 2 emits the high-order address byte
during fetches from external program memory and during accesses to external data
memory that uses 16-bit addresses (MOVX @ DPTR).

In this application, Port 2 uses strong internal pull-ups when emitting 1s.
During accesses to external data memory that uses 8-bit addresses (MOVX @ RI),
Port 2 emits the contents of the P2 Special Function Register.

Port 2 also receives the high-order address bits and some control signals
during Flash programming and verification.

Port Pin Alternate Functions P1.0 T2 (external count input to Timer/Counter


2), clock-out P1.1 T2EX (Timer/Counter 2 capture/reload trigger and direction
control) P1.5 MOSI (used for In-System Programming) P1.6 MISO (used for In-
System Programming) P1.7 SCK (used for In-System Programming)

Port 3

Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3
output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins,
they are pulled high by the internal pull-ups and can be used as inputs.

As inputs, Port 3 pins that are externally being pulled low will source current
(IIL) because of the pull-ups. Port 3 receives some control signals for Flash
programming and verification. Port 3 also serves the functions of various special
features of the AT89S52, as shown in the following table.

59
RST:

Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device.

This pin drives high for 98 oscillator periods after the Watchdog times out.
The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature.
In the default state of bit DISRTO, the RESET HIGH out feature is enabled.

ALE/PROG:

Address Latch Enable (ALE) is an output pulse for latching the low byte of
the address during accesses to external memory. This pin is also the program pulse
input (PROG) during Flash programming.

60
In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator
frequency and may be used for external timing or clocking purposes. Note,
however, that one ALE pulse is skipped during each access to external data
memory.

If desired, ALE operation can be disabled by setting bit 0 of SFR location


8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction.

Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no
effect if the microcontroller is in external execution mode.

PSEN:

Program Store Enable (PSEN) is the read strobe to external program


memory.

When the AT89S52 is executing code from external program memory,


PSEN is activated twice each machine cycle, except that two PSEN activations are
skipped during each access to external data memory.

EA/VPP :

External Access Enable. EA must be strapped to GND in order to enable the


device to fetch code from external program memory locations starting at 0000H up
to FFFFH.

61
Note, however, that if lock bit 1 is programmed, EA will be internally
latched on reset. EA should be strapped to VCC for internal program executions.
This pin also receives the 12-volt programming enable voltage (VPP) during Flash
programming.

XTAL1:

Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.

XTAL2:

Output from the inverting oscillator amplifier.

Memory Organization:

MCS-51 devices have a separate address space for Program and Data
Memory. Up to 64K bytes each of external Program and Data Memory can be
addressed.

Program Memory:

62
If the EA pin is connected to GND, all program fetches are directed to
external memory. On the AT89S52, if EA is connected to VCC, program fetches to
addresses 0000H through 1FFFH are directed to internal memory and fetches to
addresses 2000H through FFFFH are to external memory.

Data Memory:

The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes
occupy a parallel address space to the Special Function Registers.

This means that the upper 128 bytes have the same addresses as the SFR
space but are physically separate from SFR space.

When an instruction accesses an internal location above address 7FH, the


address mode used in the instruction specifies whether the CPU accesses the upper
128 bytes of RAM or the SFR space. Instructions which use direct addressing
access the SFR space.

For example, the following direct addressing instruction accesses the SFR at
location 0A0H (which is P2). MOV 0A0H, #data Instructions that use indirect
addressing access the upper 128 bytes of RAM.

For example, the following indirect addressing instruction, where R0


contains 0A0H, accesses the data byte at address 0A0H, rather than P2 (whose
address is 0A0H).

MOV @R0, #data Note that stack operations are examples of indirect
addressing, so the upper 128 bytes of data RAM are available as stack space.
63
Watchdog Timer:

The WDT is intended as a recovery method in situations where the CPU


may be subjected to software upsets. The WDT consists of a 14-bit counter and the
Watchdog Timer Reset (WDTRST) SFR. The WDT is defaulted to disable from
exiting reset.

To enable the WDT, a user must write 01EH and 0E1H in sequence to the
WDTRST register (SFR location 0A6H).

When the WDT is enabled, it will increment every machine cycle while the
oscillator is running. The WDT timeout period is dependent on the external clock
frequency.

There is no way to disable the WDT except through reset (either hardware
reset or WDT overflow reset). When WDT over-flows, it will drive an output
RESET HIGH pulse at the RST pin.

Using the WDT:

To enable the WDT, a user must write 01EH and 0E1H in sequence to the
WDTRST register (SFR location 0A6H).

When the WDT is enabled, the user needs to service it by writing 01EH and
0E1H to WDTRST to avoid a WDT overflow. The 14-bit counter overflows when
it reaches 16383 (3FFFH), and this will reset the device.
64
]

When the WDT is enabled, it will increment every machine cycle while the
oscillator is running. This means the user must reset the WDT at least every 16383
machine cycles.

To reset the WDT the user must write 01EH and 0E1H to WDTRST.
WDTRST is a write-only register. The WDT counter cannot be read or written.

When WDT overflows, it will generate an output RESET pulse at the RST
pin. The RESET pulse duration is 98xTOSC, where TOSC = 1/FOSC.

To make the best use of the WDT, it should be serviced in those sections of
code that will periodically be executed within the time required to prevent a WDT
reset.

WDT during Power-down and Idle:

In Power-down mode the oscillator stops, which means the WDT also stops.
While in Power-down mode, the user does not need to service the WDT.

There are two methods of exiting Power-down mode: by a hardware reset or


via a level-activated external interrupt which is enabled prior to entering Power-
down mode.

When Power-down is exited with hardware reset, servicing the WDT should
occur as it normally does whenever the AT89S52 is reset. Exiting Power-down

65
with an interrupt is significantly different. The interrupt is held low long enough
for the oscillator to stabilize.

When the interrupt is brought high, the interrupt is serviced. To prevent the
WDT from resetting the device while the interrupt pin is held low, the WDT is not
started until the interrupt is pulled high. It is suggested that the WDT be reset
during the interrupt service for the interrupt used to exit Power-down mode.

To ensure that the WDT does not overflow within a few states of exiting
Power-down, it is best to reset the WDT just before entering Power-down mode.
Before going into the IDLE mode, the WDIDLE bit in SFR AUXR is used to
determine whether the WDT continues to count if enabled.

The WDT keeps counting during IDLE (WDIDLE bit = 0) as the default
state. To prevent the WDT from resetting the AT89S52 while in IDLE mode, the
user should always set up a timer that will periodically exit IDLE, service the
WDT, and reenter IDLE mode.

With WDIDLE bit enabled, the WDT will stop to count in IDLE mode and
resumes the count upon exit from IDLE.

Uses of microcontroller:

Like all good things, this powerful component is basically very simple. It is
made by mixing tested and high- quality "ingredients" (components) as per
following receipt:

 The simplest computer processor is used as the "brain" of the future system.
66
 Depending on the taste of the manufacturer, a bit of memory, a few A/D
converters, timers, input/output lines etc. are added.

 All that is placed in some of the standard packages.

 Simple software able to control it all and which everyone can easily learn
about has been developed.

 On the basis of these rules, numerous types of microcontrollers were


designed and they quickly became man's invisible companion.

 Their incredible simplicity and flexibility conquered us a long time ago and
if you try to invent something about them, you should know that you are
probably late, someone before you has either done it or at least has tried to
do it.

 The following things have had a crucial influence on development and


success of the microcontrollers:

 Powerful and carefully chosen electronics embedded in the


microcontrollers can independently or via input/output devices
(switches, push buttons, sensors, LCD displays, relays etc.), control
various processes and devices such as industrial automation, electric
current, temperature, engine performance etc.
 Very low prices enable them to be embedded in such devices in
which, until recent time it was not worthwhile to embed anything.
Thanks to that, the world is overwhelmed today with cheap automatic
devices and various “smart” appliances.

 Prior knowledge is hardly needed for programming. It is sufficient to


have a PC (software in use is not demanding at all and is easy to

67
learn) and a simple device (called the programmer) used for “loading”
ready-to-use programs into the microcontroller.

 So, if you are infected with a virus called electronics, there is nothing
left for you to do but to learn how to use and control its power.

Working of microcontroller:

Even though there is a large number of different types of microcontrollers


and even more programs created for their use only, all of them have many things in
common.

Thus, if you learn to handle one of them you will be able to handle them all.
A typical scenario on the basis of which it all functions is as follows:

 Power supply is turned off and everything is still…the program is loaded


into the microcontroller, nothing indicates what is about to come…

 Power supply is turned on and everything starts to happen at high speed! The
control logic unit keeps everything under control.

It disables all other circuits except quartz crystal to operate. While the
preparations are in progress, the first milliseconds go by.

Power supply voltage reaches its maximum and oscillator frequency


becomes stable. SFRs are being filled with bits reflecting the state of all circuits
within the microcontroller.

All pins are configured as inputs. The overall electronis starts operation in
rhythm with pulse sequence. From now on the time is measured in micro and
nanoseconds.

68
Program Counter is set to zero. Instruction from that address is sent to
instruction decoder which recognizes it, after which it is executed with immediate
effect.

The value of the Program Counter is incremented by 1 and the whole


process is repeated...several million times per second.

Inside a microcontroller:

69
As you can see, all the operations within the microcontroller are performed
at high speed and quite simply, but the microcontroller itself would not be so
useful if there are not special circuits which make it complete. In continuation, we
are going to call your attention to them.

Read Only Memory (ROM):

Read Only Memory (ROM) is a type of memory used to permanently save


the program being executed. The size of the program that can be written depends
on the size of this memory.

ROM can be built in the microcontroller or added as an external chip, which


depends on the type of the microcontroller. Both options have some disadvantages.

If ROM is added as an external chip, the microcontroller is cheaper and the


program can be considerably longer. At the same time, a number of available pins
is reduced as the microcontroller uses its own input/output ports for connection to
the chip.

The internal ROM is usually smaller and more expensive, but leaves more
pins available for connecting to peripheral environment. The size of ROM ranges
from 512B to 64KB.

Random Access Memory (RAM):

Random Access Memory (RAM) is a type of memory used for temporary


storing data and intermediate results created and used during the operation of the
microcontrollers.
70
The content of this memory is cleared once the power supply is off. For
example, if the program performes an addition, it is necessary to have a register
standing for what in everyday life is called the “sum” .

For that purpose, one of the registers in RAM is called the "sum" and used
for storing results of addition. The size of RAM goes up to a few KBs.

Electrically Erasable Programmable ROM (EEPROM).

The EEPROM is a special type of memory not contained in all


microcontrollers.

Its contents may be changed during program execution (similar to RAM ),


but remains permanently saved even after the loss of power (similar to ROM).

It is often used to store values, created and used during operation (such as
calibration values, codes, values to count up to etc.), which must be saved after
turning the power supply off.

A disadvantage of this memory is that the process of programming is


relatively slow. It is measured in miliseconds.

71
Special Function Registers (SFR):

Special function registers are part of RAM memory. Their purpose is


predefined by the manufacturer and cannot be changed therefore. Since their bits
are physically connected to particular circuits within the microcontroller, such as
A/D converter, serial communication module etc., any change of their state directly
affects the operation of the microcontroller or some of the circuits.

For example, writing zero or one to the SFR controlling an input/output port
causes the appropriate port pin to be configured as input or output. In other words,
each bit of this register controls the function of one single pin.
72
Program Counter:

Program Counter is an engine running the program and points to the


memory address containing the next instruction to execute. After each instruction
execution, the value of the counter is incremented by 1. For this reason, the
program executes only one instruction at a time just as it is written.

However…the value of the program counter can be changed at any moment,


which causes a “jump” to a new memory location. This is how subroutines and
branch instructions are executed.

After jumping, the counter resumes even and monotonous automatic


counting +1, +1, +1…

Central Processor Unit (CPU):

As its name suggests, this is a unit which monitors and controls all processes
within the microcontroller and the user cannot affect its work.

It consists of several smaller subunits, of which the most important are:

Instruction decoder is a part of the electronics which recognizes program


instructions and runs other circuits on the basis of that. The abilities of this circuit
are expressed in the "instruction set" which is different for each microcontroller
family.

73
Arithmetical Logical Unit (ALU) performs all mathematical and logical
operations upon data.

Accumulator is an SFR closely related to the operation of ALU. It is a kind


of working desk used for storing all data upon which some operations should be
executed (addition, shift etc.).

It also stores the results ready for use in further processing. One of the SFRs,
called the Status Register, is closely related to the accumulator, showing at any
given time the "status" of a number stored in the accumulator (the number is
greater or less than zero etc.). A bit is just a word invented to confuse novices at
electronics. Joking aside, this word in practice indicates whether the voltage is
present on a conductor or not. If it is present, the approprite pin is set to logic one
(1), i.e. the bit’s value is 1.

Otherwise, if the voltage is 0 V, the appropriate pin is cleared (0), i.e. the
bit’s value is 0. It is more complicated in theory where a bit is referred to as a
binary digit, but even in this case, its value can be either 0 or 1.

Input/output ports (I/O Ports):

In order to make the microcontroller useful, it is necessary to connect it to


peripheral devices.

74
Each microcontroller has one or more registers (called a port) connected to
the microcontroller pins.

Why do we call them input/output ports? Because it is possible to change a


pin function according to the user's needs. These registers are the only registers in
the microcontroller the state of which can be checked by voltmeter.

Oscillator:

Even pulses generated by the oscillator enable harmonic and synchronous


operation of all circuits within the microcontroller. It is usually configured as to
use quartz-crystal or ceramics resonator for frequency stabilization.

75
It can also operate without elements for frequency stabilization (like RC
oscillator). It is important to say that program instructions are not executed at the
rate imposed by the oscillator itself, but several times slower.

It happens because each instruction is executed in several steps. For some


microcontrollers, the same number of cycles is needed to execute any instruction,
while it's different for other microcontrollers.

Accordingly, if the system uses quartz crystal with a frequency of 20MHz,


the execution time of an instruction is not expected 50nS, but 200, 400 or even 800
nS, depending on the type of the microcontroller.

Timers/Counters:

Most programs use these miniature electronic "stopwatches" in their


operation. These are commonly 8- or 16-bit SFRs the contents of which is
automatically incremented by each coming pulse. Once the register is completely
loaded, an interrupt is generated!

If these registers use an internal quartz oscillator as a clock source, then it is


possible to measure the time between two events (if the register value is T1 at the
moment measurement has started, and T2 at the moment it has finished, then the
elapsed time is equal to the result of subtraction T2-T1 ).

If the registers use pulses coming from external source, then such a timer is
turned into a counter.

76
This is only a simple explanation of the operation itself. It’s somehow more
complicated in practice.

A register or a memory cell is an electronic circuit which can memorize the


state of one byte. Besides 8 bits available to the user, each register has also a
number of addressing bits. It is important to remember that:

All registers of ROM as well as those of RAM referred to as general-purpose


registers are mutually equal and nameless. During programming, each of them can
be assigned a name, which makes the whole operation much easier.

All SFRs are assigned names which are different for different types of the
microcontrollers and each of them has a special function as their name suggests.

77
Power Supply Circuit:

There are two things worth attention concerning the microcontroller power
supply circuit:

Brown out is a potentially dangerous state which occurs at the moment the
microcontroller is being turned off or when power supply voltage drops to the
lowest level due to electric noise.

As the microcontroller consists of several circuits which have different


operating voltage levels, this can cause its out of control performance. In order to
prevent it, the microcontroller usually has a circuit for brown out reset built-in.

This circuit immediately resets the whole electronics when the voltage level
drops below the lower limit.

78
Reset pin is usually referred to as Master Clear Reset (MCLR) and serves for
external reset of the microcontroller by applying logic zero (0) or one (1)
depending on the type of the microcontroller. In case the brown out is not built in
the microcontroller, a simple external circuit for brown out reset can be connected
to this pin.

Serial communication:

Parallel connections between the microcontroller and peripherals established


over I/O ports are the ideal solution for shorter distances up to several meters.

However, in other cases, when it is necessary to establish communication


between two devices on longer distances it is obviously not possible to use parallel
connections.

Then, serial communication is the best solution.

Today, most microcontrollers have several different systems for serial


communication built in as a standard equipment. Which of them will be used
depends on many factors of which the most important are:

 How many devices the microcontroller has to exchange data with?

79
 How fast the data exchange has to be?

 What is the distance between devices?

 Is it necessary to send and receive data simultaneously?

One of the most important things concerning serial communication is the


Protocol which should be strictly observed. It is a set of rules which must be
applied in order that devices can correctly interpret data they mutually exchange.

Fortunately, the microcontrollers automatically take care of this, so the work


of the programmer/user is reduced to a simple write (data to be sent) and read
(received data).

A byte consists of 8 bits grouped together. If a bit is a digit then it is logical


that bytes are numbers. All mathematical operations can be performed upon them,
just like upon common decimal numbers, which is carried out in the ALU.

It is important to remember that byte digits are not of equal significance. The
largest value has the leftmost bit called the most significant bit (MSB). The
rightmost bit has the least value and is therefore called the least significant bit
(LSB).

Since 8 digits (zeros and ones) of one byte can be combined in 256 different
ways, the largest decimal number which can be represented by one byte is 255 (one
combination represents zero).

80
Program:

Unlike other integrated circuits which only need to be connected to other


components and turn the power supply on, the microcontrollers need to be
programmed first. This is a so called "bitter pill" and the main reason why
hardware-oriented electronics engineers stay away from microcontrollers. It is a
trap causing huge losses because the process of programming the microcontroller
is basically very simple.

In order to write a program for the microcontroller, several "low-level"


programming languages can be used such as Assembly, C and Basic (and their
versions as well). Writing program procedure consists of simple writing
instructions in the order in which they should be executed.

There are also many programs running in Windows environment used to


facilitate the work providing additional visual tools.

This book describes the use of Assembly because it is the simplest language
with the fastest execution allowing entire control on what is going on in the circuit.

Interrupt - electronics is usually more faster than physical processes it should keep
under control. This is why the microcontroller spends most of its time waiting for
something to happen or execute. In other words, when some event takes place, the
microcontroller does something.

In order to prevent the microcontroller from spending most of its time


endlessly checking for logic state on input pins and registers, an interrupt is
generated. It is the signal which informs the central processor that something
attention worthy has happened.

81
As its name suggests, it interrupts regular program execution. It can be
generated by different sources so when it occurs, the microcontroller immediately
stops operation and checks for the cause.

If it is needed to perform some operations, a current state of the program


counter is pushed onto the Stack and the appropriate program is executed. It's the
so called interrupt routine.

Stack is a part of RAM used for storing the current state of the program
counter (address) when an interrupt occurs. In this way, after a subroutine or an
interrupt execution, the microcontroller knows from where to continue regular
program execution.

This address is cleared after returning to the program because there is no


need to save it any longer, and one location of the stack is automatically availale
for further use. In addition, the stack can consist of several levels. This enables
subroutines’ nesting, i.e. calling one subroutine from another.

Applications:

Automotive:

Automotive electronics are a demanding application, encompassing a wide


range of products, from body electronics, engine components, and access systems
to lighting and entertainment components.

They must support small designs and offer a high level of integration, to fit
the limited space available in automotive environments. To meet the diverse needs
of a variety of automotive applications, developers need solutions that offer:

 Compliance with strict automotive qualification demands, including


industry standards and automotive-qualified fabs.

82
 Flexible interface options for a variety of HMI capabilities.
 Standards-based connectivity for intelligent networked solutions.
 Protection and compatibility for high-voltage products, including robust
electromagnetic compatibility (EMC); electrostatic discharge (ESD)
protection; and OEM approvals.
 Resistance to high temperatures for trouble-free operation in automotive
environments.
 Maximum safety for automobile access.
 Low power consumption for maximum efficiency.

Building Automation:

Today's intelligent home and building automation solutions offer new levels
of comfort, security, and efficiency. To develop the sophisticated solutions that
meet the needs that consumers demand, designers need standards-based, flexible
technology that can provide:

Innovative touch control to enable a variety of home devices, including


remote controls, control panels, or thermostats.
 Power efficiency to meet the needs of today's green applications.
 Compatibility with standards-based technology to bring innovative
solutions to market, fast.
 Support for wireless networking to enable home connectivity.
 Robust security through hardware authentication and secure
communication, which is essential for highly networked devices.
Home Appliances:

More than ever, consumers have high expectations for home appliances.
They demand sophisticated, feature-rich products that are reliable and easy to use.
To meet these needs, developers of white goods need technology that provides:

 Advanced motor control features for safe, quiet operation.


 Green, power-efficient technology, as well as energy measurement and
control through connectivity with smart metering networks.

83
 Advanced human machine interface (HMI) support through touchscreen
technology for a rich, easy user experience.
 Flexible, compatible connectivity to integrate devices with the outside
world.
 Standards-based certification to enable reliable, high-quality solutions.

Home Entertainment:

Home entertainment systems continue to evolve in size and sophistication,


delivering new levels of experiences and adventure to consumers.

Home Entertainment has expanded to become a veritable indoor electronic


playground for children and adults alike, with systems incorporating large-screen
displays, gaming consoles, audio equipment, and docking stations.

And often this entertainment empire is completely controlled and managed


through a single remote control. Atmel solutions for home entertainment help you
address your most pressing design challenges, including:

 Delivering innovative capabilities that entice consumers to upgrade and


expand.
 Responding to consumer demand for energy-saving solutions.
 Integrating wireless and touchscreen technologies.
 Connecting and protecting more home entertainment products.
 Robust RF interference protection.

Industrial Automation:

As industrial environments become more advanced and connected,


automation technology is developing at a rapid pace. To deliver the
communication features and intelligence required at the plant floor and beyond,
developers need solutions that can provide:

84
 High performance together with power efficiency.
 Rugged environmental design to resist water, dust, moisture, and extreme
temperatures.
 Advanced, yet cost effective Human Machine Interface (HMI) features.
 Support for high-speed wired and wireless communication.
 Dedicated features for functional safety implementation.

Lighting:

Fluorescent and LED lights use 50 to 80 percent less energy than their
incandescent counterparts. No wonder U.S. and European governments are
pushing vendors for lighting solutions that rely on high frequency electronic
ballasts. Successful ballast design depends on a few key tradeoffs:

 Balancing ease of use against design complexity and cost.


 Balancing voltage and current control against design complexity and board
space.
 Balancing functionality against low power consumption.

Metering:

The market for energy, water, and gas metering systems is rapidly changing,
driven by new environmental and conservation concerns and regulations.
Traditional standalone meters are now being replaced by complex networked
systems that utilize a variety of communication methods. To meet the needs of this
evolving Smart Grid, metering developers need solutions that can provide:

 Intelligent support for application and communication stacks.


 Robust security functionality.
 Remote upgrades in the field.
 Support for communications protocols for home connectivity.
Mobile Electronics:

85
Today's mobile products are changing the way people consume information,
socialize, conduct business, and purchase products. Major technology revolutions
have completely changed the landscape for mobile devices.

To meet the needs of increasingly mobile customers, designers require


solutions that offer:

 Efficient power management to support portable devices on the move.


 Fast response time for nimble operation.
 Highly integrated design for small footprint and minimal BOM.
 Support for intuitive touchscreen interfaces.
 Secure hardware authentication of accessoryes.

PC Peripherals:

Today's personal computers do so much more than compute. With the right
peripheral, computers can entertain, educate, connect, monitor, and secure.
Successful PC peripheral design depends on some key tradeoffs:

 Balancing high performance against design complexity and board space.


 Balancing ease of use against design complexity and cost.
 Balancing high functionality against low-power consumption.

DC MOTOR:

In any electric motor, operation is based on simple electromagnetism. A


current-carrying conductor generates a magnetic field when this is then placed in
an external magnetic field, it will experience a force proportional to the current in
the conductor, and to the strength of the external magnetic field. As you are well
aware of from playing with magnets as a kid, opposite (North and South) polarities
attract, while like polarities (North and North, South and South) repel. The internal
configuration of a DC motor is designed to harness the magnetic interaction
between a current-carrying conductor and an external magnetic field to generate
rotational motion.

86
The shunt motor is different from the series motor in that the field winding
is connected in parallel with the armature instead of in series. You should
remember from basic electrical theory that a parallel circuit is often referred to as a
shunt. Since the field winding is placed in parallel with the armature, it is called a
shunt winding and the motor is called a shunt motor. Figure shows a diagram of a
shunt motor. Notice that the field terminals are marked Fl and F2, and the armature
terminals are marked Al andA2. You should notice in this diagram that the shunt
field is represented with multiple turns using a thin line.

Let's start by looking at a simple 2-pole DC electric motor (here red


represents a magnet or winding with a "North" polarization, while green represents
a magnet or winding with a "South" polarization).

Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator,
commutator, field magnet(s), and brushes. In most common DC motors (and all
that BEAMers will see), the external magnetic field is produced by high-strength
permanent magnets1. The stator is the stationary part of the motor ,this includes the
motor casing, as well as two or more permanent magnet pole pieces. The rotor
(together with the axle and attached commutator) rotate with respect to the stator.
The rotor consists of windings (generally on a core), the windings being
electrically connected to the commutator. The above diagram shows a common
motor layout -- with the rotor inside the stator (field) magnets.

The geometry of the brushes, commutator contacts, and rotor windings


are such that when power is applied, the polarities of the energized winding and the
stator magnet(s) are misaligned, and the rotor will rotate until it is almost aligned
with the stator's field magnets. As the rotor reaches alignment, the brushes move to
the next commutator contacts, and energize the next winding. Given our example
two-pole motor, the rotation reverses the direction of current through the rotor

87
winding, leading to a "flip" of the rotor's magnetic field, driving it to continue
rotating.

In real life, though, DC motors will always have more than two poles
(three is a very common number). In particular, this avoids "dead spots" in the
commutator. You can imagine how with our example two-pole motor, if the rotor
is exactly at the middle of its rotation (perfectly aligned with the field magnets), it
will get "stuck" there. Meanwhile, with a two-pole motor, there is a moment where
the commutator shorts out the power supply (i.e., both brushes touch both
commutator contacts simultaneously). This would be bad for the power supply,
waste energy, and damage motor components as well. Yet another disadvantage of
such a simple motor is that it would exhibit a high amount of torque "ripple" (the
amount of torque it could produce is cyclic with the position of the rotor).

88
Diagram of DC shunt motor.

Two factors are important in the selection of a motor for a particular


application: the variation of the speed with a change in load, and the variation of
the torque with a change in load. A shunt motor is basically a constant speed
device. If a load is applied, the motor tends to slow down.

The slight loss in speed reduces the counter emf and results in an increase of
the armature current. This action continues until the increased current produces
enough torque to meet the demands of the increased load. As a result, the shunt
motor is in a state of stable equilibrium because a change of load always produces
a reaction that adapts the power input to the change in load.

The basic circuit for a shunt motor is shown in figure. Note that only a shunt
field winding is shown. Figure shows the addition of a series winding to counteract
the effects of armature reaction. From the standpoint of a schematic diagram,
figure represents a compound motor. However, this type of motor is not considered
89
to be a com pound motor because the commutating winding is not wound on the
same pole as the field winding and the series field has only a few turns of wire in
series with the armature circuit. As a result, the operating characteristics are those
of a shunt motor. This is so noted on the nameplate of the motor by the terms
compensated shunt motor or stabilized shunt motor.

DC MOTOR CONTROL CHARACTERISTICS:

A shunt-wound motor is a direct-current motor in which the field windings


and the armature may be connected in parallel across a constant-voltage supply. In
adjustable speed applications, the field is connected across a constant-voltage
supply and the armature is connected across an independent adjustable-voltage
supply. Permanent magnet motors have similar control

DC MOTOR CHARACTERISTICS:

It will be easier to understand the operation of the DC motor from a


basic diagram that shows the magnetic interaction between the rotating armature
and the stationary field's coils. Below Figure shows three diagrams that explain the
DC motor's operation in terms of the magnetic interaction.
In Fig. (a) you can see that a bar magnet has been mounted on a shaft so
that it can spin. The field winding is one long coil of wire that has been separated
into two sections. The top section is connected to the positive pole of the battery
and the bottom section is connected to the negative pole of the battery. It is
important to understand that the battery represents a source of voltage for this
winding. In the actual industrial-type motor this voltage will come from the DC
voltage source for the motor. The current flow in this direction makes the top coil
the north pole of the magnet and the bottom coil the south pole of the magnet.

90
The bar magnet represents the armature and the coil of wire represents the
field. The arrow shows the direction of the armature's rotation. Notice that the
arrow shows the armature starting to rotate in the clockwise direction. The north
pole of the field coil is repelling the north pole of the armature, and the south pole
of the field coil is repelling the south pole of the armature.

(a) Magnetic diagram that explains the operation of a DC motor. The rotating
magnet moves clockwise because like poles repel.
(b) The rotating magnet is being attracted because the poles are unlike.
(c) The rotating magnet is now shown as the armature coil, and its polarity is
determined by the brushes and commutator segments.

As the armature begins to move, the north pole of the armature comes
closer to the south pole of the field, and the south pole of the armature is coming
closer to the north pole of the field. As the two unlike poles near each other, they
begin to attract. This attraction becomes stronger until the armature's north pole
moves directly in line with the field's south pole, and its south pole moves directly
in line with the field's north pole (b).

When the opposite poles are at their strongest attraction, the armature will
be "locked up" and will resist further attempts to continue spinning. For the
armature to continue its rotation, the armature's polarity must be switched. Since
the armature in this diagram is a permanent magnet, you can see that it would lock
up during the first rotation and not work. If the armature is an electromagnet, its
polarity can be changed by changing the direction of current flow through it. For

91
this reason the armature must be changed to a coil (electromagnet) and a set of
commutator segments must be added to provide a means of making contact
between the rotating member and the stationary member.

One commutator segment is provided for each terminal of the magnetic


coil. Since this armature has only one coil, it will have only two terminals, so the
commutator has two segments.

Since the armature is now a coil of wire, it will need DC current flowing
through it to become magnetized. This presents another problem; since the
armature will be rotating, the DC voltage wires cannot be connected directly to the
armature coil.

A stationary set of carbon brushes is used to make contact to the rotating


armature. The brushes ride on the commutator segments to make contact so that
Current will flow through the armature coil.In Fig. (C) you can see that the DC
voltage is applied to the field and to the brushes.

Since negative DC voltage is connected to one of the brushes, the


commutator segment the negative brush rides on will also be negative. The
armature's magnetic field causes the armature to begin to rotate. This time when
the armature gets to the point where it becomes locked up with the magnetic field,
the negative brush begins to touch the end of the armature coil that was previously
positive and the positive brush begins to touch the end of the armature coil that was
negative.
This action switches the direction of current flow through the armature,
which also switches the polarity of the armature coil's magnetic field at just the
right time so that the repelling and attracting continues. The armature continues to
switch its magnetic polarity twice during each rotation, which causes it to
continually be attracted and repelled with the field poles.

This is a simple two-pole motor that is used primarily for instructional


purposes. Since the motor has only two poles, the motor will operate rather roughly
and not provide too much torque. Additional field poles and armature poles must
be added to the motor for it to become useful for industry.

Two factors are important in the selection of a motor for a particular application:

(1) the variation of the speed with a change in load.

(2) the variation of the torque with a change in load.


92
A shunt motor is basically a constant speed device. If a load is applied, the
motor tends to slow down. The slight loss in speed reduces the counter emf and
results in an increase of the armature current.

This action continues until the increased current produces enough torque to
meet the demands of the increased load. As a result, the shunt motor is in a state of
stable equilibrium because a change of load always produces a reaction that adapts
the power input to the change in load.

The basic circuit for a shunt motor is shown in figure . Note that only a
shunt field winding is shown. Figure 1-10B shows the addition of a series winding
to counteract the effects of armature reaction. From the standpoint of a schematic
diagram, figure 1-10B represents a compound motor. However, this type of motor
is not considered to be a com pound motor because the commutating winding is
not wound on the same pole as the field winding and the series field has only a few
turns of wire in series with the armature circuit.

As a result, the operating characteristics are those of a shunt motor. This is so


noted on the nameplate of the motor by the terms compensated shunt motor or
stabilized shunt motor.

Speed Control

A dc shunt motor has excellent speed control. To operate the motor above its
rated speed, a field rheostat is used to reduce the field current and field flux. To
operate below rated speed, reduce the voltage applied to the armature circuit.

A more modem method of speed control is the electronic speed control system.
The principles of control are the same as the manual controls. Speeds above
normal are achieved by reducing the field voltage electronically and speeds below
normal reduce the voltage applied to the armature.

Rotation

The direction of armature rotation may be changed by reversing the direction


of cur rent in either the field circuit or the armature circuit. For a motor with a
simple shunt field circuit, it may be easier to reverse the field circuit lead. If the
motor has a series winding, or an interpole winding to counteract armature
reaction, the same relative direction of cur rent must be maintained in the shunt and
series windings. For this reason, it is always easier to reverse the direction of the
armature current.
93
Shunt motor connections:

(A) Without Commutating Poles; (B) With Commutating Poles

Torque

A dc shunt motor has high torque at any speed. At startup, a dc shunt motor
develops 150 percent of its rated torque if the resistors used in the starting
mechanism are capable of withstanding the heating effects of the current. For very
short periods of time, the motor can develop 350 percent of full load torque, if
necessary.

Speed Regulation

The speed regulation of a shunt motor drops from 5 percent to 10 percent from the
no-load state to full load. As a result, a shunt motor is superior to the series dc
motor, but is inferior to a compound-wound dc motor. Figure shows a dc motor
with horse power ratings ranging from 1 hp to 5 hp.

the field coil. In this application the armature coil is usually changed, as was the
case with the series motor. the electrical diagram of a DC shunt motor connected to
a forward and reversing motor starter. You should notice that the Fl and F2
terminals of the shunt field are connected directly to the power supply, and the Al
and A2 terminals of the armature winding are connected to the reversing starter.
When the FMS is energized, its contacts connect the Al lead to the positive power
supply terminal and the A2 lead to the negative power supply terminal.

The Fl motor lead is connected directly to the positive terminal of the


power supply and the F2 lead is connected to the negative terminal. When the
motor is wired in this configuration, it will begin to run in the forward direction.
When the RMS is energized, its contacts reverse the armature wires so that the Al
lead is connected to the negative power supply terminal and the A2 lead is

94
connected to the positive power supply terminal. The field leads are connected
directly to the power supply, so their polarity is not changed.

Since the field's polarity has remained the same and the armature's polarity
has reversed, the motor will begin to rotate in the reverse direction. The control
part of the diagram shows that when the FMS coil is energized, the RMS coil is
locked out. Installing a Shunt Motor A shunt motor can be installed easily.

The motor is generally used in belt-drive applications. This means that the
installation procedure should be broken into two sections, which include the
mechanical installation of the motor and its load, and the installation of electrical
wiring and controls.

When the mechanical part of the installation is completed, the alignment of


the motor shaft and the load shaft should be checked. If the alignment is not true,
the load will cause an undue stress on the armature bearing and there is the
possibility of the load vibrating and causing damage to it and the motor. After the
alignment is checked, the tension on the belt should also be tested. As a rule of
thumb, you should have about V2 to 1/4 inch of play in the belt when it is properly
tensioned.

Several tension measurement devices are available to determine when a belt is


tensioned properly. The belt tension can also be compared to the amount of current
the motor draws.

The motor must have its electrical installation completed to use this method.
The motor should be started, and if it is drawing too much current, the belt should
be loosened slightly but not enough to allow the load to slip. If the belt is slipping,
it can be tightened to the point where the motor is able to start successfully and not
draw current over its rating The electrical installation can be completed before,

GAS SENSOR

Gas detectors and gas sensors interact with a gas to initiate the
measurement of its concentration. The gas detector of gas sensor then
provides output to a gas instrument to display the measurements.

95
Common gases measured by gas detectors and gas sensors include
ammonia, aerosols, arsine, bromine, carbon dioxide, carbon monoxide,
chlorine, chlorine dioxide, Diborane, dust, fluorine, germane,
halocarbons or refrigerants, hydrocarbons, hydrogen, hydrogen chloride,
hydrogen cyanide, hydrogen fluoride, hydrogen selenide, hydrogen
sulfide, mercury vapor, nitrogen dioxide, nitrogen oxides, nitric oxide,
organic solvents, oxygen, ozone, phosphate, silane, sulfur dioxide, and
water vapor.

Important measurement specifications to consider when looking


for gas detectors and gas sensors include the response time, the distance,
and the flow rate. The response time is the amount of time required
from the initial contact with the gas to the sensors processing of the
signal. Distance is the maximum distance from the leak or gas source
that the sensor can detect gases. The flow rate is the necessary flow rate
of air or gas across the gas detectors or gas sensors to produce a signal.

In our project we use MQ6 type gas sensor

They are used in gas leakage detecting equipments in family and


industry, are suitable for detecting of LPG, iso-butane, propane, LNG,
avoid the noise of alcohol and cooking fumes and cigarette smoke.

Features:

 High sensitivity LPG, iso-butane, propane


 Small sensitivity to alcohol, smoke
 Fast response
 Wide detection range
 Stable performance and long life

 Simple drive circuit

96
Level sensor:

Introduction:

Level sensors detect the level of substances that flow, including liquids,
slurries, granular materials, and powders. All such substances flow to become
essentially level in their containers (or other physical boundaries) because of
gravity. The substance to be measured can be inside a container or can be in its
natural form (e.g. a river or a lake).

The level measurement can be either continuous or point values. Continuous


level sensors measure level within a specified range and determine the exact
amount of substance in a certain place, while point-level sensors only indicate
whether the substance is above or below the sensing point. Generally the latter
detect levels that are excessively high or low.

There are many physical and application variables that affect the selection of
the optimal level monitoring method for industrial and commercial processes. The
selection criteria include the physical: phase (liquid, solid or slurry), temperature,
pressure or vacuum, chemistry, dielectric constant of medium, density (specific
gravity) of medium, agitation (action), acoustical or electrical noise, vibration,
mechanical shock, tank or bin size and shape.

Also important are the application constraints: price, accuracy, appearance,


response rate, ease of calibration or programming, physical size and mounting of
the instrument, monitoring or control of continuous or discrete (point) levels.

Description:

 The MCX104A DC Microsyn Level Sensor electromagnetically measures


the deviation of the sensor and its mount from a gravity reference.

 The reference is an oil damped pendulous mass having freedom of


movement in one plane about a fixed center point.

 The sensor can be used as a component in a system requiring a reference for


control with respect to gravity.

97
 It is ideal for use on mobile equipment where a surface must be finished to a
required level with respect to gravity.
 In typical use, the sensor is connected to a controller, which controls a
hydraulic control valve such as a KVF servovalve.

 If an off-level surface is required, an adjustable setpoint reference can be


used, providing up to a ±10% slope reference.

Features:

 Modular design: Compact unit can be mounted on any vertical surface.

 Totally enclosed in a rugged cast aluminum housing.

 Easy to wire. Connections between controller and sensor are made through
MS connectors.

 Excellent sensitivity. The shaft supporting the pendulous mass and the rotor
of the microsyn is mounted on ball bearings for smooth, low-friction
rotation.

 Oil damped to ignore extraneous vibration.

 DC input and output voltages designed for analog and microcontroller


interface.
 Point and continuous level detection for solids.

 A variety of sensors are available for point level detection of solids. These
include vibrating, rotating paddle, mechanical (diaphragm), microwave
(radar), capacitance, optical, pulsed-ultrasonic and ultrasonic level sensors.

Vibrating point:

These detect levels of very fine powders (bulk density: 0.02 g/cm 3 – 0.2
g/cm3), fine powders (bulk density: 0.2 – 0.5 g/cm 3), and granular solids (bulk
density: 0.5 g/cm3 or greater). With proper selection of vibration frequency and

98
suitable sensitivity adjustments, they can also sense the level of highly fluidized
powders and electrostatic materials.

Single-probe vibrating level sensors are ideal for bulk powder level. Since
only one sensing element contacts the powder, bridging between two probe
elements is eliminated and media build-up is minimized. The vibration of the probe
tends to eliminate build-up of material on the probe element. Vibrating level
sensors are not affected by dust, static-charge build-up from dielectric powders, or
changes in conductivity, temperature, pressure, humidity or moisture content.
Tuning-fork style vibration sensors are another alternative. They tend to be less
costly, but are prone to material buildup between the times.

Rotating paddle:

Rotating paddle level sensors are a very old and established technique for
bulk solid point level indication. The technique uses a low speed gear motor that
rotates a paddle wheel. When the paddle is stalled by solid materials, the motor is
rotated on its shaft by its own torque until a flange mounted on the motor contacts
a mechanical switch.

The paddle can be constructed from a variety of materials, but tacky material
must not be allowed to build up on the paddle. Build up may occur if the process
material becomes tacky because of high moisture levels or high ambient humidity
in the hopper.

For materials with very low weight per unit volume such as Pearlite,
Bentonite or fly ash, special paddle designs and low-torque motors are used. Fine
particles or dust must be prevented from penetrating the shaft bearings and motor
by proper placement of the paddle in the hopper or bin and using appropriate seals.

Admittance-type:

An RF Admittance level sensor uses a rod probe and RF source to measures


the change in admittance. The probe is driven through a shielded coaxial cable to
eliminate the effects of changing cable capacitance to ground.

99
When the level changes around the probe, a corresponding change in the di-
electric is observed. This changes the admittance of this imperfect capacitor and
this change is measured to detect change of level.

Point level detection of liquids:

Pulse-Wave Ultrasonic (Non Invasive):

The principle behind a Pulsed-Ultrasonic technology is that the transmit


signal consists of short bursts of ultrasonic energy. After each burst, the electronics
looks for a return signal within a small window of time corresponding to the time it
takes for the energy to pass through the vessel.

Only signal received during this window period will qualify for additional
signal processing. The dry signal will not be received within this window, and
therefore will be ignored.

Magnetic and mechanical float:

The principle behind magnetic, mechanical, cable, and other float level
sensors involves the opening or closing of a mechanical switch, either through
direct contact with the switch, or magnetic operation of a reed. With magnetically
actuated float sensors, switching occurs when a permanent magnet sealed inside a
float rises or falls to the actuation level.

With a mechanically actuated float, switching occurs as a result of the


movement of a float against a miniature (micro) switch. For both magnetic and
mechanical float level sensors, chemical compatibility, temperature, specific
gravity (density), buoyancy, and viscosity affect the selection of the stem and the
float.

For example, larger floats may be used with liquids with specific gravities as
low as 0.5 while still maintaining buoyancy. The choice of float material is also
influenced by temperature-induced changes in specific gravity and viscosity –
changes that directly affect buoyancy.[2]

100
Float-type sensors can be designed so that a shield protects the float itself
from turbulence and wave motion. Float sensors operate well in a wide variety of
liquids, including corrosives.

When used for organic solvents, however, one will need to verify that these
liquids are chemically compatible with the materials used to construct the sensor.
Float-style sensors should not be used with high viscosity (thick) liquids, sludge or
liquids that adhere to the stem or floats, or materials that contain contaminants
such as metal chips; other sensing technologies are better suited for these
applications.

A special application of float type sensors is the determination of interface


level in oil-water separation systems. Two floats can be used with each float sized
to match the specific gravity of the oil on one hand, and the water on the other.

Another special application of a stem type float switch is the installation of


temperature or pressure sensors to create a multi-parameter sensor. Magnetic float
switches are popular for simplicity, dependability and low cost.

Pneumatic:

Pneumatic level sensors are used where hazardous conditions exist, where
there is no electric power or its use is restricted, and in applications involving
heavy sludge or slurry.

As the compression of a column of air against a diaphragm is used to actuate


a switch, no process liquid contacts the sensor's moving parts. These sensors are
suitable for use with highly viscous liquids such as grease, as well as water-based
and corrosive liquids. This has the additional benefit of being a relatively low cost
technique for point level monitoring.

Conductive:

Conductive level sensors are ideal for the point level detection of a wide
range of conductive liquids such as water, and is especially well suited for highly
corrosive liquids such as caustic soda, hydrochloric acid, nitric acid, ferric
chloride, and similar liquids.
101
For those conductive liquids that are corrosive, the sensor’s electrodes need
to be constructed from titanium, Hastelloy B or C, or 316 stainless steel and
insulated with spacers, separators or holders of ceramic, polyethylene and Teflon-
based materials.
Depending on their design, multiple electrodes of differing lengths can be
used with one holder. Since corrosive liquids become more aggressive as
temperature and pressure increase, these extreme conditions need to be considered
when specifying these sensors.

Conductive level sensors use a low-voltage, current-limited power source applied


across separate electrodes. The power supply is matched to the conductivity of the
liquid, with higher voltage versions designed to operate in less conductive (higher
resistance) mediums.

The power source frequently incorporates some aspect of control, such as


high-low or alternating pump control. A conductive liquid contacting both the
longest probe (common) and a shorter probe (return) completes a conductive
circuit. Conductive sensors are extremely safe because they use low voltages and
currents.

Since the current and voltage used is inherently small, for personal safety
reasons, the technique is also capable of being made “Intrinsically Safe” to meet
international standards for hazardous locations. Conductive probes have the
additional benefit of being solid-state devices and are very simple to install and
use.

In some liquids and applications, maintenance can be an issue. The probe


must continue to be conductive. If buildup insulates the probe from the medium, it
will stop working properly. A simple inspection of the probe will require an
ohmmeter connected across the suspect probe and the ground reference.

Typically, in most water and wastewater wells, the well itself with its
ladders, pumps and other metal installations, provides a ground return. However, in
chemical tanks, and other non-grounded wells, the installer must supply a ground
return, typically an earth rod.

Sensors for both Point Level Detection or Continuous Monitoring of


Solids and Liquids:

102
Ultrasonic:

Ultrasonic level sensors are used for non-contact level sensing of highly
viscous liquids, as well as bulk solids. They are also widely used in water
treatment applications for pump control and open channel flow measurement. The
sensors emit high frequency (20 kHz to 200 kHz) acoustic waves that are reflected
back to and detected by the emitting transducer.

Ultrasonic level sensors are also affected by the changing speed of sound
due to moisture, temperature, and pressures. Correction factors can be applied to
the level measurement to improve the accuracy of measurement.

Turbulence, foam, steam, chemical mists (vapors), and changes in the


concentration of the process material also affect the ultrasonic sensor’s response.
Turbulence and foam prevent the sound wave from being properly reflected to the
sensor; steam and chemical mists and vapors distort or absorb the sound wave; and
variations in concentration cause changes in the amount of energy in the sound
wave that is reflected back to the sensor. Stilling wells and wave guides are used to
prevent errors caused by these factors.

Proper mounting of the transducer is required to ensure best response to


reflected sound. In addition, the hopper, bin, or tank should be relatively free of
obstacles such as weldments, brackets, or ladders to minimise false returns and the
resulting erroneous response, although most modern systems have sufficiently
"intelligent" echo processing to make engineering changes largely unnecessary
except where an intrusion blocks the "line of sight" of the transducer to the target.

Since the ultrasonic transducer is used both for transmitting and receiving
the acoustic energy, it is subject to a period of mechanical vibration known as
“ringing”. This vibration must attenuate (stop) before the echoed signal can be
processed.

The net result is a distance from the face of the transducer that is blind and
cannot detect an object. It is known as the “blanking zone”, typically 150mm – 1m,
depending on the range of the transducer.

The requirement for electronic signal processing circuitry can be used to make the
ultrasonic sensor an intelligent device. Ultrasonic sensors can be designed to
provide point level control, continuous monitoring or both.

103
Due to the presence of a microprocessor and relatively low power
consumption, there is also capability for serial communication from to other
computing devices making this a good technique for adjusting calibration and
filtering of the sensor signal, remote wireless monitoring or plant network
communications. The ultrasonic sensor enjoys wide popularity due to the powerful
mix of low price and high functionality.

Capacitance:

Capacitance level sensors excel in sensing the presence of a wide variety of


solids, aqueous and organic liquids, and slurries. The technique is frequently
referred to as RF for the radio frequency signals applied to the capacitance circuit.

The sensors can be designed to sense material with dielectric constants as


low as 1.1 (coke and fly ash) and as high as 88 (water) or more. Sludges and
slurries such as dehydrated cake and sewage slurry (dielectric constant approx. 50)
and liquid chemicals such as quicklime (dielectric constant approx. 90) can also be
sensed.

Dual-probe capacitance level sensors can also be used to sense the interface
between two immiscible liquids with substantially different dielectric constants,
providing a solid state alternative to the aforementioned magnetic float switch for
the “oil-water interface” application.

Since capacitance level sensors are electronic devices, phase modulation and
the use of higher frequencies makes the sensor suitable for applications in which
dielectric constants are similar.

The sensor contains no moving parts, is rugged, simple to use, easy to clean,
and can be designed for high temperature and pressure applications. A danger
exists from build up and discharge of a high-voltage static charge that results from
the rubbing and movement of low dielectric materials, but this danger can be
eliminated with proper design and grounding.

Appropriate choice of probe materials reduces or eliminates problems


caused by abrasion and corrosion. Point level sensing of adhesives and high-
viscosity materials such as oil and grease can result in the build up of material on
the probe; however, this can be minimized by using a self-tuning sensor.

104
For liquids prone to foaming and applications prone to splashing or
turbulence, capacitance level sensors can be designed with splashguards or stilling
wells, among other devices.
A significant limitation for capacitance probes is in tall bins used for storing
bulk solids. The requirement for a conductive probe that extends to the bottom of
the measured range is problematic.

Long conductive cable probes (20 to 50 meters long) suspended into the bin
or silo, are subject to tremendous mechanical tension due to the weight of the bulk
powder in the silo and the friction applied to the cable. Such installations will
frequently result in a cable breakage.

Optical interface:

Optical sensors are used for point level sensing of sediments, liquids with
suspended solids, and liquid-liquid interfaces. These sensors sense the decrease or
change in transmission of infrared light emitted from an infrared diode (LED).
With the proper choice of construction materials and mounting location, these
sensors can be used with aqueous, organic, and corrosive liquids.

A common application of economical infrared-based optical interface point


level sensors is detecting the sludge/water interface in settling ponds. By using
pulse modulation techniques and a high power infrared diode, one can eliminate

105
interference from ambient light, operate the LED at a higher gain, and lessen the
effects of build-up on the probe.

An alternate approach for continuous optical level sensing involves the use
of a laser. Laser light is more concentrated and therefore is more capable of
penetrating dusty or steamy environments. Laser light will reflect off most solid,
liquid surfaces.

The time of flight can be measured with precise timing circuitry, to


determine the range or distance of the surface from the sensor. Lasers remain
limited in use in industrial applications due to cost, and concern for maintenance.
The optics must be frequently cleaned to maintain performance.

Microwave:

Microwave sensors are ideal for use in moist, vaporous, and dusty
environments as well as in applications in which temperatures vary. Microwaves
(also frequently described as RADAR), will penetrate temperature and vapor layers
that may cause problems for other techniques, such as ultrasonic.

Microwaves are electromagnetic energy and therefore do not require air


molecules to transmit the energy making them useful in vacuums. Microwaves, as
electromagnetic energy, are reflected by objects with high conductive properties,
like metal and conductive water.

Alternately, they are absorbed in various degrees by dielectric or insulating


mediums such as plastics, glass, paper, many powders and food stuffs and other
solids.

Microwave sensors are executed in a wide variety of techniques. Two basic


signal processing techniques are applied, each offering its own advantages: Time-
Domain Reflectometry (TDR) which is a measurement of time of flight divided by
the speed of light, similar to ultrasonic level sensors, and Doppler systems
employing FMCW techniques.

Just as with ultrasonic level sensors, microwave sensors are executed at


various frequencies, from 1 GHz to 30 GHz. Generally, the higher the frequency,
the more accurate, and the more costly.

106
Microwave is also executed as a non-contact technique, monitoring a
microwave signal that is transmitted through the medium (including vacuum), or
can be executed as a “radar on a wire” technique.

In the latter case, performance improves in powders and low dielectric


media that are not good reflectors of electromagnetic energy transmitted through a
void (as in non-contact microwave sensors). But the same mechanical constraints
exist that cause problems for the capacitance (RF) techniques mentioned
previously.

Microwave-based sensors are not affected by fouling of the microwave-


transparent glass or plastic window through which the beam is passed nor by high
temperature, pressure, or vibration.

These sensors do not require physical contact with the process material, so
the transmitter and receiver can be mounted a safe distance from the process, yet
still respond to the presence or absence of an object. Microwave transmitters offer
the key advantages of ultrasonics: the presence of a microprocessor to process the
signal provides numerous monitoring, control, communications, setup and
diagnostic capabilities.

Additionally, they solve some of the application limitations of ultrasonics:


operation in high pressure and vacuum, high temperatures, dust, temperature and
vapor layers. One major disadvantage of microwave or radar techniques for level
monitoring is the relatively high price of such sensors.
Continuous level measurement of liquids:

Magnetostrictive:

Magnetostrictive level sensors are similar to float type sensors in that a


permanent magnet sealed inside a float travels up and down a stem in which a
magnetostrictive wire is sealed.

Ideal for high-accuracy, continuous level measurement of a wide variety of


liquids in storage and shipping containers, these sensors require the proper choice
of float based on the specific gravity of the liquid.

107
When choosing float and stem materials for magnetostrictive level sensors,
the same guidelines described for magnetic and mechanical float level sensors
apply.

Because of the degree of accuracy possible with the magnetostrictive


technique, it is popular for “custody-transfer” applications. It can be permitted by
an agency of weights and measures for conducting commercial transactions. It is
also frequently applied on magnetic sight gages.
In this variation, the magnet is installed in a float that travels inside a gage
glass or tube. The magnet operates on the sensor which is mounted externally on
the gage. Boilers and other high temperature or pressure applications take
advantage of this performance quality.

Resistive chain:

Resistive chain level sensors are similar to magnetic float level sensors in
that a permanent magnet sealed inside a float moves up and down a stem in which
closely spaced switches and resistors are sealed.

When the switches are closed, the resistance is summed and converted to
current or voltage signals that are proportional to the level of the liquid.

The choice of float and stem materials depends on the liquid in terms of
chemical compatibility as well as specific gravity and other factors that affect
buoyancy.

These sensors work well for liquid level measurements in marine, chemical
processing, pharmaceuticals, food processing, waste treatment, and other
applications. With the proper choice of two floats, resistive chain level sensors can
also be used to monitor for the presence of an interface between two immiscible
liquids whose specific gravities are more than 0.6, but differ by as little as 0.1 unit.

Hydrostatic pressure:

Hydrostatic pressure level sensors are submersible or externally mounted


pressure sensors suitable for measuring the level of corrosive liquids in deep tanks

108
or water in reservoirs. For these sensors, using chemically compatible materials is
important to assure proper performance. Sensors are commercially available from
10mbar to 1000bar.

Since these sensors sense increasing pressure with depth and because the
specific gravities of liquids are different, the sensor must be properly calibrated for
each application.

In addition, large variations in temperature cause changes in specific gravity


that should be accounted for when the pressure is converted to level. These sensors
can be designed to keep the diaphragm free of contamination or build-up, thus
ensuring proper operation and accurate hydrostatic pressure level measurements.

For use in open air applications, where the sensor cannot be mounted to the
bottom of the tank or pipe thereof, a special version of the hydrostatic pressure
level sensor can be suspended from a cable into the tank to the bottom point that is
to be measured.

The sensor must be specially designed to seal the electronics from the liquid
environment. In tanks with a small head pressure (less than 100 INWC), it is very
important to vent the back of the sensor gauge to atmospheric pressure.

Otherwise, normal changes in barometric pressure will introduce large error


in the sensor output signal. In addition, most sensors need to be compensated for
temperature changes in the fluid.

Air bubbler:

An air bubbler system uses a tube with an opening below the surface of the
liquid level. A fixed flow of air is passed through the tube. Pressure in the tube is
proportional to the depth (and density) of the liquid over the outlet of the tube.

Air bubbler systems contain no moving parts, making them suitable for
measuring the level of sewage, drainage water, sewage sludge, night soil, or water
with large quantities of suspended solids. The only part of the sensor that contacts
the liquid is a bubble tube which is chemically compatible with the material whose
level is to be measured.

109
Since the point of measurement has no electrical components, the technique
is a good choice for classified “Hazardous Areas”. The control portion of the
system can be located safely away, with the pneumatic plumbing isolating the
hazardous from the safe area.

Air bubbler systems are a good choice for open tanks at atmospheric
pressure and can be built so that high-pressure air is routed through a bypass valve
to dislodge solids that may clog the bubble tube.

The technique is inherently “self-cleaning”. It is highly recommended for


liquid level measurement applications where ultrasonic, float or microwave
techniques have proved undependable.

Gamma ray:

A nuclear level gauge or gamma ray gauge measures level by the attenuation
of gamma rays passing through a process vessel. The technique is used to regulate
the level of molten steel in a continuous casting process of steelmaking.

The water-cooled mold is arranged with a source of radiation, such as


Cobalt-60 or Cesium-137, on one side and a sensitive detector such as a
scintillometer on the other. As the level of molten steel rises in the mold, less of
the gamma radiation is detected by the sensor.

The technique allows non-contact measurement where the heat of the molten
metal makes any contact technique impractical.

Technical data:

110
Features:

 High accuracy and reliability.


 Completely submersible pressure transducer and cable.
 Compact, rugged design for easy installation.
 Minimal maintenance and care.
 Water level sensor compatible with most monitoring equipment.
 4-20mA output.
 Vented cable for automatic barometric compensation.
 Multiple level ranges available from 3' to 500'.
 Wet-wet water level sensor eliminates vent tube concerns.

111
 Dynamic temperature compensation system.
 Submersible pressure transducer not affected by foam, wind, or rain.
 Monitors levels in groundwater wells, rivers, streams, tanks, lift stations and
open channels.
 CE Certified.

Sensing Element:

 Sensor Element: Silicone Diaphragm, Wet/Wet Transducer.

 Pressure Range: 0-3, 0-15, 0-30, 0-60, 0-120, 0-250, 0-500 ft.

 Linearity and Hysteresis: ±0.1% FS.

 Accuracy: ±0.1% of full scale at constant temperature, ±0.2% over 35°F to


70°F (1.37° to 21.1°C) range.

 Overpressure: Not to exceed 2 x full scale range.

 Resolution: Infinitesimal (Analog).

 Outputs: 4-20 mA or 0.5 to 2.5 VDC across 125 ohms.

 Supply Voltage: 8 to 36 VDC.

 Current Draw: Same as sensor output.

 Warm Up Time: 3 seconds recommended.

 Operating Temperature: -40° to +185°F (-40° to +85°C).

 Compensation: Uses dynamic temperature compensation 30 to 70°F (-1.1


to 21.1°C). Automatic barometric pressure compensation.

 Weight: 1/2 lb (227 g).

Applications:

 The SLW... series water level switches work to maintain a constant water
level avoiding material wastage in your process plant.

112
 Common applications also include switching pumps on and off to avoid
overflow, dry running and indicating water level in an empty tank to avoid
wear and tear and production stoppage.

 Many of our customers in the Food, Power, Chemicals, Sugar, Detergent,


Steel, Minerals and Textile industry have used the SLW... series water level
indicator /sensor.
 TEMPERATURE SENSOR:



 The measurement of temperature is one of the
fundamental requirements for environmental control, as well as
certain chemical, electrical and mechanical controls. Many different
types of temperature sensors are commercially available, and the type
of temperature sensor that will be used in any particular application
will depend on several factors. For example, cost, space constraints,
durability, and accuracy of the temperature sensor are all
considerations that typically need to be taken into account.
 Various types of temperature sensors are known
including liquid-in-glass (LIG) thermometers, bimetallic
thermometers, resistance thermometers, thermocouples, and
radiometers. Depending upon the temperature to be measured, the
required accuracy of the measurement, and other factors such as
durability or cost, one type of temperature sensor may be preferable
over another.
 Some temperature sensors provide a wide range of
temperature measurement, whereas other temperature sensors may
only provide temperature information for a small temperature range.
In addition to the temperature range sensed, the sensitivity and the

113
accuracy of temperature sensors may also vary widely. Additionally,
some temperature sensors work at high voltages while others only
work at low voltages.
 There're many types of devices that can be employed as
temperature sensors. They include integrated circuits (ICs),
pyrometers, resistance temperature detectors (RTDs), thermistors,
thermocouples, electromechanical & volume (EMV).
 LM35 is a precision IC temperature sensor with its output
proportional to the temperature (in oC). The sensor circuitry is sealed
and therefore it is not subjected to oxidation and other processes. With
LM35, temperature can be measured more accurately than with a
thermistor. It also possess low self heating and does not cause more
than 0.1 oC temperature rise in still air.
 The operating temperature range is from -55°C to 150°C. The
output voltage varies by 10mV in response to every oC rise/fall in
ambient temperature, i.e., its scale factor is 0.01V/ oC.


 Temperature sensors are frequently provided in integrated


circuits to detect when the operating temperature limits have been

114
exceeded. Typical integrated circuit (IC) solutions for sensing
temperature change use a semiconductor temperature sensor
manufactured, entirely on the IC. Such ICs include transistors,
bolometers and pyroelectrics.
 The integrated circuit sensor typically employs an integrated
diode whose output characteristics are dependent upon temperature.
The semiconductor temperature sensor can be a forward-biased pn
junction diode or variations thereof as is known in the art, such as a
diode connected npn or pnp bipolar transistor. Bolometers
incorporating temperature sensors are well known devices for
measuring radiation, and in these devices the temperature sensors are
arranged to have temperatures dependent on the flux of incident
radiation.
 Different types of bolometer are used for measuring
different types of radiation in various environments; in fusion
experiments, for example, bolometers are used to measure
quantitatively the radiation and neutral particle emission from the
plasma. The resistance temperature detector (RTD) takes advantage of
the principal that the resistivity of metals is, to a small degree,
dependent upon temperature.
 RTDs include all metals in the form of wire, thin/thick-films
and foil, in which the change in metal resistance vs temperature
produces a change in voltage drop, under constant current bias.
Thermistors include hot-pressed and/or fired ceramics, with embedded
electrical contact wires; the principle of operation is identical to that
of RTDs.
 The thermistor is a temperature sensitive resistor and is
generally composed of semiconductor materials. Thermocouples
include metals, in the form of wires or thin-films, in which the
junction formed between 2 dissimilar metals generates a temperature
dependent voltage. The thermocouple method takes advantage of the
fact that, when two wires composed of dissimilar metals are joined at
the ends and one of the ends is heated, there is a continuous current
generated which flows in the thermo-electric circuit.
 Thermocouples do not require electrical input to the TC
junction but they do require an electrical input to maintain a reference
junction.
 EMVs include devices such as metal coils and strips, and
volumetric tube and bulb thermometers, in which
expansion/contraction of the metal/fluid is used to measure
115
temperature. Pyrometers which are sensitive to infrared, optical and
acoustic wavelengths, convert the input wavelength to an optical or
electronic output by means of an IC, RTD, thermistor or
thermocouple.
 Temperature sensors normally generate an output signal that
increases with increasing temperature. A temperature sensor
comprises a sensing element housed in an elongated sheath.
 The sensing element itself may be an electrical resistive
element. The sensor is commonly installed in a thermowell to position
the sensor element at a location at which the temperature reading is
desired. Temperature sensors such as digital thermometers often
measure temperature by exploiting the thermal-voltage characteristics
of a diode.
 The temperature coefficient of a diode is the voltage drop
across the diode as a finction of temperature while the diode is
forward-biased by a constant current. The thin-film temperature
sensor is a thin-film type sensor which comprises an alumina or
silicon substrate and multiple layers laminated on the substrate by
using the semiconductor micromachining technique. Known examples
of a thermal type infrared sensor with such a structure include a
micro-thermistor bolometer and a thin-film thermistor.
 Thermistor devices for temperature sensors are used in the
measurement of temperatures in the range 400-1300.degree. C. and
are used in the measurement of automotive exhaust gas temperatures,
gas flame temperatures in gas water heaters and the like, and the
temperatures of heating ovens.
 Digital temperature sensors are well known. Digital
temperature sensors are typically used to generate a temperature
reference for the circuits on the chip or other integrated chips. Digital
temperature sensors, such as voltage reference circuits, generate a
temperature output signal by normalizing a thermometer voltage to a
reference voltage.
 The analog to digital converter of the digital temperature
sensor measures the temperature dependent voltage ratiometrically
relative to the reference voltage. It is also known to use capacitors as
temperature sensors, where temperature changes lead to dimensional
changes of the dielectric material separating the capacitor's electrodes,
resulting in changes in capacitance which can be measured using a
capacitance bridge.

116
 The thermal type infrared sensor is a non-contact type sensor
that measures the surface temperature of hot objects and moving
objects. An infrared detecting portion of the sensor is heated by the
energy of infrared radiated from the object being measured and a
change in electric resistance of a thermal sensitive resistor making up
the infrared detecting portion of the sensor is detected as a
temperature change, from which the surface temperature is
determined.
 To measure temperature by means of infrared emission,
thermal (infrared) radiation can be detected either by quantum
detectors or by thermal detectors.
 Quantum detectors, such as photoresistors or
photodiodes, require cryogenic cooling to measure relatively low
temperatures with high accuracy. On the other hand, thermal
detectors, while not as sensitive as quantum, may operate at normal
room temperatures.

 Temperature sensors are utilized in a wide variety of applications


in which it is necessary to monitor the temperature within a space.
Temperature sensors are incorporated in a number of electronic
circuits for a variety of purposes.
 A large number of circuits and/or functional units in today's
electronic devices are temperature sensitive and require accurate and
reliable temperature information in order to take corrective action
when the temperature becomes too high.
 In the computer and data processing industry there is an ever
increasing demand for higher processing speeds and systems which
are capable of performing multiple tasks in parallel. To increase
processor performance, clock frequencies used by microprocessors,
often referred to as CPUs, have increased. Also, as the number of
circuits that can be used in a CPU has increased, the number of
parallel operations has risen.
 As processor performance continues to increase, the result
has been a larger number of circuits switching at faster rates. Higher
frequencies and data throughput cause a processor to consume
increased power and run at increased temperatures.
 Extreme temperatures can slow the speed of transistors that
may cause some CPU activities to be incomplete at the end of a cycle.
Dissipation by integrated circuits exceeding a safe temperature limit
needs to be signaled so that the dissipation can be controlled.

117
 In addition, the operating temperature range for a particular
electronic system may have to be limited. For integrated circuits such
as processors heat sinks are provided to dissipate heat generated by
the processor. Fans are typically utilized in conjunction with heat
sinks to blow air on the fins of the heat sink to achieve greater cooling
through convection.
 Temperature detectors have been used for monitoring the
operating temperature of non-volatile EEPROM memories used in
smartcards. Smartcards are plastics cards having an integrated circuit,
such as a memory circuit or a microcontroller, embedded therein.
These cards are increasing in popularity for a variety of applications,
including credit cards, POS cards, telephone cards, access control
cards, etc.
 Temperature sensors with a relatively high degree of
accuracy are used in smart antenna systems for ground based
applications (e.g., cellular antennas) and airborne applications (e.g.,
airplane or satellite antennas). Smart antenna systems, such as
adaptive or phased array antennas, combine the outputs of multiple
antenna elements with signal processing capabilities to transmit and/or
receive communications signals.
 With temperature sensors, such antenna systems can vary
the transmission or reception pattern of the communications signals in
response to the signal environment to improve performance
characteristics.
 Temperature sensors are utilized to monitor a variety of automotive
systems, including for example coolant temperature and exhaust gas
temperature. These sensors typically utilize a wire-type thermistor
which is generally soldered to hard-wired leads.
 As engine technology becomes increasingly more
sophisticated, the number and variety of sensors used in controlling
the engine has continued to climb. Modern automotive engines
typically rely on numerous engine parameters for correct engine
operation. Optimum engine parameters are generally stored in the
memory of an engine controller. Typical engines may include many
sensors used to provide information to the vehicle owner, operator,
and service personnel and/or used to control the engine.
 Temperature sensors may be used to provide engine
protection by quickly detecting adverse operating conditions which
may indicate a fault or malfunction to reduce or eliminate any
permanent engine damage.
118
 The engine control module (ECM) monitors the sensor
inputs to detect conditions which may trigger a diagnostic code or
fault which may be used by owners/operators and/or service and
maintenance personnel to troubleshoot and repair the engine. High
temperature resistance temperature detector (RTD) sensors are used in
emission-control systems used with internal combustion engines
because they can detect changes in temperature with time constants on
the order of about 10 seconds or less as is required in that type of
application.
 To measure temperatures up to about 1,000.degree. C.,
thermocouples that use platinum/platinum-rhodium or
nickel/chromium-nickel have been used. Temperature sensors for use
need to be accurate and reliable while operating in the harsh vehicle
environment over a long period of time. Further, since there may be
many sensor assemblies per vehicle, the cost of the sensors must be
minimized.
 Temperature sensors are also used in a variety of other
applications. For instance, a temperature sensor has been used in
petrochemical industry, process control industry, electrical, oil and
gas exploration & mining industries whereas exact measurement of
particular temperature has to be controlled for getting the desired
products or composition.
 Temperature sensors are commonly utilized in cold rooms
to monitor the temperature within the area to ensure that the
temperature does not increase to a point where the goods may be at a
risk of spoilage.
 In such applications, a separate temperature sensor is connected
to an alarm system to provide for a warning if the temperature
increases beyond a particular limit. Storage areas where products are
stored which must be kept from freezing are required to have the
temperature monitored to ensure that it does not fall below a level at
which the products may freeze.
 Temperature sensors are also used in greenhouses to maintain
the temperature within an acceptable growing range, while also
ensuring that the temperature has not reached a level which would
cause permanent damage to the crops. LIG thermometers are standard
equipment at laboratories and surface weather stations. LIG
thermometers have a fine glass bore and a fluid reservoir. Operation
depends on the thermal expansion of the liquid contained in the glass
envelope. The sensitivity of the LIG thermometer depends inversely
119
on the diameter of the bore of the tube and on the relative expansion
coefficients of the liquid and glass.
 Applications:

 The LM35 can be applied easily in the same way as other
integrated-circuit temperature sensors. It can be glued or cemented to
a surface and its temperature will be within about 0.01°C of the
surface temperature.
 This presumes that the ambient air temperature is almost the
same as the surface temperature; if the air temperature were much
higher or lower than the surface temperature, the actual temperature of
the LM35 die would be at an intermediate temperature between the
surface temperature and the air temperature.
 This is expecially true for the TO-92 plastic package, where the
copper leads are the principal thermal path to carry heat into the
device, so its temperature might be closer to the air temperature than
to the surface temperature.
 To minimize this problem, be sure that the wiring to the
LM35, as it leaves the device, is held at the same temperature as the
surface of interest. The easiest way to do this is to cover up these
wires with a bead of epoxy which will insure that the leads and wires
are all at the same temperature as the surface, and that the LM35 die’s
temperature will not be affected by the air temperature.
 The TO-46 metal package can also be soldered to a metal
surface or pipe without damage. Of course, in that case the V−
terminal of the circuit will be grounded to that metal.Alternatively, the
LM35 can be mounted inside a sealed-end metal tube, and can then be
dipped into a bath or screwed into a threaded hole in a tank. As with
any IC, the LM35 and accompanying wiring and circuits must be kept
insulated and dry, to avoid leakage and corrosion.
 This is especially true if the circuit may operate at cold
temperatures where condensation can occur. Printed-circuit coatings
and varnishes such as Humiseal and epoxy paints or dips are often
used to insure that moisture cannot corrode the LM35 or its
connections.
 These devices are sometimes soldered to a small light-
weight heat fin, to decrease the thermal time constant and speed up
the response in slowly-moving air. On the other hand, a small thermal
mass may be added to the sensor, to give the steadiest reading despite
small deviations in the air temperature.
120

 Typical Applications:

 LM35 with Decoupling from Capacitive Load


LM35 with R-C Damper

 Two-Wire Remote Temperature Sensor


Two-Wire Remote Temperature Sensor

(Output Referred to Ground)
 (Grounded Sensor)

121

 Temperature Sensor, Single Supply ( −55° to+150°C)


 Two-Wire Remote Temperature Sensor(Output Referred to
Ground)

122

 To-20 mA Current Source (0°C to +100°C)
 Physical Dimensions inches (millimeters) unless otherwise noted
(Continued)


123
 Power Package TO-220 (T) Order Number LM35DT NS Package
Number TA03F


 TO-92 Plastic Package (Z)Order Number LM35CZ,
LM35CAZ or LM35DZ NS Package Number Z03A

 As can be seen, the LM34 and LM35 are easy-to-use


temperature sensors with excellent linearity. These sensors can be
used with minimal external circuitry for a wide variety of applications
and do not require any elaborate scaling schemes nor offset voltage
subtraction to reproduce the Fahrenheit and Celsius temperature scales
respectively.
 VOICE BOARD:

 The APR9600 experimental board is an assembled PCB board
consisting of an APR9600 IC, an electret microphone, support
components and necessary switches to allow users to explore all
124
functions of the APR9600 chip. The oscillation resistor is chosen so
that the total recording period is 60 seconds with a sampling rate of
4.2 kHz.




 Features

 • Single-chip, high-quality voice recording & playback solution
 - No external ICs required
 - Minimum external components
 • Non-volatile Flash memory technology
 - No battery backup required
 • User-Selectable messaging options
 - Random access of multiple fixed-duration messages
 - Sequential access of multiple variable-duration messages
 • User-friendly, easy-to-use operation
 - Programming & development systems not required
 - Level-activated recording & edge-activated play back switches
 • Low power consumption
 - Operating current: 25 mA typical
 - Standby current: 1 uA typical

125
 - Automatic power-down
 • Chip Enable pin for simple message expansion

 Pin functions of the IC :



 During sound recording, sound is picked up by the
microphone. A microphone pre-amplifier amplifies the voltage signal
from the microphone.

 An AGC circuit is included in the pre-amplifier, the extent of
which is controlled by an external capacitor and resistor. If the voltage
level of a sound signal is around 100 mV peak to-peak, the signal can
be fed directly into the IC through ANA IN pin (pin 20).

 The sound signal passes through a filter and a sampling and hold
circuit. The analogue voltage is then written into non-volatile flash
analogue RAMs. It has a 28 pin DIP package. Supply voltage is
between 4.5V to 6.5V. During recording and replaying, current
consumption is 25 mA. In idle mode, the current drops to 1 A.

 The APR9600 device offers true single-chip voice recording,
non- volatile storage, and playback capability for 40 to 60 seconds.

126
The device supports both random and sequential access of multiple
messages. Sample rates are user-selectable, allowing designers to
customize their design for unique quality and storage time needs.

 Integrated output amplifier, microphone amplifier, and AGC
circuits greatly simplify system design. The device is ideal for use in
portable voice recorders, toys, and many other consumer and
industrial applications.

 APLUS integrated achieves these high levels of storage capability
by using its proprietary analog/multilevel storage technology
implemented in an advanced Flash non-volatile memory process,
where each memory cell can store 256 voltage levels. This technology
enables the APR9600 device to reproduce voice signals in their
natural form. It eliminates the need for encoding and compression,
which often introduce distortion.

 FUNCTIONAL DESCRIPTION:



 The APR9600 block diagram is included in order to give
understanding of the APR9600 internal architecture. At the left hand
side of the diagram are the analog inputs. A differential Microphone

127
amplifier, including integrated AGC, is included on-chip for
applications requiring its use.

 The amplified microphone signal is fed into the device by connecting
the Ana_Out pin to the Ana_In pin through an external DC blocking
capacitor. Recording can be fed directly into the Ana_In pin through a
DC blocking capacitor, however, the connection between Ana_In and
Ana_Out is still required for playback. The next block encountered by
the input signal is
 the internal anti-aliasing filter.
 The filter automatically adjusts its response according to the sampling
frequency selected so Shannon’s Sampling Theorem is satisfied. After
anti-aliasing filtering is accomplished the signal is ready to be clocked
into the memory array. This storage is accomplished through a
combination of the Sample and Hold circuit and the Analog
Write/Read circuit.
 These circuits are clocked by either the Internal Oscillator or an
external clock source. When playback is desired the previously stored
recording is retrieved from memory, low pass filtered, and amplified
as shown on the right hand side of the diagram. The signal can be
heard by connecting a speaker to the SP+ and SP- pins.
 Chip-wide management is accomplished through the device control
block shown in the upper right hand corner. Message management is
controlled through the message control block represented in the lower
center of the block diagram.

128


 Message Management General Description:

 Playback and record operations are managed by on chip
circuitry. There are several available messaging modes depending
upon desired operation. These message modes determine message
management style, message length, and external parts count.
Therefore, the designer must select the appropriate operating mode
before beginning the design.
 Operating modes do not affect voice quality, for information
on factors affecting quality refer to the Sampling Rate & Voice
Quality section.

 The device supports three message management modes
(defined by the MSEL1, MSEL2 and /M8_Option pins shown in
Figures 1 and 2):

 • Random access mode with 2, 4, or 8 fixed-duration messages
 • Tape mode, with multiple variable-duration messages, provides
129
 two options:

 - Auto rewind
 - Normal

 Modes cannot be mixed. Switching of modes after the device has
recorded an initial message is not recommended. If modes are
switched after an initial recording has been made some unpredictable
message fragments from the previous mode may remain present, and
be audible on playback, in the new mode.
 These fragments will disappear after a record operation in the
newly selected mode.

 Table 1 defines the decoding necessary to choose the desired mode.
An important feature of the APR9600 message management
capabilities is the ability to audibly prompt the user to changes in the
device’s status through the use of “beeps” superimposed on the
device’s output. This feature is enabled by asserting a logic high level
on the BE pin.

 Random Access Mode:



 Random access mode supports 2, 4, or 8 messages segments of
fixed duration. As suggested recording or playback can be made
randomly in any of the selected messages. The length of each message
segment is the total recording length available (as defined by the
selected sampling rate) divided by the total number of segments
enabled (as decoded in Table1). Random access mode provides easy
indexing to message segments.

 Functional Description of Recording in Random Access Mode:

130
 On power up, the device is ready to record or play back, in any of the
enabled message segments. To record, /CE must be set low to enable
the device and /RE must be set low to enable recording. You initiate
recording by applying a low level on the message trigger pin that
represents the message segment you intend to use.

 The message trigger pins are labeled /M1_Message - /M8_Option on
pins 1-9 (excluding pin 7) for message segments 1-8 respectively.

 Note: Message trigger pins /M1_Message, /M2_Next, /M7_END, and
/M8_Option, have expanded names to represent the different
functionality that these pins assume in the other modes. In random
access mode these pins should be considered purely message trigger
pins with the same functionality as /M3, /M4, /M5, and /M6. For a
more thorough explanation of the functionality of device pins in
different modes please refer to the pin description table that appears
later in this document.

 When actual recording begins the device responds with a single beep
(if the BE pin is high to enable the beep tone) at the speaker outputs to
indicate that it has started recording.

 Recording continues as long as the message pin stays low. The rising
edge of the same message trigger pin during record stops the
recording operation (indicated with a single beep).

 If the message trigger pin is held low beyond the end of the
maximum allocated duration, recording stops automatically (indicated
with two beeps), regardless of the state of the message trigger pin. The
chip then enters low-power mode until the message trigger pin returns
high. After the message triggerpin returns to high, the chip enters
standby mode.

 Tape Mode:

 Tape mode manages messages sequentially much like traditional
cassette tape recorders. Within tape mode two options exist, auto
rewind and normal. Auto rewind mode configures the device to
automatically rewind to the beginning of the

131
 message immediately following recording or playback of the message.
In tape mode, using either option, messages must be recorded or
played back sequentially, much like a traditional cassette tape
recorder.

 Function Description Recording in Tape Mode :

 On power up, the device is ready to record or play back, starting at
the first address in the memory array. To record, /CE must be set low
to enable the device and /RE must be set low to enable recording. A
falling edge of the /M1_Message pin initiates voice recording
(indicated by one beep). A subsequent rising edge of the
/M1_Message pin during recording stops the recording (also indicated
by one beep).
 If the /M1_Message pin is held low beyond the end of the available
memory, recording will stop automatically (indicated by two beeps).
The device will then assert a logic low on the /M7_END pin for a
duration equal to 1600 cycles of the sample sample clock, regardless
of the state of the /M1_Message pin.

 The device returns to standby mode when the /M1_Message pin goes
high again. After recording is finished the device will automatically
rewind to the beginning of the most recently recorded message and
wait for the next user input. The auto rewind function is convenient
because it allows the user to immediately playback and review the
message without the need to rewind.

 However, caution must be practiced because a subsequent record
operation will overwrite the last recorded message unless the user
remembers to pulse the /M2_Next pin in order to increment the device
past the current message.

 A subsequent falling edge on the /M1_Message pin starts a new
record operation, overwriting the previously existing message. You
can preserve the previously recorded message by using the /M2_Next
input to initiate recording in the next available message segment. To
perform this function,the /M2_Next pin must be pulled low for at least
400 cycles of the sample clock.

132
 The auto rewind mode allows the user to record over the
previous message simply by initiating a record sequence without first
toggling the /M2_Next pin. To record over any other message
however requires a different sequence. You must pulsethe /CE pin
low once to rewind the device to the beginning of the voice memory.

 The /M2_Next pin must then be pulsed low for the specified
number of times to move to the start of the message you wish to
overwrite. Upon arriving at the desired message a record sequence can
be initiated to overwrite the previously recorded material.

 After you overwrite the message it becomes the last available
message and all previously recorded messages following this message
become inaccessible. If during a record operation all the available
memory is used the device will stop recording automatically, (double
beep) and set the /M7_END pin low for a duration equal to 1600
cycles of the sample clock.

 Playback can be initiated on this last message, but pulsing
the /M2_Next pin will put the device into an “overflow state”. Once
the device enters an overflow state any subsequent pulsing of
/M1_Message or /M2_Next will only result in a double beep and
setting of the /M7_END pin low for a duration equal to 400 cycles of
the sample clock.

 To proceed from this state the user must rewind the device to
the beginning of the memory array. This can be accomplished by
toggling the /CE pin low or cycling power. All inputs, except the /CE
pin, are ignored during recording.

 Function Description of Playback in Tape Mode using Auto
Rewind Option:

 On power-up, the device is ready to record or play
back,starting at the first address in the memory array. Before you can
begin playback, the /CE input must be set to low to enable the device
and /RE must be set to high to disable recording and enable playback.

133
 The first high to low going pulse of the /M1_Message pin
initiates playback from the beginning of the current message, on
power up the first message is the current message.

 When the /M1_Message pin pulses low the second time,
playback of the current message stops immediately. When the
/M1_Message pin pulses low a third time, playback of the current
message starts again from its beginning. If you hold the /M1_Message
pin low continuously the same message will play continuously in a
looping fashion.

 A 1,530 ms period of silence is inserted during looping as an
indicator to the user of the transition between the beginning and end
of the message.Note that in auto rewind mode the device always
rewinds to the beginning of the current message.
 To listen to a subsequent message the device must be fast
forwarded past the current message to the next message. This function
is accomplished by toggling the /M2_Next pin from high to low.The
pulse must be low for least 400 cycles of the sampling clock.

 After the device is incremented to the desired message the
user can initiate playback of the message with the playback sequence
described above. A special case exists when the /M2_Next pin goes
low during playback.

 Playback of the current message will stop, the device will
beep, advance to the next message and initiate playback of the next
message.
 (Note that if /M2_Next goes low when not in playback mode, the
device will prepare to play the next message, but will not actually
initiate playback).

 If the /CE pin goes low during playback, playback of the
current message will stop, the device will beep, reset to the beginning
of the first message, and wait for a subsequent playback command.

 When you reach the end of the memory array, any
subsequent pulsing of /M1_Message or /M2_Next will only result in a
double beep. To proceed from this state the user must rewind the
device to the beginning of the memory array. This
134
 can be accomplished by toggling the /CE pin low or cycling power.

MIWI:

MIWI is a specification for a suite of high level communication


protocols using small, low-power digital radios based on the IEEE 802.15.4-2003
standard for Low-Rate Wireless Personal Area Networks (LR-WPANs), such as
wireless light switches with lamps, electrical meters with in-home-displays,
consumer electronics equipment via short-range radio needing low rates of data
transfer.

The technology defined by the MIWI specification is intended to be


simpler and less expensive than other WPANs, such as Bluetooth. MIWI is
targeted at radio-frequency (RF) applications that require a low data rate, long
battery life, and secure networking.

MIWI is a low-cost, low-power, wireless mesh networking


standard. First, the low cost allows the technology to be widely deployed in
wireless control and monitoring applications. Second, the low power-usage allows
longer life with smaller batteries. Third, the mesh networking provides high
reliability and more extensive range.

It is not capable of powerline networking though other elements of the


OpenHAN standards suite promoted by openAMI and UtilityAMI deal with
communications co-extant with AC power outlets. In other words, MIWI is
intended not to support powerline networking but to interface with it at least for
smart metering and smart appliance purposes. Utilities, e.g. Penn Energy, have
declared the intent to require them to interoperate again via the openHAN
standards.

135
The relationship between IEEE 802.15.4 and MIWI is similar to that
between IEEE 802.11 and the Wi-Fi Alliance. The MIWI 1.0 specification was
ratified on 14 December 2004 and is available to members of the MIWI Alliance.
Most recently, the MIWI 2007 specification was posted on 30 October 2007. The
first MIWI Application Profile, Home Automation, was announced 2 November
2007. As amended by NIST, the Smart Energy Profile 2.0 specification will
remove the dependency on IEEE 802.15.4. Device manufacturers will be able to
implement any MAC/PHY, such as IEEE 802.15.4(x) and IEEE P1901, under an
IP layer based on 6LoWPAN.

MIWI 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. The technology is intended to be simpler and less
expensive than other WPANs such as Bluetooth. MIWI chip vendors typically sell
integrated radios and microcontrollers with between 60 KB and 256 KB flash
memory.

Radios are also available as stand-alone components to be used with any


processor or microcontroller. Generally, the chip vendors also offer the MIWI
software stack, although independent ones are also available.

Because MIWI can activate (go from sleep to active mode) in 30 msec or
less, the latency can be very low and devices can be very responsive — particularly
compared to Bluetooth wake-up delays, which are typically around three seconds.
[3]
Because MIWIs can sleep most of the time, average power consumption can be
very low, resulting in long battery life.

136
The first stack release is now called MIWI 2004. The second stack release is
called MIWI 2006, and mainly replaces the MSG/KVP structure used in 2004 with
a "cluster library". The 2004 stack is now more or less obsolete.

MIWI 2007, now the current stack release, contains two stack profiles, stack
profile 1 (simply called MIWI), for home and light commercial use, and stack
profile 2 (called MIWI Pro). MIWI Pro offers more features, such as multi-casting,
many-to-one routing and high security with Symmetric-Key Key Exchange
(SKKE), while MIWI (stack profile 1) offers a smaller footprint in
RAM and flash. Both offer full mesh networking and work with all MIWI
application profiles.

MIWI 2007 is fully backward compatible with MIWI 2006 devices: A MIWI
2007 device may join and operate on a MIWI 2006 network and vice versa. Due to
differences in routing options, MIWI Pro devices must become non-routing MIWI
End-Devices (ZEDs) on a MIWI 2006 network, the same as for MIWI 2006
devices on a MIWI 2007 network must become ZEDs on a MIWI Pro network.
The applications running on those devices work the same, regardless of the stack
profile beneath them.

Licensing

For non-commercial purposes, the MIWI specification is available free to


the general public.An entry level membership in the MIWI Alliance, called
Adopter, provides access to the as-yet unpublished specifications and permission to
create products for market using the specifications.

The click through license on the MIWI specification requires a


commercial developer to join the MIWI Alliance. "No part of this specification
may be used in development of a product for sale without becoming a member of
MIWI Alliance." .

This causes problems for open-source developers because the annual fee
conflicts with the GNU General Public License. From the GPL v2, "b) You must
cause any work that you distribute or publish, that in whole or in part contains or is
derived from the Program or any part there of, to be licensed as a whole at no
charge to all third parties under the terms of this License." Since the GPL makes no

137
distinction between commercial and non-commercial use it is impossible to
implement a GPL licensed MIWI stack or combine a MIWI implementation with
GPL licensed code. The requirement for the developer to join the MIWI Alliance
similarly conflicts with most other Free software licenses.

MIWI protocols are intended for use in embedded applications requiring low
data rates and low power consumption. MIWI's current focus is to define a general-
purpose, inexpensive, self-organizing mesh network that can be used for industrial
control, embedded sensing, medical data collection, smoke and intruder warning,
building automation, home automation, etc. The resulting network will use very
small amounts of power — individual devices must have a battery life of at least
two years to pass MIWI certification.

Typical application areas include

Home Entertainment and Control — 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.

Device types

There are three different types of MIWI devices:

MIWI coordinator (ZC):

The most capable device, the coordinator forms the root of the network
tree and might bridge to other networks. There is exactly one MIWI coordinator in
each network since it is the device that started the network originally. It is able to
store information about the network, including acting as the Trust Center &
repository for security keys.

MIWI Router (ZR):

As well as running an application function, a router can act as an


intermediate router, passing on data from other devices.

MIWI End Device (ZED):

138
Contains just enough functionality to talk to the parent node (either the
coordinator or a router); it cannot relay data from other devices. This relationship
allows the node to be asleep a significant amount of the time thereby giving long
battery life. A ZED requires the least amount of memory, and therefore can be less
expensive to manufacture than a ZR or ZC.

Protocols

The protocols build on recent algorithmic research (Ad-hoc On-demand Distance


Vector, neuRFon) to automatically construct a low-speed ad-hoc network of nodes.
In most large network instances, the network will be a cluster of clusters. It can
also form a mesh or a single cluster. The current profiles derived from the MIWI
protocols support beacon and non-beacon enabled networks.

In non-beacon-enabled networks (those whose beacon order is 15), an


unslotted CSMA/CA channel access mechanism is used. In this type of network,
MIWI Routers typically have their receivers continuously active, requiring a more
robust power supply. However, this allows for heterogeneous networks in which
some devices receive continuously, while others only transmit when an external
stimulus is detected. The typical example of a heterogeneous network is a wireless
light switch: The MIWI node at the lamp may receive constantly, since it is
connected to the mains supply, while a battery-powered light switch would remain
asleep until the switch is thrown. The switch then wakes up, sends a command to
the lamp, receives an acknowledgment, and returns to sleep. In such a network the
lamp node will be at least a MIWI Router, if not the MIWI Coordinator; the switch
node is typically a MIWI End Device.

In beacon-enabled networks, the special network nodes called MIWI


Routers transmit periodic beacons to confirm their presence to other network
nodes. Nodes may sleep between beacons, thus lowering their duty cycle and
extending their battery life. Beacon intervals may range from 15.36 milliseconds to
15.36 ms * 214 = 251.65824 seconds at 250 kbit/s, from 24 milliseconds to 24 ms *
214 = 393.216 seconds at 40 kbit/s and from 48 milliseconds to 48 ms * 2 14 =
786.432 seconds at 20 kbit/s. However, low duty cycle operation with long beacon
intervals requires precise timing, which can conflict with the need for low product
cost.

139
In general, the MIWI protocols minimize the time the radio is on so as to
reduce power use. In beaconing networks, nodes only need to be active while a
beacon is being transmitted. In non-beacon-enabled networks, power consumption
is decidedly asymmetrical: some devices are always active, while others spend
most of their time sleeping.

Except for the Smart Energy Profile 2.0, which will be MAC/PHY
agnostic, MIWI devices are required to conform to the IEEE 802.15.4-2003 Low-
Rate Wireless Personal Area Network (WPAN) standard. The standard specifies
the lower protocol layers—the physical layer (PHY), and the media access control
(MAC) portion of the data link layer (DLL). This standard specifies operation in
the unlicensed 2.4 GHz (worldwide), 915 MHz (Americas) and 868 MHz (Europe)
ISM bands. In the 2.4 GHz band there are 16 MIWI channels, with each channel
requiring 5 MHz of bandwidth. The center frequency for each channel can be
calculated as, FC = (2405 + 5 * (ch - 11)) MHz, where ch = 11, 12, ..., 26.

The radios use direct-sequence spread spectrum coding, which is managed


by the digital stream into the modulator. BPSK is used in the 868 and 915 MHz
bands, and OQPSK that transmits four bits per symbol is used in the 2.4 GHz band.
The raw, over-the-air data rate is 250 kbit/s per channel in the 2.4 GHz band, 40
kbit/s per channel in the 915 MHz band, and 20 kbit/s in the 868 MHz band.
Transmission range is between 10 and 75 meters (33 and 246 feet) and up to 1500
meters for MIWI pro, although it is heavily dependent on the particular
environment. The output power of the radios is generally 0 dBm (1 mW).

The basic channel access mode is "carrier sense, multiple access/collision


avoidance" (CSMA/CA). That is, the nodes talk in the same way that people
converse; they briefly check to see that no one is talking before they start. There
are three notable exceptions to the use of CSMA. Beacons are sent on a fixed
timing schedule, and do not use CSMA. Message acknowledgments also do not
use CSMA. Finally, devices in Beacon Oriented networks that have low latency
real-time requirements may also use Guaranteed Time Slots (GTS), which by
definition do not use CSMA.

MIWI RF4CE:

140
On March 3, 2009 the RF4CE (Radio Frequency for Consumer Electronics)
Consortium agreed to work with the MIWI Alliance to jointly deliver a
standardized specification for radio frequency-based remote controls. MIWI
RF4CE is designed to be deployed in a wide range of remotely-controlled
audio/visual consumer electronics products, such as TVs and set-top boxes. It
promises many advantages over existing remote control solutions, including richer
communication and increased reliability, enhanced features and flexibility,
interoperability, and no line-of-sight barrier.

Software and hardware

The software is designed to be easy to develop on small, inexpensive


microprocessors. The radio design used by MIWI has been carefully optimized for
low cost in large scale production. It has few analog stages and uses digital circuits
wherever possible.

Even though the radios themselves are inexpensive, the MIWI Qualification
Process involves a full validation of the requirements of the physical layer. This
amount of concern about the Physical Layer has multiple benefits, since all radios
derived from that semiconductor mask set would enjoy the same RF
characteristics. On the other hand, an uncertified physical layer that malfunctions
could cripple the battery lifespan of other devices on a MIWI network. Where
other protocols can mask poor sensitivity or other esoteric problems in a fade
compensation response, MIWI radios have very tight engineering constraints: they
are both power and bandwidth constrained. Thus, radios are tested to the ISO
17025 standard with guidance given by Clause 6 of the 802.15.4-2006 Standard.
Most vendors plan to integrate the radio and microcontroller onto a single chip
getting smaller devices.

History

MIWI-style networks began to be conceived around 1998, when many


installers realized that both Wi-Fi and Bluetooth were going to be unsuitable for
many applications. In particular, many engineers saw a need for self-organizing ad-
hoc digital radio networks.

141
The IEEE 802.15.4-2003 standard was completed in May 2003 and has been
superseded by the publication of IEEE 802.15.4-2006.

In the summer of 2003, Philips Semiconductors, a major mesh network


supporter, ceased the investment. Philips Lighting has, however, continued Philips'
participation, and Philips remains a promoter member on the MIWI Alliance Board
of Directors.

The MIWI Alliance announced in October 2004 that the membership had
more than doubled in the preceding year and had grown to more than 100 member
companies, in 22 countries. By April 2005 membership had grown to more than
150 companies, and by December 2005 membership had passed 200 companies.

The MIWI specifications were ratified on 14 December 2004.

The MIWI Alliance announces public availability of Specification 1.0 on 13


June 2005, known as MIWI 2004 Specification.

The MIWI Alliance announces the completion and immediate member


availability of the enhanced version of the MIWI Standard in September 2006,
known as MIWI 2006 Specification.During the last quarter of 2007, MIWI PRO,
the enhanced MIWI specification was finalized.

142
ELECTRICAL CHARACTERSTICS:

DEVICE OVERVIEW:

The MRF24J40MA is a 2.4 GHz IEEE Std. 802.15.4™ compliant, surface


mount module with integrated crystal, internal voltage regulator, matching
circuitry and PCB antenna.

The MRF24J40MA module operates in the non-licensed 2.4 GHz frequency


band and is FCC, IC and ETSI compliant. The integrated module design frees the

143
integrator from extensive RF and antenna design, and regulatory compliance
testing, allowing quicker time to market.

MRF24J40MA BLOCK DIAGRAM:

RECOMMANDED PCB FOOT PRINT:

MODULE DETAILS:

144
MOUNTING DETAILS:

CIRCUIT DIAGRAM:

145
FEATURES:

2.4 GHz IEEE Std. 802.15.4™ RF Transceiver Module :

 IEEE Std. 802.15.4™ Compliant RF Transceiver .


 Supports MIWI®, MIWI™, MIWI™ P2P and
 Proprietary Wireless Networking Protocols
 Small Size: 0.7” x 1.1” (17.8 mm x 27.9 mm),
 Surface Mountable
 Integrated Crystal, Internal Voltage Regulator,
 Matching Circuitry and PCB Antenna
 Easy Integration into Final Product – Minimize
 Product Development, Quicker Time to Market
 Radio Regulation Certification for United States
 (FCC), Canada (IC) and Europe (ETSI)
 Compatible with Microchip Microcontroller
 Families (PIC16F, PIC18F, PIC24F/H, dsPIC33 and PIC32)
146
 Up to 400 ft. Range
 Operating Voltage: 2.4-3.6V (3.3V typical)
 Temperature Range: -40°C to +85°C Industrial
 Simple, Four-Wire SPI Interface
 Low-Current Consumption:
 -RX mode: 19 mA (typical)
 -TX mode: 23 mA (typical)
 -Sleep: 2 µA (typical)

RF/Analog Features:

 ISM Band 2.405-2.48 GHz Operation


 Data Rate: 250 kbps
 -94 dBm Typical Sensitivity with +5 dBm
 Maximum Input Level
 +0 dBm Typical Output Power with
 36 dB TX Power Control Range
 Integrated Low Phase Noise VCO, Frequency Synthesizer and PLL Loop
Filter .
 Digital VCO and Filter Calibration .
 Integrated RSSI ADC and I/Q DACs
 Integrated LDO .
 High Receiver and RSSI Dynamic Range .

MAC/Baseband Features:

 Hardware CSMA-CA Mechanism, Automatic ACK Response and FCS


Check
 Independent Beacon, Transmit and GTS FIFO
 Supports all CCA modes and RSS/LQI
 Automatic Packet Retransmit Capable
 Hardware Security Engine (AES-128) with CTR, CCM and CBC-MAC
modes .
 Supports Encryption and Decryption for MAC Sublayer and Upper Layer .

147
Applications

 ·2.4-GHz IEEE 802.15.4 systems


 ·RF4CE remote control systems (64-KB flash and higher)
 ·MIWI systems (256-KB flash)
 ·Home/Building automation
 ·Lighting systems
 ·Industrial control and monitoring
 ·Low-Power wireless sensor networks
 ·Consumer electronics
 ·Health care
 PH SENSOR
 The most common pH sensor is the glass electrode. It's used in many industry applications and
in a wide variety of fields. The glass-electrode method has high reproducibility, and it can
measure pH of various solutions.

Electrochemical sensor

A pH electrode is a potentiometric or electrochemical sensor that has a voltage output. A


potentiometric sensor consists of two electrochemical cells or electrodes:

- the glass electrode, sometimes called the measuring electrode or active electrode.

- and the reference electrode.

The electric potential created between the glass electrode, and the reference electrode is a
function of the pH value of the measured solution. So once the potential difference has been
measured you can calculate the pH value. How? Nernst equation, see below, will explain more.

"A battery with a variable voltage"

When the glass and the reference electrode, are immersed in a solution, a small galvanic cell is
established. If you use a voltmeter and measure the potential between these two electrodes,
you will see a potential difference.

148
The pH sensor is essentially a simple single cell battery. It can be thought of as a battery, with a
voltage that varies with the pH of the measured solution.

149
Combination electrodes 

The majority of pH electrodes available
commercially are combination electrodes that
have both the glass electrode and the
reference electrode conveniently placed in
one housing. While the reference electrode
and the pH measuring electrode are physically
combined into one electrode, the electrodes
still function independently, and characteristic
problems remain.

To learn more about how the pH sensor


works, please continue to read:

• Nernst equation - mathematical description


of the pH electrode.

• Glass electrode - why the electrical potential


of the glass electrode indicate the pH value.

• Reference electrode - makes contact with
the sample solution and (should) deliver a
stable reference potential.

• pH versus temperature - always take into


account the temperature at pH
measurements.

• Different potentials of a pH electrode - the


measured pH electrode potential is affected
by a number of factors.

• Combination electrode - modern electrodes


combine the reference and standard
electrodes into one unit.

• Nonglass pH electrode - an alternative to the


glass electrode where an unbreakable sensor
is required.

150

RELAY

A relay is an electrically operated switch. Current flowing


through the coil of the relay creates a magnetic field which attracts a
lever and changes the switch contacts. The coil current can be on or off
so relays have two switch positions and they are double throw
(changeover) switches.

Relays allow one circuit to switch a second circuit which can be


completely separate from the first. For example a low voltage battery
circuit can use a relay to switch a 230V AC mains circuit. There is no
electrical connection inside the relay between the two circuits; the link is
magnetic and mechanical.

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.

151
Advantages of relays:

 Relays can switch AC and DC, transistors can only switch DC.
 Relays can switch high voltages, transistors cannot.
 Relays are a better choice for switching large currents (> 5A).
 Relays can switch many contacts at once.

Disadvantages of relays:

 Relays are bulkier than transistors for switching small currents.


 Relays cannot switch rapidly (except reed relays), transistors can
switch many times per second.
 Relays use more power due to the current flowing through their
coil.
 Relays require more current than many ICs can provide, so a
low power transistor may be needed to switch the current for the
relay's coil.

152
Circuit Diagram
Transmitter Section

153
Figure.3.10.Circuit Diagram of Transmitter section

154
Receiver Section

155
Figure.3.11.Circuit Diagram of Receiver Section

3.2.Summary

Thus in this chapter, we have described every module of hardware in


the project, in detail along with architecture of 8951 and 89s52 microcontroller.

156
CHAPTER-4
SOFTWARE ANALYSIS

157
SOFTWARE ANALYSIS

4.1 Introduction

The main purpose of using the microcontroller in our project is


because high-performance CMOS 8-bit microcontroller with 8K bytes of in-system
programmable Flash memory. By combining a versatile 8-bit CPU with in-system
programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful
microcontroller which provides a highly-flexible and cost-effective solution to
many embedded control applications.

The programs of the microcontroller have been written in Embedded


C language and were compiled using KEIL, a compiler used for microcontroller
programming. The communication between PC and the microcontroller was
established MAX 232 standard and those programs were also done in C language.

The following programs are used at various stages for the mentioned functions

Serial communication In this program, the various special function


registers of the microcontroller are set such that they can send and receive data
from the PC. This program uses the serial library to communicate with the ports.

4.2 KEIL compiler

The C programming language is a general-purpose, programming


language that provides code efficiency, elements of structured programming, and a

158
rich set of operators. C is not a big language and is not designed for any one
particular area of application. Its generality combined with its absence of
restrictions, makes C a convenient and effective programming solution for a wide
variety of software tasks. Many applications can be solved more easily and
efficiently with C than with other more specialized languages.

The Cx51 Optimizing C Compiler is a complete implementation of the


American National Standards Institute (ANSI) standard for the C language. Cx51
is not a universal C compiler adapted for the 8051 target. It is a ground-up
implementation dedicated to generating extremely fast and compact code for the
8051 microprocessor. Cx51 provides you the flexibility of programming in C and
the code efficiency and speed of assembly language.

Since Cx51 is a cross compiler, some aspects of the C programming


language and standard libraries are altered or enhanced to address the peculiarities
of an embedded target processor.

Support for all 8051 Variants

The 8051 Family is one of the fastest growing Microcontroller


Architectures. More than 400 device variants from various silicon vendors are
today available. New extended 8051 Devices, like the Philips 80C51MX
architecture are dedicated for large application with several Mbytes code and data
space. For optimum support of these different 8051 variants, Keil provides the
several development tools that are listed in the table below. A new output file
format (OMF2) allows direct support of up to 16MB code and data space. The

159
CX51 compiler is a variant of the C51 compiler that is design for the new Philips
80C51MX architecture.

4.3 Compiling with Cx51


This explains how to use Cx51 to compile C source files and
discusses the control directives you may specify. These directives allow you to
perform several functions. For example:
 Direct Cx51 to generate a listing file
 Control the information included in the object file
 Specify code optimization and memory models

Running Cx51 from the Command Prompt

To invoke the C51 or CX51 compiler, enter C51 or CX51 at the


command prompt. On this command line, you must include the name of the C
source file to be compiled, as well as any other necessary control directives
required to compile your source file.
The format for the Cx51 command line is shown below:

C51 source file _directives…_


CX51 source file _directives…_
or:
C51 @command file
CX51 @command file

where:

160
source file is the name of the source program you want to compile.
directives are the directives you want to use to control the function of the
compiler.
Command file is the name of a command input file that may contain sourcefile and
directives. A command file is used, when the Cx51 invocation line gets complex
and exceeds the limits of the Windows command prompt.

The following command line example invokes C51, specifies the source file
SAMPLE.C, and uses the controls DEBUG, CODE, and PREPRINT.
C51 SAMPLE.C DEBUG CODE PREPRINT

The Cx51 compiler displays the following information upon successful


invocation and compilation.

C51 COMPILER V6.10


C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)

4.4 8051 Derivatives

A number of 8051 derivatives are available that provide enhanced


Performance while remaining compatible with the 8051 core. These derivatives
provide additional data pointers, very fast math operations, and reduced instruction
sets.

The Cx51 compiler directly supports the enhanced features of the


following 8051-based microcontrollers:
 Atmel 89x8252 and variants (2 data pointers).
161
 Dallas 80C320, 80C420, 80C520, 80C530, 80C550 an variants (2 data
pointers).
 Infineon C517, C517A, C509, and variants (high-speed 32-bit and 16-bit
binary arithmetic operations, 8 data pointers).
 Philips 8xC750, 8xC751, and 8xC752 (maximum code space of 2 KBytes,
no LCALL or LJMP instructions, 64 bytes internal, no external data
memory).
 Philips and Temic support on several device variants 2 data pointers.

The C51 compiler provides you with support for these CPUs through
the use of special libraries, library routines, and the MODxxx command-line
directives. These directives enable C51 to generate object code that takes
advantage of the enhancements mentioned above.

4.5 Atmel 89x8252 and variants

The Atmel 89x8252 and variants provide 2 data pointers which can be
used for memory access. Using multiple data pointers can improve the speed of
library functions like memcpy, memmove, memcmp, strcpy, and strcmp.

The MODA2 control directive instructs the C51 compiler to generate


code that uses both data pointers in your program.

The C51 compiler uses at least one data pointer in an interrupt


function. If an interrupt function is compiled using the MODA2 directive, both

162
data pointers are saved on the stack. This happens even if the interrupt function
uses only one data pointer.

To conserve stack space, you may compile interrupt functions with the
NOMODA2 directive. The C51 compiler does not use the second data pointer
when this directive is used.

4.6 Summary

In this chapter the software analysis was done by giving the


flowcharts and their corresponding algorithms.

163
CHAPTER-5

RESULT

TRANSMITTER SECTION

Figure.5.1.Transmitter section

164
RECEIVER SECTION

Figure.5.2.Receiver Section

165
CONCLUSION
The hardware and software design of an embedded monitoring system
for real time applications is presented in this paper. Vibration signals have been
analyzed to detect the mechanical faults. The implementations of analysis
technique in time and frequency domain are given. The proposed system
imbalance detection technique is verified with different level of severity.

166
REFERENCES
 Cao Liting, ”Distributed Security System for Intelligent Building

Based On Wireless Communication Network”, Proceedings of 2006

IEEE International Conference on Information Acquisition, Weihai,

Shandong, China, 177-182

 Agranat I D, ”Engineering web technologies for embedded

applications”, IEEE Internet Computing, vol.2no.3,1998

 Yougjun Xu, Lingyi Liu, and Peifu Shen, ”Low Power Processor

Design Wireless Sensor Network Application”, International

Conference on Wireless Communication, Networking and

Mobile(WCNM2005), Wuhan Chian, September 23-26,2005

 LIU Chong, and XIAO Nanfeng, ”Design and implementation of

home service robot and home intelligent security control ”,

Appendix

Program Coding

ADC+Serial

#include<reg51.h>

sfr adcout=0xa0;

sbit A1=P1^0;

sbit B1=P1^1;

sbit C1=P1^2;

sbit relay1=P1^3;

167
sbit relay2=P1^4;

void delay(unsigned char value2);

void adata(unsigned int);

unsigned char a,b,c,d;

void serialint()

SCON=0x50;

TMOD=0X20;

TH1=0XFD;

TR1=1;

void txs(unsigned char kk)

TI=0;

SBUF=kk;

while(TI==0);

TI=0;

void conv(unsigned int value1)

unsigned int huns,tens,ones;

huns=(value1/100);

txs(huns+0x30);
168
tens=((value1/10)%10);

txs(tens+0x30);

ones=(value1%10);

txs(ones+0x30);

void adata(unsigned int adcout)

unsigned char val=0;

val=val|(adcout&0x80)>>7;

val=val|(adcout&0x40)>>5;

val=val|(adcout&0x20)>>3;

val=val|(adcout&0x10)>>1;

val=val|(adcout&0x8)<<1;

val=val|(adcout&0x4)<<3;

val=val|(adcout&0x2)<<5;

val=val|(adcout&0x1)<<7;

conv(val);

void delay(unsigned char value2)

int i,j;

for(i=0;i<=value2;i++)

{
169
for(j=0;j<=1000;j++)

void main()

relay1=relay2=0;

serialint();

while(1)

while(RI==0)

A1=0;B1=0;C1=0;

delay(50);

txs('P');

adata(adcout);

delay(100);

A1=1;B1=0;C1=0;

delay(50);

txs('Q');
170
adata(adcout);

delay(100);

switch(SBUF)

case 'B': relay1=1;RI=0;break;

case 'C': relay2=1;RI=0;break;

case 'D': relay1=0;RI=0;break;

case 'E': relay2=0;RI=0;break;

LCD

#include <REGX51.H>

void lcdinit();

void lcdcmd(unsigned char value);

void lcddat(unsigned char *value);

void delay(unsigned int itime);

unsigned char *k="safety systems";

unsigned int i,j;

sbit rs=P3^5;
171
sbit rw=P3^6;

sbit en=P3^7;

void main()

while(1)

lcdinit();

lcdcmd(0x80);

lcddat(k);

void lcdinit()

lcdcmd(0x38);

delay(20);

lcdcmd(0x0e);

delay(20);

lcdcmd(0x01);

delay(20);

lcdcmd(0x06);

delay(20);
172
}

void lcdcmd(unsigned char value)

rs=0;

rw=0;

P0=value;

en=1;

delay(1);

en=0;

void lcddat(unsigned char *value)

for(;*value;)

P0=*value++;

rs=1;

rw=0;

en=1;

delay(1);

en=0;

}
173
void delay(unsigned int itime)

for(i=0;i<itime;i++)

for(j=0;j<1275;j++);

174

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy