Sie sind auf Seite 1von 80

Environment Monitoring and Device Control using Embedded Controlled Sensor Network.

ABSTRACT

This paper demonstrates designing of embedded controlled sensor networks used for controlling the home devices as well as monitoring the environmental parameters. The features of GSM and Zigbee are explored to design the system for long distance as well as short distance. Embedded controlled sensor networks have proven themselves to be a reliable solution in providing remote control and sensing for indoor environmental monitoring systems. Three commercial sensors had been integrated with the system to monitor and compute the level of existence of CO gas, temperature and humidity in atmosphere using information and communication technologies.

10

INTRODUCTION

Embedded controlled sensor network is the technology used to implement environmental solutions effectively. Many researchers have been making attempts to develop the embedded controlled sensor network. The existing systems are bulky, very costly and difficult to maintain. The proposed system is cost effective and controlled by user friendly embedded systems. In the proposed system ARM based microcontroller and wireless sensors are used to control the various devices and to monitor the information regarding the environment using Zig bee and GSM technologies.

Environment monitoring and device control allows new level of comfort in homes and it can also manage the energy consumption efficiently which in turns promotes the saving. Remote controlling of the devices offers many advantages to senior citizens and people with disabilities which helps them in being more autonomous and increasing quality of life. In addition to remote control, monitoring temperature, flood and carbon monoxide in homes is also a major concern. There is a severe need to monitor temperature or gases as they can be costly and deadly. A monitored low temperature sensor warns about freezing temperatures inside house. Also if the boiler, washer or pipes leaks in the home, it can cause considerable damage.

11

BLOCK DIAGRAM

Exhaust Fan GAS SENSOR RELAY 1

TEMPARATURE SENSOR

RELAY 2

RELAY 3 PIC 16F877A MICRO CONTROLLER

HUMIDITY SENSOR

LCD

GSM MODEM

ZIGBEE

KEYPAD

12

HARDWARE COMPONENT USED Microcontroller Gas Sensor Temperature Sensor Humidity Sensor Level converter Zigbee LCD Keypad Alarm GSM MAX232

SOFTWARE USED MP Lab Embedded C Language PIC Kit2

13

COMPONENT DETAILS
4.1 POWER SUPPLY
CIRCUIT DIAGRAM

12-0-12 / 500MA
7805 1N 4007 + 1000 MF/25 V
2

IN

GND

230 V AC/50 HZ INPUT

OUT

3 + 0.1MF

+5 Volt

0 GND
FIG (1.0): POWER SUPPLY

0 GND

Available power source is an Ac voltage arrives at 230V.Since our electronic circuits require only very minimal voltage and current we use step down power transformer. Step down transformer is designed in such a way that the input is 230V and output of 12V. Another thing is that electronic circuits operate in DC where as available output of transformer is Ac of 12V. So rectifier circuit is used to convert AC to DC. Rectifier circuit consists of four diodes formed in bridge fashion so as to convert incoming AC to DC.

14

TRANSFORMER

Fig (1.1): TRANSFORMER A transformer is a device that transfers electrical energy from one circuit to another through inductively coupled conductors, the transformer's coils or windings. Transformer is used here to step down the supply voltage to a level suitable for the low voltage components. The transformer used here is a 230/ (12V-0-12V) step down transformer.
Even though output of rectifier circuit is DC it is not smooth or fixed DC. So filter circuits are used to convert rippling DC to smooth DC. The filter circuit is a capacitor, connected parallel to the output of rectifier circuit. This smooth DC voltage will be in the range of +12 volts. But we require only 5V supply for the operation of micro controllers and its supporting components. Here again regulator ICs such as 7805 is used to regulate the incoming 12VDC to fixed regulated 5V as output. This DC regulated 5V is applied to the circuits.

Even though the circuit is functioning with 5V, the relays are driven by 6V or 12V. For this purpose 7806/7812 regulator IC is additionally connected to the rectifier filter circuit. Thus 12V regulated is used for driving 12V relays.

REGULATOR SECTION

Fig (1.2): LM7805C 15

5V

For most no critical applications the best choice for a voltage regulator is the simple terminal type. It has only three connections (input, output, and ground) and is factory-trimmed to provide a fixed output. Typical of this type is the 78xx. The voltage is specified by the last two digits of the part number and can be any of the following: 05, 08, 10, 12, 15, 18, or 24. It is to make a +5 volt regulator, for instance, with one of these regulators. The capacitor across the output improves transient response and keeps the impedance low at high frequencies (an input capacitor of at least 0.33F should be used in addition if the regulator is located a considerable distance from the filter capacitors).

The 7800 series is available in plastic or metal power packages (same as power transistors). A low-power version, the 78Lxx, comes in the same plastic and metal packages as small-signal transistors. The 7900 series of negative regulators works the same way (with negative input voltage, of course). The 7800 series can provide up to 1 amp load current and has on-chip circuitry to prevent damage in the event of overheating or excessive load current; the chip simply shuts down, rather than blowing out. In addition, on-chip circuitry prevents operation outside the

Transistor safe operating area is by reducing available output current for large input to output voltage differential. These regulators are in-expensive and easy to use, and they make it practical to design a system with many printed-circuit boards in which the unregulated dc is brought to each board and regulation is done locally on each circuit card.

LM78XX SERIES VOLTAGE REGULATORS The LM78xx series of three terminal regulators is available with several fixed output voltages making them useful in a wide range of applications. One of these is local on card regulation, eliminating the distribution problems associated with single point regulation. The voltages available allow these regulators to be used in logic systems, instrumentation, HiFi, and other solid-state electronic equipment. Although designed primarily as fixed voltage regulators these devices can be used with external components to obtain adjustable voltages and currents. The LM78XX series is available in an aluminium TO-3 package which will allow over 1.0A load current if adequate heat sinking is provided. Current limiting is included to limit the peak output current to a safe value. Safe area protection for the output transistor is provided to limit internal power dissipation. If internal

16

power dissipation becomes too high for the heat sinking provided, the thermal shutdown circuit takes over preventing the IC from overheating. Considerable effort was expanded to make the LM78XX series of regulators easy to use and minimize the number of external components. It is not necessary to bypass the output, although this does improve transient response. Input by-passing is needed only if the regulator is located far from the filter capacitor of the power supply. VOLTAGE RANGE LM7805C 5V

LM7812C 12V LM7815C 15V LM7912C -12

PIC MICROCONTROLLER
4.2 INTRODUCTION TO PIC 16F877A The high performance of the PIC micro devices can be attributed to a number of architectural features commonly found in RISC microprocessors. These include: Harvard architecture Long Word Instructions Single Word Instructions Single Cycle Instructions Instruction Pipelining Reduced Instruction Set Register File Architecture Orthogonal (Symmetric) Instructions. HARVARD ARCHITECTURE Harvard architecture has the program memory and data memory as separate memories and is accessed from separate buses. This improves bandwidth over traditional von Neumann architecture in
17

which program and data are fetched from the same memory using the same bus. To execute an instruction, a von Neumann machine must make one or more (generally more) accesses across the 8bit bus to fetch the instruction. Then data may need to be fetched, operated on, and possibly written. As can be seen from this description, that bus can be extremely congested. While with Harvard architecture, the instruction is fetched in a single instruction cycle (all 14-bits).While the program memory is being accessed, the data memory is on an independent bus and can be read and written. These separated buses allow one instruction to execute while the next instruction is fetched. A comparison of Harvard vs. von-Neumann architectures is shown in Figure.

18

FIG (1.3): COMPARISON OF HARVARD VS. VON-NEUMANN ARCHITECTURES

19

PINOUT DIAGRAM

FIG (1.4): PINOUT DIAGRAM OF PIC16F877A

HARVARD VS. VON NEUMANN BLOCK ARCHITECTURES


20

FIG (1.5): HARVARD VS. VON NEUMANN BLOCK ARCHITECTURES LONG WORD INSTRUCTIONS Long word instructions have a wider (more bits) instruction bus than the 8-bit Data Memory Bus. This is possible because the two buses are separate. This further allows instructions to be sized differently than the 8-bit wide data word which allows a more efficient use of the program memory, since the program memory width is optimized to the architectural requirements. SINGLE WORD INSTRUCTIONS Single Word instruction opcodes are 14-bits wide making it possible to have all single word instructions. A 14-bit wide program memory access bus fetches a 14-bit instruction in a single cycle. With single word instructions, the number of words of program memory locations equals the number of instructions for the device. This means that all locations are valid instructions. Typically in the von Neumann architecture, most instructions are multi-byte. In general, a device with 4-KBytes of program memory would allow approximately 2K of instructions. This 2:1 ratio is generalized and dependent on the application code. Since each instruction may take multiple bytes, there is no assurance that each location is a valid instruction.

INSTRUCTION FLOW/PIPELINING An Instruction Cycle consists of four Q cycles (Q1, Q2, Q3, and Q4). Fetch takes one instruction cycle while decode and execute takes another instruction cycle. However, due to
21

Pipelining, each instruction effectively executes in one cycle. If an instruction causes the program counter to change (e.g. GOTO) then an extra cycle is required to complete the instruction. The instruction fetch begins with the program counter incrementing in Q1. In the Execution cycle, the fetched instruction is latched into the Instruction Register (IR) in cycle Q1. This instruction is then decoded and executed during the Q2, Q3, and Q4 cycles. Data memory is read during Q2 (operand read) and written during Q4 (destinations write). Example shows the operation of the two stage pipeline for the instruction sequence shown. At time T CY 0, the first instruction is fetched from program memory. During T CY 1, the first instruction executes while the second instruction is fetched. During T CY 2, the second instruction executes while the third instruction is fetched. During T CY 3, the fourth instruction is fetched while the third instruction (CALL SUB_1) is executed. When the third instruction completes execution, the CPU forces the address of instruction four onto the Stack and then changes the Program Counter(PC) to the address of SUB_1. This means that the instruction that was fetched during T CY 3 needs to be flushed from the pipeline. During T CY 4, instruction four is flushed (executed as a NOP ) and the instruction at address SUB_1 is fetched. Finally during T CY 5, instruction five is executed and the instruction at address SUB_1 + 1 is fetched.

INSTRUCTION PIPELINE FLOW

22

FIG (1.6): INSTRUCTION PIPELINE FLOW INPUT OUTPUT LINES General purpose I/O pins can be considered the simplest of peripherals. They allow the PIC micro to monitor and control other devices. To add flexibility and functionality to a device, some pins are multiplexed with an alternate function(s). These functions depend on which peripheral features are on the device. In general, when a peripheral is functioning, that pin may not be used as a general purpose I/O pin. The direction of the I/O pins (input or output) is controlled by the data direction register, called the TRIS register. TRIS<x> controls the direction of PORT<x>. A 1 in the TRIS bit corresponds to that pin being an input, while a 0 corresponds to that pin being an output. The PORT register is the latch for the data to be output. When the PORT is read, the device reads the levels present on the I/O pins (not the latch). This means that care should be taken with readmodify-write commands on the ports and changing the direction of a pin from an input to an output. Figure shows a typical I/O port. This does not take into account peripheral functions that maybe multiplexed onto the I/O pin. Reading the PORT register reads the status of the pins whereas writing to it will write to the port latch. All write operations (such as BSF and BCF instructions) are read-modify-write operations. Therefore a write to a port implies that the port pins are read; this value is modified, and then written to the port data latch.

23

FIG (1.7): A TYPICAL I/O PORT When peripheral functions are multiplexed onto general I/O pins, the functionality of the I/O pins may change to accommodate the requirements of the peripheral module. Examples of this are the Analog-to-Digital (A/D) converter and LCD driver modules, which force the I/O pin to the peripheral function when the device is reset. In the case of the A/D, this prevents the device from consuming excess current if any analog levels were on the A/D pins after a reset occurred. With some peripherals, the TRIS bit is overridden while the peripheral is enabled. Therefore, read-modify-write instructions (BSF, BCF, and XORWF) with TRIS as destination should be avoided. The user should refer to the corresponding peripheral section for the correct TRIS bit settings. PORT pins may be multiplexed with analog inputs and analog VREF input. The operation of each of these pins is selected, to be an analog input or digital I/O, by clearing/setting the control bits in the ADCON1 register (A/D Control Register1). When selected as an analog input, these pins will read as 0s.The TRIS registers control the direction of the port pins, even when they are being used as analog inputs. The user must ensure the TRIS bits are maintained set when using the pins as analog inputs.

NOTE 1:
24

If pins are multiplexed with Analog inputs, then on a Power-on Reset these pins are configured as analog inputs, as controlled by the ADCON1 register. Reading port pins configured as analog inputs read a 0. NOTE 2: If pins are multiplexed with comparator inputs, then on a Power-on Reset these pins are configured as analog inputs, as controlled by the CMCON register. Reading port Pins configured as analog inputs read a 0. NOTE 3: If pins are multiplexed with LCD driver segments, then on a Power-on Reset these pins are configured as LCD driver segments, as controlled by the LCDSE register. To configure the pins as a digital port, the corresponding bits in the LCDSE register must be cleared. Any bit set in the LCDSE register overrides any bit settings in the corresponding TRIS register. NOTE 4: Pins may be multiplexed with the Parallel Slave Port (PSP). For the PSP to function the I/O pins must be configured as digital inputs and the PSPMODE bit must be set. NOTE 5: At present the Parallel Slave Port (PSP) is only multiplexed onto PORTD and PORTE. The microprocessor port becomes enabled when the PSPMODE bit is set. In this mode, the user must make sure that the TRISE bits are set (pins are configured as digital inputs) and that PORTE is configured for digital I/O. PORTD will override the values in the TRISD register. In this mode the PORTD and PORTE input buffers are TTL. The control bits for the PSP operation are located in TRISE.

PORTA AND THE TRISA REGISTER

25

The RA4 pin is a Schmitt Trigger input and an open drain output. All other RA port pins have TTL input levels and full CMOS output drivers. All pins have data direction bits TRIS registers) which can configure these pins as output or input. Setting a TRISA register bit puts the corresponding output driver in a hi-impedance mode. Clearing bit in the TRISA register puts the contents of the output latch on the selected pin(s). EXAMPLE 1: INITIALIZING PORTA CLRF STATUS CLRF PORTA BSF STATUS, RP0 MOVLW 0xCF MOVWF TRISA : Bank0 : Initialize PORTA by clearing output data latches : Select Bank1 : Value used to initialize data direction : PORTA<3:0> = inputs, PORTA<5:4> = outputs, TRISA<7:6> always read as '0' PORTB AND THE TRISB REGISTER PORTB is an 8-bit wide bi-directional port. The corresponding data direction register is TRISB. Setting a bit in the TRISB register puts the corresponding output driver in a high-impedance input mode. Clearing a bit in the TRISB register puts the contents of the output latch on the selected pin(s). EXAMPLE: INITIALIZING PORTB Each of the PORTB pins has a weak internal pull-up. A single control bit can turn on all the pull-ups. This is performed by clearing bit RBPU (OPTION<7>). The weak pull-up is automatically turned off when the port pin is configured as an output. The pull-ups are disabled on a Power-on Reset.

CLRF STATUS CLRF PORTB

: Bank0 : Initialize PORTB by clearing output data latches


26

BSF STATUS, RP0 MOVLW 0xCF MOVWF TRISB

: Select Bank1 : Value used to initialize data direction : PORTB<3:0> = inputs, PORTB<5:4> = outputs, PORTB<7:6> = inputs

Each of the PORTB pins has a weak internal pull-up. A single control bit can turn on all the pull-ups. This is performed by clearing bit RBPU (OPTION<7>). The weak pull-up is automatically turned off when the port pin is configured as an output. The pull-ups are disabled on a Power-on Reset. PORTC AND THE TRISC REGISTER PORTC is an 8-bit bi-directional port. Each pin is individually configurable as an input or output through the TRISC register. PORTC pins have Schmitt Trigger input buffers. When enabling peripheral functions, care should be taken in defining TRIS bits for each PORTC pin. Some peripherals override the TRIS bit to make a pin an output, while other peripherals override the TRIS bit to make a pin an input. EXAMPLE: INITIALIZING PORTC CLRF STATUS CLRF PORTC BSF STATUS, RP0 MOVLW 0xCF MOVWF TRISC : Bank0 : Initialize PORTC by clearing output data latches : Select Bank1 : Value used to initialize data direction : PORTC<3:0> = inputs, PORTC<5:4> = outputs, PORTC<7:6> = inputs

The Central Processing Unit (CPU) is responsible for using the information in the program memory (instructions) to control the operation of the device. Many of these instructions operate on data memory. To operate on data memory, the Arithmetic Logical Unit (ALU) is required. In addition
27

to performing arithmetical and logical operations, the ALU controls status bits (which are found in the STATUS register). The results of some instructions force status bits to a value depending on the state of the result. The machine codes that the CPU recognizes are show in Table(1.0). PORTD AND TRISD REGISTERS PORTD is an 8-bit port with Schmitt Trigger input buffers. Each pin is individually configurable as an input or output. PORTD can be configured as an 8-bit wide microprocessor port (Parallel Slave Port) by setting control bit, PSPMODE (TRISE<4>). In this mode, the input buffers are TTL. PORTE AND TRISE REGISTER PORTE has three pins (RE0/RD/AN5, RE1/WR/AN6 and RE2/CS/AN7) which are individually configurable as inputs or outputs. These pins have Schmitt Trigger input buffers. The PORTE pins become the I/O control inputs for the microprocessor port when bit PSPMODE (TRISE<4>) is set. In this mode, the user must make certain that the TRISE<2:0> bits are set and that the pins are configured as digital inputs. Also, ensure that ADCON1 is configured for digital I/O. In this mode, the input buffers are TTL. TRISE register which also controls the Parallel Slave Port operation. PORTE pins are multiplexed with analog inputs. When selected for analog input, these pins will read as 0s. TRISE controls the direction of the RE pins, even when they are being used as analog inputs. The user must make sure to keep the pins configured as inputs when using them as analog inputs.

LEVEL CONVERTER Introduction A standard serial interfacing for PC, RS232C, requires negative logic, i.e., logic '1' is -3V to -12V and logic '0' is +3V to +12V. To convert a TTL logic, say, TxD and RxD pins of the Micro controller chips, thus need a converter chip. A MAX232 chip has long been used in many Controller boards. It provides 2-channel RS232C port and requires external 10uF capacitors. The MAX232 from Maxim was the first IC which in
28

one package contains the necessary drivers and receivers to adapt the RS-232 signal voltage levels to TTL logic. It became popular, because it just needs one voltage (+5V or +3.3V) and generates the necessary RS-232 voltage levels.

VOLTAGE LEVELS It is helpful to understand what occurs to the voltage levels. When a MAX232 IC receives a TTL level to convert, it changes a TTL Logic 0 to between +3 and +15 V, and changes TTL Logic 1 to between -3 to -15 V, and vice versa for converting from RS232 to TTL. This can be confusing when you realize that the RS232 Data Transmission voltages at a certain logic state are opposite from the RS232 Control Line voltages at the same logic state. To clarify the matter, see the table below. For more information see RS-232 Voltage Levels.
29

RS232 Line Type & Logic RS232 Voltage Level Data Transmission (Rx/Tx) +3 V to +15 V Logic 0 Data Transmission (Rx/Tx) -3 V to -15 V Logic 1 Control Signals -3 V to -15 V

TTL

Voltage

to/from

MAX232 0V

5V

5V

(RTS/CTS/DTR/DSR) Logic 0 Control Signals +3 V to +15 V 0V

(RTS/CTS/DTR/DSR) Logic 1

ZIGBEE

ZIGBEE TRANSCIEVER: 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 wireless personal area networks (wpans), such as wireless headphones connecting with cell phones via short-range radio. The technology defined by the zigbee specification is intended to be simpler and less expensive than other wpans, such as Bluetooth. Zigbee
30

is targeted at radio-frequency (rf) applications that require a low data rate, long battery life, and secure networking. ZIGBEE is the name given to a specific suite of high level communication protocols using low power digital radios, based on the IEEE 802.15.4 standard for Wireless Personal Area Networks (WPANs). The following diagram relates a number of wireless technologies used in WPANs, WLANs (Wireless Local Area Networks,) WMANs (Wireless Metropolitan Areas) and WWNAs (Wireless Wide Area Networks.) The speeds shown are guides only. WWANs are dominated by mobile phone (cell phone) technologies, known as 2G, 3G and, forthcoming, 4G. In the WPAN field, UWB (Ultra-Wide Band radio technology) is a rapidly developing area, used to transmit high data rates over very short distances, opening up application such as video and audio streaming wirelessly around the home between a base device and subsidiary devices.

31

WPANs cover a radius of about 10m around a person or object. The core aim is to design systems offering low cost, low power, and compact size. The IEEE 802.15 working group has defined three classes of WPANs, differentiated by data rate, power requirements and level of performance. The high data rate WPAN technology, UWB, is suitable for multi-media applications that require very high performance levels. Medium rate WPANs (IEEE 802.15.1/Bluetooth) handle a variety of tasks ranging from mobile phones to PDA communications. The low data rate WPAN standard, ZigBee, is intended to serve a set of industrial, residential and medical applications with very low power consumption and cost requirement and with much lower requirements in terms of data rate and performance. A ZigBee network links a number of electronic devices (nodes). Each node in the network forms part of the transmission chain, receiving messages, deciding if the messages are for local use, and re-transmitting them to other nodes in the network if not. A common use of ZigBee is to form sensor area networks. For example in a factory environment many ZigBee nodes can be quickly installed to provide complete low power wireless coverage of the many sensors needed in a factory for fire and burglar alarm systems.

COMPARISON OF WIRELESS TECHNOLOGIES

ZIGBEE: Was formally adopted in December 2004 Is targeting control applications in industry, which do not require high data rates, but must have low power demand, low cost and offer ease of use (remote controls, home automation, etc.)

32

Offers data rates of 250 Kbits at 2.4 GHz, 40 Kpbs at 915 Mhz, and 20 Kpbs at 868 Mhz with a range of 10-100m Currently offers three levels of security Costs around half that of Bluetooth Can network up to 256 devices Has as power requirements much less than Bluetooth uses star, tree or mesh topology. BLUETOOTH: is designed for voice and higher data-rate applications; also operates in the 2.4 GHz spectrum; operates typically over a distance of 10 metres; allows for three modes of security; has a range of ~10 metres; has power requirements of ~40 to 100mW per device; can network up to 8 devices;

ULTRA-WIDEBAND (UWB): transmits digital data over a wide frequency spectrum using very low power; can transmit data at very high rates (for wireless local area network applications) over distances of up to 10m; has two competing UWB standards currently - one based on direct sequence spread spectrum techniques, (DS-UWB), the other based on Multi-band Orthogonal Frequency Division Modulation (OFDM), with each standard offering data rates around 500 Mbps at a range of 2 metres; has power demands typically twice that of Bluetooth and is typically twice as expensive as Bluetooth implementations REASONS FOR CHOOSING ZIGBEE INCLUDE:
33

Low Cost High Reliability Very Long Battery Life High Security Self-Healing Properties Large Number Of Nodes Supported Ease Of Deployment Guaranteed Delivery Route Optimization.

INTRODUCTION The Zig Bee Alliance is an association of companies working together to meet an open Global standard for making low-power wireless networks. The intended outcome of Zig Bee Alliance is to create a specification defining how to build different network topologies with data security features and interoperable application roles. The association includes companies from a wide spectrum of categories, from chip manufacturers to system integration companies. The number of members in the association is rapidly growing and is currently over 125 (Q1 2005). Among the members one can and Philips, Samsung, Motorola and LG. The rest specification was rated in Q4 2004 and the rest generation of Zig Bee products may reach the market sometime in 2005. A big challenge for the alliance is to make the interoperability to work among different products.
34

THE NAME ZIGBEE The name Zig Bee is said to come from the domestic honeybee which uses a zigzag type of dance to communicate important information to other hive members. This communication dance (the "Zig Bee Principle") is what engineers are trying to emulate with this protocol a bunch of separate and simple organisms that join together to tackle complex tasks. IEEE 802.15.4 The goal IEEE had when they specified the IEEE 802.15.4 standard was to provide a Standard for ultra-low complexity, ultra-low cost, ultra-low power consumption and low data rate wireless connectivity between inexpensive devices. The raw data rate will be high enough (maximum of 250 KB/s) for applications like sensors, alarms and toys. Components of the IEEE 802.15.4 IEEE 802.15.4 networks use three types of devices: The network Coordinator maintains overall network knowledge. It is the most sophisticated one of the three types, and requires the most memory and computing power. The Full Function Device (FFD) supports all IEEE 802.15.4 functions and features specified by the standard. It can function as a network coordinator. Additional memory and computing power make it ideal for network router functions or it could be used in network-edge devices (where the network touches the real world).

35

The Reduced Function Device (RFD) carries limited (as specified by the standard) functionality for lower cost and complexity. It is generally found in network-edge devices. The RFD can be used where extremely low power consumption is a necessity.

HARDWARE DETAILS

Fig 3.9 Hardware view of Zig Bee

SPECIFICATION OF ZIG BEE

36

ZIGBEE NETWORKING Zig Bee can use so-called mesh networking, which may extend over a large area and contain thousands of nodes. Each FFD in the network also acts as a router to direct messages. The routing protocol optimizes the shortest and most reliable path through the network and can dynamically change, so as to take evolving conditions into account. This enables an extremely reliable network, since the network can heal itself if one node is disabled. This is very similar to the redundancy employed in the Internet. ZigBee networks are primarily intended for low duty cycle sensor networks (<1%). A new network node may be recognized and associated in about 30 ms. Waking up a sleeping node takes about 15 ms, as does accessing a channel or transmitting data .ZigBee applications benefit from the ability to quickly attach information, detach, and go to deep sleep, which results in low power consumption and extended battery life.

37

Functional Diagram of Zig Bee

FEATURES OF ZIG BEE Low power consumption. Integrated bit synchronizer. Integrated IF and data filters. High sensitivity (type -104dBm) Programmable output power -20dBm~1dBm Operation temperature range: -40~+85 deg C Operation voltage: 1.8~3.6 Volts. Available frequency at: 2.4~2.483 GHz Digital RSSI

APPLICATIONS Car & Home security system Remote keyless entry / Garage door controller Wireless game controllers/mouse/keyboard/audio
38

Automation system

4.5 RELAY

FIG (3.1): RELAY A relay is an electrically operated switch. Many relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are used where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits, repeating the signal coming in from one circuit and re-transmitting it to another. Relays were used extensively in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly control an electric motor is called a contractor. Solid-state relays control power circuits with no moving parts, instead using a semiconductor device to perform switching.

39

FEATURES: Switching capacity available by 10A in spite of small size design for high density P.C. board mounting technique. UL,CUL,TUV recognized. Selection of plastic material for high temperature and better chemical solution performance. Sealed types available. Simple relay magnetic circuit to meet low cost of mass production. 75 characteristic impedance. 2.5 GHz bandwidth. Insertion loss at 2.5 GHz <1.1 dB (typical <0.7 dB). VSWR at 2.5 GHz <1.6 (typical <1.3). Onboard relay counting. Use NI Switch Executive for calibrating losses on each PXI-2558 channel.

SPECIFICATION: Operating Voltage: 12 Volts DC Nominal. Current Draw: 30 milliamps. Minimum Pull-in Voltage: 9 Volts DC. Diode Protection Across Relay Coil. Contact Ratings: 7 Amps @ 30 Volts DC 10 Amps @ 125 Volts AC Size: 1.1" X1.55 (28mm X 39mm) Ea.

40

APPLICATION: 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.01C of the surface temperature. 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. 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. A small thermal mass may be added to the sensor, to give the steadiest reading despite small deviations in the air temperature.

LCD LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing LEDs (seven segment LEDs or other multi segment LEDs) because of the following reasons: 1. The declining prices of LCDs. 2. The ability to display numbers, characters and graphics. This is in contrast to LEDs, which are limited to numbers and a few characters. 3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep displaying the data. 4. Ease of programming for characters and graphics.
41

These components are specialized for being used with the microcontrollers, which means that they cannot be activated by standard IC circuits. They are used for writing different messages on a miniature LCD.

LCD Display A model described here is for its low price and great possibilities most frequently used in practice. It is based on the HD44780 microcontroller ( Hitachi) and can display messages in two lines with 16 characters each. It displays all the alphabets, Greek letters, punctuation marks, mathematical symbols etc. In addition, it is possible to display symbols that user makes up on its own. Automatic shifting message on display (shift left and right), appearance of the pointer, backlight etc. are considered as useful characteristics.

PIN FUNCTIONS: There are pins along one side of the small printed board used for connection to the microcontroller. There are total of 14 pins marked with numbers (16 in case the background light is built in). Their function is described in the table below:

42

LCD screen: LCD screen consists of two lines with 16 characters each. Each character consists of 5x7 dot matrix. Contrast on display depends on the power supply voltage and whether messages are displayed in one or two lines. For that reason, variable voltage 0-Vdd is applied on pin marked as Vee. Trimmer potentiometer is usually used
43

for that purpose. Some versions of displays have built in backlight (blue or green diodes). When used during operating, a resistor for current limitation should be used (like with any LE diode).

LCD display panel LCD BASIC COMMANDS: All data transferred to LCD through outputs D0-D7 will be interpreted as commands or as data, which depends on logic state on pin RS:

44

RS = 1 - Bits D0 - D7 are addresses of characters that should be displayed. Built in processor addresses built in map of characters and displays corresponding symbols.
Command Clear display Cursor home Entry mode set Display on/off control Cursor/Display Shift Function set Set CGRAM address Set DDRAM address RS RW D7 D6 D5 D4 D3 D2 D1 D0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 x Execution Time 1.64mS 1.64mS 40uS 40uS 40uS 40uS 40uS 40uS

Displa ying positio n is

1 I/D S D U B x x

determ ined by

1 D/C R/L x F x

DDRA M addres s. This addres s is either previo

0 0 1 DL N 0 1 1

CGRAM address DDRAM address

Read BUSY flag (BF)


Write to CGRAM or DDRAM Read from CGRAM or DDRAM

0
1

1 BF

DDRAM address

40uS

0 D7 D6 D5 D4 D3 D2 D1 D0

1 D7 D6 D5 D4 D3 D2 D1 D0

40uS

usly

defined or the address of previously transferred character is automatically incremented.RS = 0 - Bits D0 - D7 are commands which determine display mode. List of commands for lcd: LCD Connection: Depending on how many lines are used for connection to the microcontroller, there are 8- bit and 4-bit LCD modes. The appropriate mode is determined at the beginning of the process in a phase called initialization. In the first case, the data are transferred through outputs D0-D7 as it has been already explained. In case of 4-bit
45

LED mode, for the sake of saving valuable I/O pins of the microcontroller, there are only 4 higher bits (D4-D7) used for communication, while other may be left unconnected. Consequently, each data is sent to LCD in two steps: four higher bits are sent first (that normally would be sent through lines D4-D7), four lower bits are sent afterwards. With the help of initialization, LCD will correctly connect and interpret each data received. Besides, with regards to the fact that data are rarely read from LCD (data mainly are transferred from microcontroller to LCD) one more I/O pin may be saved by simple connecting R/W pin to the Ground. Such saving has its price. Even though message displaying will be normally performed, it will not be possible to read from busy flag since it is not possible to read from display. LCD Initialization: Once the power supply is turned on, LCD is automatically cleared. This process lasts for approximately 15mS. After that, display is ready to operate. The mode of operating is set by default. This means that: 1. Display is cleared 2. Mode DL = 1 Communication through 8-bit interface N = 0 Messages are displayed in one line F = 0 Character font 5 x 8 dots 3. Display/Cursor on/off D = 0 Display off
46

U = 0 Cursor off B = 0 Cursor blink off 5. Character entry 6. ID = 1 Addresses on display are automatically incremented by 1

S = 0 Display shift off Automatic reset is mainly performed without any problems. Mainly but not always! If for any reason power supply voltage does not reach full value in the course of 10mS, display will start perform completely unpredictably? If voltage supply unit can not meet this condition or if it is needed to provide completely safe operating, the process of initialization by which a new reset enabling display to operate normally must be applied.Algorithm according to the initialization is being performed depends on whether connection to the microcontroller is through 4- or 8-bit interface. All left over to be done after that is to give basic commands and of course- to display messages .

47

KEYPAD INTRODUCTION This note describes a method of interfacing a matrix keyboard to EZ328 using minimum number of I/O ports. We use a 4x1 matrix keypad as an example. It requires only five I/O ports. (In general, it takes n+ 1 port to interface an nxn matrix keyboard). It is a low cost solution. No TTL logic ICs is used. The components mainly used in the interfacing circuitry include only diodes and resistors which can greatly reduce the system cost and size of the product.

48

HARDWARE Figure 1 shows a functional block diagram of the keyboard interface. As seen in this diagram, there are two major parts. Interrupt & interfacing Circuity - generates interrupt to EZ328 when there is a key pressed and provides connection to EZ328s I/O ports Keyboard matrix - a 4x1 matrix keypad Interrupt & interfacing Circuit The interrupt and interfacing circuit includes some diodes, resistors, pull-up resistors and a NPN transistor. The transistor part is designed as an inverter for generating interrupt signal to EZ328 when there is a key pressed. There are two groups of diodes mainly for restricting signal flow in single direction so as to enable this circuitry to identify the pressed key uniquely. One of these two groups of diodes have been wired together to provide a OR function which in turn allows an y key pressed on each column of the keypad to signal the transistor part for generating interrupt.

Parallel Ports Interface


49

This solution demonstrates a simple mechanism to build a keyboard with minimum I/O port used. In this application, we use a 4x4 matrix keypad as an example. It requires only five I/O ports for interfacing. One of them is used for generating the interrupt signal in the beginning and used as an I/O port for key scanning operation afterwards. Detail of the method in scanning and identifying the pressed key will be discussed in the section SCAN KEY Operation. It should also be noted that in this design, EZ328 uses five ports for interfacing but only one of them requires interrupt capability. SCAN KEY OPERATION Five ports are used for key scanning function in this system. One of them (PD7) is used as the interrupt pin before a key is pressed. Before the key scanning process starts, all of the I/O ports except the one with interrupt capability is configured as output high. Then, when there is a key pressed, one of the columns on the keypad changes state from low to high. As all the columns on the keypad are wired together to form a OR logic to the base of the NPN transistor, it will generate an active low interrupt signal to EZ328 and initiates the interrupt handler to scan the pressed key. When the key scanning process begins, one of the five I/O ports will be configured to output high while the other ports are configured to input. The states on all ports are then read and compared with the pattern recorded in a predefined lookup table in order to locate which key is pressed. If the key is not found, another port will be configured to output high instead and read the states again. This process is repeated until all ports have been configured once to output high or a key is found. Since the circuitry provides feedback paths, one of the input port will change state from low to high by the output high port and the states obtained can identify uniquely which key is being pressed. An example of the scanning procedure is illustrated as follows:

50

GSM OVERVIEW OF GSM Global System for Mobile Communications or GSM (originally from Groupe Spcial Mobile), is the world's most popular standard for mobile telephone systems.
51

The GSM Association estimates that 80% of the global mobile market use the standard. GSM is used by over 1.5 billion people across more than 212 countries and territories. This ubiquity means that subscribers can use their phones throughout the world, enabled by international roaming arrangements between mobile network operators. GSM differs from its predecessor technologies in that both signaling and speech channels are digital, and thus GSM is considered a second generation (2G) mobile phone system. The GSM standard has been an advantage to both consumers, who may benefit from the ability to roam and switch carriers without replacing phones, and also to network operators, who can choose equipment from many GSM equipment vendors. GSM MODEM

Fig 1. GSM Modem Global system for mobile communication (GSM) is a globally accepted standard for digital cellular communication. GSM is the name of a standardization group established in 1982 to create a common European mobile telephone standard that would formulate specifications for a pan-European mobile cellular radio system operating at 900 MHz.A GSM modem is a wireless modem that works with a GSM wireless network. A wireless modem behaves like a dial-up modem. The main
52

difference between them is that a dial-up modem sends and receives data through a fixed telephone line while a wireless modem sends and receives data through radio waves. The working of GSM modem is based on commands, the commands always start with AT (which means ATtention) and finish with a <CR> character. For example, the dialing command is ATD<number>; ATD3314629080; here the dialing command ends with semicolon. The AT commands are given to the GSM modem with the help of PC or controller. The GSM modem is serially interfaced with the controller with the help of MAX 232. FEATURES OF SIM 300 MODULE TTL - AT COMMANDS Designed for global market, SIM300 is a Dual-band GSM/GPRS engine Works on frequencies EGSM 900 MHz, DCS 1800 MHz SIM300 features GPRS multi-slot class 10/ class 8 (optional) and supports the

GPRS coding schemes FEATURES OF GSM KIT This GSM modem is a highly flexible plug and play dual band GSM modem Supports features like Voice, Data/Fax, SMS,GPRS and integrated TCP/IP stack. Control via AT commands(GSM 07.07,07.05 and enhanced AT commands) Use DC Power 3.6 - 4.6 Volts Maximum Current Consumption in normal operation 250mA, can rise up to 1Amp while

transmission.

INTERFACES
53

TTL Tx,Rx , VCC , GND Serial port baud rate adjustable 1200 to115200 bps (9600 default) BRK connector for MIC & SPK, SIM card holder LED status of GSM / GPRS module

NEW APPROACHES IN GSM Neither of these approaches proved to be the long-term solution as cellular technology needed to be more efficient. With the experience gained from the NMT system, showing that it was possible to develop a system across national boundaries, and with the political situation in Europe lends itself to international cooperation it was decided to develop a new Pan-European System. Furthermore it was realized that economies of scale would bring significant benefits. This was the beginnings of the GSM system. To achieve the basic definition of a new system a meeting was held in 1982 under the auspices of the Conference of European Posts and Telegraphs (CEPT). They formed a study group called the Groupe Special Mobile ( GSM ) to study and develop a pan-European public land mobile system. Several basic criteria that the new cellular technology would have to meet were set down for the new GSM system to meet. These included: good subjective speech quality, low terminal and service cost, support for international roaming, ability to support handheld terminals, support for range of new services and facilities, spectral efficiency, and finally ISDN compatibility.With the levels of under-capacity being projected for the analogue systems, this gave a real sense of urgency to the GSM development. Although decisions about the exact nature of the cellular technology were not taken at an early stage, all parties involved had been working toward a digital system. This decision was finally made in February 1987. This gave a variety of advantages. Greater levels of spectral efficiency could be gained, and in addition to this the use of digital circuitry
54

would allow for higher levels of integration in the circuitry. This in turn would result in cheaper handsets with more features. Nevertheless significant hurdles still needed to be overcome. For example, many of the methods for encoding the speech within a sufficiently narrow bandwidth needed to be developed, and this posed a significant risk to the project. Nevertheless the GSM system had been started. PRODUCT CONCEPT Designed for global market, sim300 is a tri-band gsm/gprs engine that works on frequencies egsm 900 mhz, dcs 1800 mhz and pcs1900 mhz. Sim300 provides gprs multi-slot class 10 capability and support the gprs coding schemes cs-1, cs-2, cs-3 and cs-4. With a tiny configuration of 40mm x 33mm x 2.85 mm , sim300 can fit almost all the space requirement in your application, such as smart phone, pda phone and other mobile device.The physical interface to the mobile application is made through a 60 pins board-to-board connector, which provides all hardware interfaces between the module and customers boards except the rf antenna interface. The keypad and SPI LCD interface will give you the flexibility to develop customized applications. Two serial ports can help you easily develop your applications. Two audio channels include two microphones inputs and two speaker outputs. This can be easily configured by at command. Sim300 provide rf antenna interface with two alternatives: antenna connector and antenna pad. The antenna connector is murata mm9329-2700. And customers antenna can be soldered to the antenna pad. The sim300 is designed with power saving technique, the current consumption to as low as 2.5ma in sleep mode. The sim300 is
55

integrated with the tcp/ip protocolextended tcp/ip at commands are developed for customers to use the tcp/ip protocol easily, which is very useful for those data transfer applications.

SIM300 KEY FEATURES AT A GLANCE

56

APPLICATION INTERFACE: All hardware interfaces except rf interface that connects sim300 to the customers cellular application platform is through a 60 -pin 0.5mm pitch board-toboard connector. Sub-interfaces included in this board-to-board connector are described in detail in following chapters: Power supply Dual serial interface Two analog audio interfaces Sim interface

Electrical and mechanical characteristics of the board-to-board connector are specified. There we also order information for mating connectors. POWER SUPPLY: The power supply of sim300 is from a single voltage source of vbat= 3.4v...4.5v. In some case, the ripple in a transmit burst may cause voltage drops when current consumption rises to typical peaks of 2a, so the power supply must be able to provide sufficient current up to 2a. recommended.
57

For the vbat input, a local bypass capacitor is

A capacitor (about 100f, low esr) is recommended. Multi-layer ceramic chip (mlcc) capacitors can provide the best combination of low esr and small size but may not be cost effective. A lower cost choice may be a 100 f tantalum capacitor (low esr) with a small (1 f to 10f) ceramic in parallel, which is illustrated as following figure. And the capacitors should put as closer as possible to the sim300 vbat pins. The following figure is the recommended circuit.

The following figure is the vbat voltage ripple wave at the maximum power transmit phase, the test condition is vbat=4.0v, vbat maximum output current =2a, ca=100 f tantalum capacitor (esr=0.7) and cb=4.7f POWER SUPPLY PINS ON THE BOARD-TO-BOARD CONNECTOR: Eight vbat pins of the board-to-board connector are dedicated to connect the supply voltage; four gnd pins are recommended for grounding. Backup can be used to back up the RTC.

58

Minimizing power losses: Please pay special attention to the supply power when you are designing your applications. Please make sure that the input voltage will never drops below 3.4v even in a transmit burst during which the current consumption may rise up to 2a. If the power voltage drops below 3.4v, the module may be switched off. Using the board-toboard connector will be the best way to reduce the voltage drops. You should also take the resistance of the power supply lines on the host board or of battery pack into account. Monitoring power supply: To monitor the supply voltage, you can use the at+cbc command which include three parameters: voltage percent and voltage value (in mv). It returns the battery voltage 1-100 percent of capacity and actual value measured at vbat and gnd. The voltage is continuously measured at intervals depending on the operating mode. The displayed voltage (in mv) is averaged over the last measuring period before the at+cbc command was executed. POWER UP AND POWER DOWN SCENARIOS TURN ON SIM300: Sim300 can be turned on by various ways, which are described in following Via pwrkey pin: starts normal operating mode Via rtc interrupt: starts alarm modes

TURN ON SIM300 USING THE PWR KEY PIN (POWER ON): You can turn on the sim300 by driving the pwrkey to a low level voltage.

59

TURN ON SIM300 USING THE RTC (ALARM MODE): Alarm mode is a power-on approach by using the rtc. The alert function of rtc makes the sim300 wake up while the module is power off. In alarm mode, sim300 will not register to gsm network and the software protocol stack is close. Thus the parts of at commands related with sim card and protocol stack will not accessible, and the others can be used as well as in normal mode. Use the at+calarm command to set the alarm time.

The rtc remains the alarm time if sim300 was power down by at+cpowd=1 or by pwrkey pin. Once the alarm time expires and executed, sim300 goes into the alarm mode. In this case, sim300 will send out an unsolicited result code (urc): RDY ALARM MODE: During alarm mode, using at+cfun command to query the status of software protocol stack; it will return 0 which indicates that the protocol stack is closed. Then after 90s, sim300 will power down automatically. However, during alarm mode, if the software protocol is started by at+cfun=1, 1 command, the process of automatic power
60

down will not available. In alarm mode, driving the pwrkey to a low level voltage for a period will cause sim300 to power down

TURN OFF SIM300: Following procedure can be used to turn off the sim300: Normal power down procedure: turn off sim300 using the pwrkey pin Normal power down procedure: turn off sim300 using at command Under-voltage automatic shutdown: takes effect if under-voltage is detected Over-temperature automatic shutdown: takes effect if over-temperature is

detected

TURN OFF SIM300 USING THE PWRKEY PIN (POWER DOWN) : You can turn off the sim300 by driving the pwrkey to a low level voltage for period time. The power down scenarios illustrate as following figure. This procedure will let the module to log off from the network and allow the software to enter into a secure state and save data before completely disconnect the power supply. Before the completion of the switching off procedure the module will send out result code:
61

POWER DOWN After this moment, no any at commands can be executed. Module enters the power down mode, only the rtc is still active. Power down can also be indicated by vdd_ext pin, which is a low level voltage in this mode.

TURN OFF SIM300 USING AT COMMAND : You can use an at command at+cpowd=1 to turn off the module. This command will let the module to log off from the network and allow the software to enter into a secure state and safe data before completely disconnect the power supply. POWER DOWN: After this moment, no any at commands can be executed. Module enters the power down mode, only the rtc is still active. Power down can also be indicated by vdd_ext pin, which is a low level voltage in this mode UNDER-VOLTAGE AUTOMATIC SHUTDOWN: Software will constantly monitors the voltage applied on the vbat, if the measured battery voltage is no more than 3.5v, the following urc will be presented: POWER LOW WARNING:
62

If the measured battery voltage is no more than 3.4v, the following urc will be presented.

POWER LOW DOWN After this moment, no further more at commands can be executed. The module will log off from network and enters power down mode, only the rtc is still active. RESTART SIM300 USING THE PWR KEY PIN : You can restart sim300 by driving the pwrkey to a low level voltage for period time, same as turn on sim300 using the pwrkey pin. Before restart the sim300, you need delay at least 500ms from detecting the vdd_ext low level on. The restart scenarios illustrate as the following figure.

POWER SAVING :

63

There are two methods to achieve sim300 module extreme low power. at+cfun is used to set module into minimum functionality mode and /dtr hardware interface signal can be used to set system to be sleep mode (or slow clocking mode). MINIMUM FUNCTIONALITY MODE : Minimum functionality mode reduces the functionality of the module to a minimum and, thus, minimizes the current consumption to the lowest level. This mode is set with the at+cfun command which provides the choice of the functionality levels <fun>=014 0: minimum functionality; 1: full functionality (default); 4: disable phone both transmit and receive rf circuits; If sim300 has been set to minimum functionality by at+cfun=0, then the rf function and the SIM card function will be closed, in this case, the serial ports is still accessible, but all at commands need Rf function or SIM card function will not accessible. If sim300 has disable all rf function by at+cfun=4, then rf function will be closed, the serial ports is still active in this case but all at commands need rf function will not accessible. When sim300 is in minimum functionality or has been disable all rf functionality by at+cfun=4, it can return to full functionality by at+cfun=1. SLEEP MODE (SLOW CLOCKING MODE) : Through DTR signal control sim300 module to enter or exit the sleep mode in customer applications. When dtr is in high level, at the same time there is no on air or audio activity is required and no hardware interrupt (such as gpio interrupt or data on serial port), sim300 will enter sleep mode automatically. In this mode, sim300 can still receive paging or sms from network. In sleep mode, the serial port is not accessible. WAKE UP SIM300 FROM SLEEP MODE :
64

When sim300 is sleep mode, the following method can wake up the module. Enable dtr pin to wake up sim300; If DTR pin is pull down to a low level this signal will wake up sim300 from power saving mode. The serial port will be active after DTR change to low level about 20m Receive a voice or data call from network to wake up sim300; Receive a sms from network to wake up sim300 Rtc alarm expired to wake up sim300

GLOBAL USAGE Originally GSM had been planned as a European system. However the first indication that the success of GSM was spreading further a field occurred when the Australian network provider, Telstra signed the GSM Memorandum of Understanding. FREQUENCIES Originally it had been intended that GSM would operate on frequencies in the 900 MHz cellular band. In September 1993, the British operator Mercury One-to-One launched a network. Termed DCS 1800 it operated at frequencies in a new 1800 MHz band. By adopting new frequencies new operators and further competition were introduced into the market apart from allowing additional spectrum to be used and further increasing the overall capacity. This trend was followed in many countries, and soon the term DCS 1800 was dropped in favor of calling it GSM as it was purely the
65

same cellular technology but operating on a different frequency band. In view of the higher frequency Used the distances the signals travelled was slightly shorter but this was compensated for by additional base stations.In the USA as well a portion of spectrum at 1900 MHz was allocated for cellular usage in 1994. The licensing body, the FCC, did not legislate which technology should be used, and accordingly this enabled GSM to gain a foothold in the US market. This system was known as PCS 1900 (Personal Communication System).

THE GSM NETWORK GSM provides recommendations, not requirements. The GSM specifications define the functions and interface requirements in detail but do not address the hardware. The reason for this is to limit the designers as little as possible but still to make it possible for the operators to buy equipment from different suppliers. The GSM network is divided into three major systems: the switching system (SS), the base station system (BSS), and the operation and support system (OSS).

66

Fig 3. GSM Network Elements The operations and maintenance center (OMC) is connected to all equipment in the switching system and to the BSC. The implementation of OMC is called the operation and support system (OSS). The OSS is the functional entity from which the network operator monitors and controls the system. The purpose of OSS is to offer the customer cost-effective support for centralized, regional, and local operational and maintenance activities that are required for a GSM network. An important function of OSS is to provide a network overview and support the maintenance activities of different operation and maintenance organizations. SPECIFICATIONS AND CHARACTERISTICS FOR GSM The specifications and characteristics for GSM Frequency BandThe frequency range specified for GSM is 1,850 to 1,990 MHz (mobile station to basestation).
67

Duplex DistanceThe duplex distance is 80 MHz. Duplex distance is the distance between the uplink anddownlink frequencies. A channel has two frequencies,80 MHz apart. Channel SeparationThe separation between adjacent carrier frequencies. In GSM, this is 200 kHz. ModulationModulation is the process of sending a signal by changing the characteristics of a carrierfrequency. This is done in GSM via Gaussian minimum shift keying (GMSK). Transmission RateGSM is a digital system with an over-the-air bit rate of 270 kbps. AT COMMANDS AT commands are used to control MODEMs. AT is the abbreviation for Attention. These commands come from Hayes commands that were used by the Hayes smart modems. The Hayes commands started with AT to indicate the attention from the MODEM. The dial up and wireless MODEMs (devices that involve machine to machine communication) need AT commands to interact with a computer. These include the Hayes command set as a subset, along with other extended AT commands. AT commands with a GSM/GPRS MODEM or mobile phone can be used to access following information and services: 1. card. 2. 3. SMS services. MMS services.
68

Information and configuration pertaining to mobile device or MODEM and SIM

4. 5.

Fax services. Data and Voice link over mobile network.

The Hayes subset commands are called the basic commands and the commands specific to a GSM network are called extended AT commands. Types of AT Commands: There are four types of AT commands:

1) Test commands - used to check whether a command is supported or not by the MODEM. SYNTAX: For example: AT<command name>=? ATD=?

2)

Read command - used to get mobile phone or MODEM settings for an

operation. SYNTAX: AT<command name>?


69

For example: 3)

AT+CBC?

Set commands - used to modify mobile phone or MODEM settings for an

operation. SYNTAX: AT<command name>=value1, value2, , valueN

Some values in set commands can be optional. For example: 4) AT+CSCA=+9876543210, 120

Execution commands - used to carry out an operation. AT<command name>=parameter1, parameter2, , parameterN

SYNTAX:

The read commands are not available to get value of last parameter assigned in execution commands because parameters of execution commands are not stored. For example: AT+CMSS=1,+ 9876543210, 120

Explanation of commonly used AT commands:


70

1)AT - This command is used to check communication between the module and the computer. For example, AT OK The command returns a result code OK if the computer (serial port) and module are connected properly. If any of module or SIM is not working, it would return a result code ERROR. 2) +CMGF - This command is used to set the SMS mode. Either text or PDU mode can be selected by assigning 1 or 0 in the command. SYNTAX: AT+CMGF=<mode>

0: for PDU mode 1: for text mode The text mode of SMS is easier to operate but it allows limited features of SMS. The PDU (protocol data unit) allows more access to SMS services but the operator

requires bit level knowledge of TPDUs. The headers and body of SMS are accessed in hex format in PDU mode so it allows availing more features. For example, AT+CMGF=1 OK

71

3) +CMGW - This command is used to store message in the SIM. SYNTAX: AT+CMGW= Phone number> Message to be stored Ctrl+z

As one types AT+CMGW and phone number, > sign appears on next line where one can type the message. Multiple line messages can be typed in this case. This is why the message is terminated by providing a Ctrl+z combination. As Ctrl+z is pressed, the following information response is displayed on the screen. +CMGW: Number on which message has been stored 4) +CMGS - This command is used to send a SMS message to a phone number. SYNTAX: AT+CMGS= serial number of message to be send.

As the command AT+CMGS and serial number of message are entered, SMS is sent to the particular SIM. For example, AT+CMGS=1 OK 5)ATD - This command is used to dial or call a number. SYNTAX: ATD<Phone number>(Enter)

For example, ATD123456789

72

6) ATA - This command is used to answer a call. An incoming call is indicated by a message RING which is repeated for every ring of the call. When the call ends NO CARRIER is displayed on the screen. SYNTAX: ATA(Enter)

As ATA followed by entering key is pressed, an incoming call is answered. For example, RING RING ATA 7) ATH - This command is used to disconnect remote user link with the GSM module. SYNTAX: ATH (Enter)

LIST OF AT COMMANDS: The AT commands for both, GSM module and the mobile phone, are listed below. Some of these commands may not be supported by all the GSM modules available. Also there might be some commands which wont be supported by some mobile handsets.

73

TESTING: Command AT Description Checking communication between the module and computer.

CALL CONTROL: Command ATA ATD ATH ATL ATM ATO ATP ATT AT+CSTA AT+CRC Description Answer command Dial command Hang up call Monitor speaker loudness Monitor speaker mode Go on-line Set pulse dial as default Set tone dial as default Select type of address Cellular result codes

DATA CARD CONTROL: Command ATI ATS ATZ AT&F AT&V Description Identification Select an S-register Recall stored profile Restore factory settings View active configuration
74

AT&W AT&Y AT+CLCK AT+COLP AT+GCAP AT+GMI AT+GMM AT+GMR AT+GSN

Store parameters in given profile Select Set as power up option Facility lock command Connected line identification presentation Request complete capabilities list Request manufacturer identification Request model identification Request revision identification Request product serial number identification (IMEI)

PHONE CONTROL: Command AT+CBC AT+CGMI AT+CGMM AT+CGMR AT+CGSN AT+CMEE AT+CPAS AT+CPBF AT+CPBR AT+CPBS AT+CPBW AT+CSCS AT+CSQ Description Battery charge Request manufacturer identification Request model identification Request revision identification Request product serial number identification Report mobile equipment error Phone activity status Find phone book entries Read phone book entry Select phone book memory storage Write phone book entry Select TE character set Signal quality

COMPUTER DATA INTERFACE: Command ATE ATQ ATV ATX AT&C Description Command Echo Result code suppression Define response format Response range selection Define DCD usage
75

AT&D AT&K AT&Q AT&S AT+ICF AT+IFC AT+IPR

Define DTR usage Select flow control Define communications mode option Define DSR option DTE-DCE character framing DTE-DCE Local flow control Fixed DTE rate

SERVICE: Command AT+CLIP AT+CR AT+DR AT+ILRR Description Calling line identification presentation Service reporting control Data compression reporting DTE-DCE local rate reporting

NETWORK COMMUNICATION PARAMETER : Command ATB AT+CBST AT+CEER AT+CRLP AT+DS Description Communications standard option Select bearer service type Extended error report Radio link protocol Data compression

MISCELLANEOUS: Command A/ AT? AT*C AT*T Description Re-execute command line Command help Start SMS interpreter Enter SMS block mode protocol
76

AT*V AT*NOKIATEST AT+CESP

Activate V.25bis mode Test command Enter SMS block mode protocol

SMS TEXT MODE: Command AT+CSMS AT+CPMS AT+CMGF AT+CSCA AT+CSMP AT+CSDH AT+CSCB AT+CSAS AT+CRES AT+CNMI AT+CMGL AT+CMGR AT+CMGS AT+CMSS AT+CMGW AT+CMGD SMS PDU MODE: Command AT+CMGL AT+CMGR AT+CMGS AT+CMGW MAX 232 The MAX232 is an IC, first created in 1987 by Maxim Integrated Products, that converts signals from an RS-232 serial port to signals suitable for use in TTL
77

Description Select message service Preferred message storage Message format Service centre address Set text mode parameters Show text mode parameters Select cell broadcast message types Save settings Restore settings New message indications to TE List messages Read message Send message Send message from storage Write message to memory Delete message

Description List Messages Read message Send message Write message to memory

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 VTTL levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis of 0.5 V The MAX 232(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. Typically, a pair of a driver/receiver of the MAX232 is used for TX and RX signals, and the second one for CTS and RTS signals. 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. If the DTE really requires these signals, either a second MAX232 is needed, or some other IC from the MAX232 family can be used. Also, it is possible to directly wire DTR (DB9 pin #4) to DSR (DB9 pin #6) without going through any circuitry. This gives automatic (brain dead) DSR acknowledgment of an incoming DTR signal. 3.1 LM35 The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in Kelvin, as the
78

user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does not require any external calibration or trimming to provide typical accuracies of 14C at room temperature and 34C over a full 55 to +150C temperature range. Low cost is assured by trimming and calibration at the wafer level. The LM35s low output impedance, linear output, and precise inherent calibration make Interfacing to readout or control circuitry especially easy. It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 A from its supply, it has very low self-heating, less than 0.1C in still air. The LM35 is rated to operate over a 55 to +150C temperature range, while the LM35C is rated for a 40 to +110C range (10with improved accuracy).

LM 35 PINOUT

Figure 2

79

3.2 LCD (JHD162A)

Figure 3

80

Pin 1 and 2 are the power supply pins. They need to be connected to the negative rail and the positive rail of a +5v power supply respectively. To get a stable +5v Power supply, we can use a7805 voltage regulator. Pin 3 is the contrast setting pin. It must be connected to a potentiometer to control the contrast. The lower the resistance, the greater the contrast Pins 4, 5 and 6 are control pins of the LCD. Ill explain about them later on in the post. Pins 7 to 14 are the Data pins of the LCD. Pin 7 is the Least Significant Bit (LSB) and pin 14 is the Most Significant Bit (MSB) of the data inputs. If we want to display some number or letter on the display, we have to input the appropriate codes for that character on these pins. These pins are also used for giving certain commands to the display like clearing the display or moving the cursor to a different location. Upon giving the correct signals to the 3 control pins, the character codes or the commands that you have given to the Data pins will be written to the display or executed by the LCD respectively.
5.1 POWER SUPPLY 5.1.1 CIRCUIT DIAGRAM

Fig 5.1.2Circuit Diagram of Power Supply 81

5.1.2 WORKING PRINCIPLE The AC voltage, typically 220 rms, is connected to a transformer, which steps that ac voltage down to the level of the desired DC output. A diode rectifier then provides a full-wave rectified voltage that is initially filtered by a simple capacitor filter to produce a dc voltage. This resulting dc voltage usually has some ripple or ac voltage variation. A regulator circuit removes the ripples and also remains the same dc value even if the input dc voltage varies, or the load connected to the output dc voltage changes.

5.1.3 BLOCK DIAGRAM

TRANSFORMER

RECTIFIER

FILTER

IC

LOAD

Fig 5.1.3 Block Diagram of power supply 5.1.4 TRANSFORMER

The potential transformer will step down the power supply voltage (0-230V) to (0-6V) level. Then the secondary of the potential transformer will be connected to the precision rectifier, which is constructed with the help of op-amp. The advantages of using precision rectifier are it will give peak voltage output as DC; rest of the circuits will give only RMS output.

5.1.5 RECTIFIER

82

A rectifier is an electrical device that converts alternating current to direct current or at least to current with only positive value, a process known as rectification. Rectifiers are used as components of power supplies and as detectors of radio signals.

5.1.6 BRIDGE RECTIFIER

When four diodes are connected as shown in the power supply circuit diagram, is called Bridge rectifier. The input to the circuit is applied to the diagonally opposite corners of the network, and the output is taken from the remaining two corners.

5.1.7 VOLTAGE REGULATORS

Voltage regulators comprise a class of widely used ICs. Regulator IC units contain the circuitry for reference source, comparator amplifier, and overload protection all in a single IC. IC units provide regulation of either a fixed positive voltage, a fixed negative voltage, or an adjustably set voltage. The regulators can be selected for operation with load currents from hundreds of milli amperes to tens of amperes, corresponding to power ratings form milli watts to ten watt. A fixed three-terminal voltage regulator has an unregulated dc input voltage, Vi, applied to one input terminal, a regulated dc output voltage, Vo , from a second terminal, with the third terminal connected to ground.

GAS/SMOKE SENSOR: They are used in gas leakage detecting equipments in family and industry, are suitable for detecting of LPG, natural gas, town gas, avoid the noise of alcohol and cooking fumes and cigarette smoke.

83

In the process world, pH is an important parameter to be measured and controlled. The pH of a solution indicates how acidic or basic (alkaline) it is. The pH term translates the values of the hydrogen ion concentration - which ordinarily ranges between about 1 and 10 x -14 gram-equivalents per litre - into numbers between 0 and 14. On the pH scale a very acidic solution has a low pH value such as 0, 1, or 2 (which corresponds to a large concentration of hydrogen ions; 10 x 0, 10 x -1, or 10 x -2 gram-equivalents per litre) while a very basic solution has a high pH value, such as 12, 13, or 14 which corresponds to a small number of hydrogen ions (10 x -12, 10 x -13, or 10 x -14 gram-equivalents per litre). A neutral solution such as water has a pH of approximately 7.
A pH measurement loop is made up of three components, the pH sensor, which includes a measuring electrode, a reference electrode, and a temperature sensor; a preamplifier; and an analyser or transmitter. A pH measurement loop is essentially a battery where the positive terminal is the measuring electrode and the negative terminal is the reference electrode. The measuring electrode, which is sensitive to the hydrogen ion, develops a potential (voltage) directly related to the hydrogen ion concentration of the solution. The reference electrode provides a stable potential against which the measuring electrode can be compared

84

HUMIDITY SENSOR

1. Introduction
Humidity is one of the most frequently measured quantities in different fields, such as industrial processing, agricultural, climate research, pharmaceutical engineering, etc. A humidity sensor is a device used to measure the humidity of air or any gas in a given area. It can be used in both indoors and outdoors. The humidity sensor is able to assists peoples daily life in an invisible way. For example, to prevent the paper jam problem, the inside humidity sensor would detect the relative humidity at first, then the microchip would determine whether to warm up the printer to reduce the water vapour. The amount of water vapor in the atmosphere determines humidity. The humidity plays an important role in the numerous measurement situations. Hygrometry is in fact a branch of applied physics in which the multitude of techniques is an indication of the complexity of the problem, and of the fact that no one solution will meet all requirements at all times and in all places. Nowadays, there are many different types of humidity sensor to be set in various fields. To fabricate a ideal humidity sensor is a tough task due to the complex requirements. The ideal humidity sensor should have some characteristics: (1) suitable for wide temperature, (2)wide humidity range, (3)long-life usage, (4)good stability; (5)fast response speed,(6) suitable in the harsh environments. To achieve these requirements, the materials chemistry and microcircuit field contribute numerous effects. In recent years, the almost market share of humidity sensor is consists of capacitive humidity sensor.[8][9] In this brief guide, it would mainly introduce various state-of-the-art miniaturised humidity sensors, , including (1) capacitive, (2) resistive, (3) hygrometric, (4) gravimetric and (5)optical techniques. Finally, it will show some practical applications.

85

This function board is used to measure humidity as an analog input.

The pass-through connector on the back of the humidity sensor does not have a connection for analog input. Connecting another circuit to the analog input would negatively affect the sensor readings. Therefore an ambient light sensor, temperature probe, and humidity sensor cannot exist on the same I/O channel. Specifications
Operating Temperature Operating Humidity Range Hysteresis Response Time Repeatability Settling Time Supply Current Stability at 50% RH Output Signal Covered Device Moisture/Dust Filter -40 C to 85 C [-40 F to 185 F] 0 % RH to 100 % RH 2 % RH 5 s 1/e in slow moving air 0.5 % RH 70 ms max. 500 A 1.2 % RH Analog voltage Yes Yes

86

See the Sensors section for more information on the operation of the Honeywell sensor. The circuit diagram is as follows:

CONCLUSION

87

The proposed system is cost effective and controlled by user friendly embedded systems. The block diagram of the proposed system is as shown in figure2. In this proposed system, we have designed one master module which consists of microcontroller, GSM module and Zigbee module. Three slave modules are designed using Sbit microcontroller and Zigbee module. Remote control circuit is designed to control the various devices of home for short distance communication. GSM module is used for long distance control of devices and monitoring of environment of home. REFERRENCES 1. Ballantine, D.S.; White, R.M.; Martin, S.J.; Ricco, A.J.; Zellers, E.T.; Frye, G.C.; Wohltjen, H. Acoustic Wave Sensors: Theory, Design, and Physico-Chemical Applications; Academic Press: San Diego, CA, USA, 1997; p. 436. 2. Wohltjen, H.; Dessy, R. Surface acoustic wave probe for chemical analysis. I. Introduction and instrument description. Anal. Chem. 1979, 51, 14581464. 4. Anderson, N.S.; Bermudez, Y.; Badgwell, D.; Chen, R.; Nicosia, S.V.; Bast, R.C.; Kruk, P.A. Urinary levels of Bcl-2 are elevated in ovarian cancer patients. Gynecol. Oncol. 2009, 112, 6067. 5. Baekelandt, M.; Kristensen, G.B.; Nesland, J.M.; Trope, C.G.; Holm, R. Clinical significance of apoptosis-related factors p53, Mdm2, and Bcl-2 in advanced ovarian cancer. J Clin. Oncol. 1999, 17, 20612068.
88

6. Onen, O.; Sisman, A.; Gallant, N.D.; Kruk, P.; Guldiken, R. A urinary Bcl-2 surface acoustic wave biosensor for early ovarian cancer detection. Sensors 2012, 12, 74237437. 7. Lu, B.; Smyth, M.R.; OKennedy, R. Oriented immobilization of antibodies and its applications in immunoassays and immunosensors. Analyst 1996, 121, 2932. 8. Le Brun, A.P.; Holt, S.A.; Shah, D.S.H.; Majkrzak, C.F.; Lakey, J.H. The structural orientation of antibody layers bound to engineered biosensor surfaces. Biomaterials 2011, 32, 33033311. 9. Forsgren, A.; Sjquist, J. protein a from staphylococcus aureus. J. Immunol. 1967, 99, 1924. 10. Green, R.J.; Tasker, S.; Davies, J.; Davies, M.C.; Roberts, C.J.; Tendler, S.J.B. Adsorption of peoppopeo triblock copolymers at the solid/liquid interface: A surface plasmon resonance study. Langmuir 1997, 13, 65106515. .

89

Das könnte Ihnen auch gefallen