Tuesday, 17 October 2017

RF MODULE-XBEE :

zigbee module
XBee and XBee-PRO Modules were engineered to meet ZigBee/IEEE 802.15.4 standards and support the unique needs of low-cost, low-power wireless sensor networks. The modules require minimal power and provide reliable delivery of critical data between devices. The modules operate within the ISM 2.4 GHz frequency band and are pin-for-pin compatible with each other.The XBee and XBee-PRO OEM RF Modules were engineered to meet IEEE 802.15.4 standards and support the unique needs of low-cost, low-power wireless sensor networks. The modules require minimal power and provide reliable delivery of data between devices. The modules operate within the ISM 2.4 GHz frequency and are pin-for-pin compatible with each other. ZIGBEE is an open technology developed by the ZIGBEE Alliance to overcome the limitations of BLUETOOTH and Wi-Fi. ZIGBEE is an IEEE 802.15.4 standard for data communications with business and consumer devices. It is designed around low-power consumption allowing batteries to essentially last forever. BLUETOOTH as we know was developed to replace wires and Wi-Fi to achieve higher data transfer rate, as such till now nothing has been developed for sensor networking and control machines which require longer battery life and continuous working without human intervention. ZIGBEE devices allow batteries to last up to years using primary cells (low cost) without any chargers (low cost and easy installation). The ZIGBEE standard provides network, security, and application support services operating on top of the IEEE 802.15.4 Medium Access Control (MAC) and Physical Layer (PHY) wireless standard. It employs a suite of technologies to enable scalable, self-organizing, self-healing networks that can manage various data traffic patterns. Thenetwork layer supports various topologies such star clustered tree topology and self-healing mesh topologywhich is essential in Smart dust apart from easy installation and easy implementation ZIGBEE has a wide application area such as home networking, industrial networking, Smart dust, many more, having different profiles specified for each field. The upcoming of ZIGBEE will revolutionize the home networking and rest of the wireless world.

Key Features:   
LongRange Data Integrity:
               
XBee Range
Ø  Indoor/Urban: up to 100’ (30 m)
Ø  Outdoor line-of-sight: up to 300’ (100 m)
Ø  Transmit Power: 1 mW (0 dBm)
Ø  Receiver Sensitivity: -92 dBm
XBee-PRO Range
Ø  Indoor/Urban: up to 300’ (100 m)
Ø  Outdoor line-of-sight: up to 1 mile (1500 m)
Ø  Transmit Power: 100 mW (20 dBm) EIRP
Ø  Receiver Sensitivity: -100 dBm
Ø  RF Data Rate: 250,000

Advanced Networking & Security
Ø  Retries and Acknowledgements
Ø  DSSS (Direct Sequence Spread Spectrum)
Ø  Each direct sequence channels has over 65,000 unique network addresses available
Ø  Point-to-point, point-to-multipoint and peer-to-peer topologies supported
Ø  128-bit Encryption.

SPECIFICATIONS:





PIN SIGNALS:



Electrical Characteristics:

4.13.6  FLOW CONTROL:
DI (Data In) Buffer:
When serial data enters the RF module through the DI pin (pin 3), the data is stored in the DI Buffer until it can be processed.
Hardware Flow Control (CTS):
When the DI buffer is 17 bytes away from being full; by default, the module de-asserts CTS (high) to signal to the host device to stop sending data [refer to D7 (DIO7 Configuration) parameter]. CTS is re-asserted after the DI Buffer has 34 bytes of memory available.
How to eliminate the need for flow control:
1. Send messages that are smaller than the DI buffer size.
2. Interface at a lower baud rate [BD (Interface Data Rate) parameter] than the throughput data rate.
Case in which the DI Buffer may become full and possiblyoverflow:
If the module is receiving a continuous stream of RF data, any serial data that arrives on the DI pin is placed in the DI Buffer. The data in the DI buffer will be transmitted over-the-air when the module is no longer receiving RF data in the network.
DO (Data Out) Buffer:
When RF data is received, the data enters the DO buffer and is sent out the serial port to a host device. Once the DO Buffer reaches capacity, any additional incoming RF data is lost.
Hardware Flow Control (RTS):
If RTS is enabled for flow control (D6 (DIO6 Configuration) Parameter = 1), data will not be sent out the DO Buffer as long as RTS (pin 16) is de-asserted.
Two cases in which the DO Buffer may become full and possibly overflow:
1. If the RF data rate is set higher than the interface data rate of the module, the module will receive data from the transmitting module faster than it can send the data to the host.
2. If the host does not allow the module to transmit data out from the DO buffer because of being held off by hardware or software flow control.
4.14 GSM SIM 900A:
If you are in Europe or Asia and using a mobile phone, then most probably you are using GSM technology in your mobile phone.
GSMstands for Global System for Mobile Communication. It is a digital cellular technology used for transmitting mobile voice and data services.
The concept of GSM emerged from a cell-based mobile radio system at Bell Laboratories in the early 1970s.
·         GSM is the name of a standardization group established in 1982 to create a common European mobile telephone standard.
·         GSM is the most widely accepted standard in telecommunications and it is implemented globally.
·         GSM is a circuit-switched system that divides each 200 kHz channel into eight 25 kHz time-slots. GSM operates on the mobile communication bands 900 MHz and 1800 MHz in most parts of the world. In the US, GSM operates in the bands 850 MHz and 1900 MHz.
·         GSM owns a market share of more than 70 percent of the world's digital cellular subscribers.
·         GSM makes use of narrowband Time Division Multiple Access (TDMA) technique for transmitting signals.
·         GSM was developed using digital technology. It has an ability to carry 64 kbps to 120 Mbps of data rates.
·         Presently GSM supports more than one billion mobile subscribers in more than 210 countries throughout the world.
·         GSM provides basic to advanced voice and data services including roaming service. Roaming is the ability to use your GSM phone number in another GSM network.
·         GSM digitizes and compresses data, then sends it down through a channel with two other streams of user data, each in its own timeslot.
FEATURES OF GSM MODULE
·         Improved spectrum efficiency
·         International roaming
·         Compatibility with integrated services digital network (ISDN)
·         Support for new services.
·         SIM phonebook management
·         Fixed dialing number (FDN)
·         Real time clock with alarm management
·         High-quality speech
·         Uses encryption to make phone calls more secure
·         Short message service (SMS)
·         The security strategies standardized for the GSM system make it the most secure telecommunications standard currently accessible. Although the confidentiality of a call and secrecy of the GSM subscriber is just ensured on the radio channel, this is a major step in achieving end-to- end security.

Radio modem by SIMComm is used in the shield. Communication with the shield can be done easily with the shield by using AT commands. It Supports features like Data, Voice, GPRS, SMS and integratedTCP/IP stack. The connections of GSM module are done directly to PC through serial port/to microcontroller through serial interface with the use of MAX232. In addition to this, In GPRS mode, it can be connected to internet to run various applications for recording data over the time and to any remote FTP server to upload files for the data to be saved. For different applications particular specifications are required which are mentioned in datasheet of GSM modules
GSM Module

In this system, SMS application is used which is intended for the person who is monitoring the value of CO in a room or an industry whenever it exceeds a particular safe limit chosen according to a particular application. The threshold safe limit as well as the mobile number of the person to which the text message is to be sent is programmed in the Arduino which can be changed for any specific purpose.

GAS SENSOR :

The sensing element of gas sensors is a tin dioxide (SnO2) semiconductor which has low conductivity in clean air. In the presence of a detectable gas, the sensor's conductivity increases depending on the gas concentration in the air. A simple electrical circuit can convert the change in conductivity to an output signal which corresponds to the gas concentration.
It has high sensitivity to methane, propane, and butane, making it ideal for natural gas and LPG monitoring. The sensor can detect a wide range of gases, making it an excellent, low cost sensor for a wide variety of applications. Also available with a ceramic base which is highly resistant to severe environments up to 200°C

Features:
  • General purpose sensor with sensitivity to a wide range of combustible gases
  • High sensitivity to methane, propane, and butane
  • Long life and low cost
  • Uses simple electrical circuit
The figure below represents typical sensitivity characteristics, all data having been gathered at standard test conditions. The Y-axis is indicated as sensor resistance ratio (Rs/Ro) which is defined as follows:
Rs = Sensor resistance of displayed gases at various concentrations
Ro = Sensor resistance in 1000ppm methane

The figure below represents typical temperature and humidity dependency characteristics. Again, the Y-axis is indicated as sensor resistance ratio (Rs/Ro), defined as follows:
Rs = Sensor resistance at 1000ppm of methane at various temperatures/humidities
Ro = Sensor resistance at 1000ppm of methane at 20°C and 65% R.H.

Pin Connection and Basic Measuring Circuit:
The numbers shown around the sensor symbol in the circuit diagram at the right Correspond with the pin numbers shown in the sensor's structure drawing (above).When the sensor is connected as shown in the basic circuit, output across the Load Resistor (VRL) increases as the sensor's resistance (Rs) decreases, depending on gas concentration.


Applications:
  • Domestic gas leak detectors and alarms
  • Portable gas detectors

Carbon monoxide gas:
This Carbon Monoxide (CO) gas sensor detects the concentrations of CO in the air and outputs its reading as an analog voltage. The sensor can measure concentrations of 10 to 10,000 ppm.The sensor can operate at temperatures from -10 to 50°C and consumes less than 150 mA at 5 V. Please read the MQ7 datasheet (185k pdf) for more information about the sensor.
 Circuit Diagram of Carbon Monoxide


Connections:
Connecting five volts across the heating (H) pins keeps the sensor hot enough to function correctly. Connecting five volts at either the A or B pins causes the sensor to emit an analog voltage on the other pins. A resistive load between the output pins and ground sets the sensitivity of the detector. The resistive load should be calibrated for your particular application using the equations in the datasheet, but a good starting value for the resistor is 10 kΩ.

Features:
·         High sensitivity (MQ-7 sensor)
·         Detection range: 20-2000ppm CO
·         Response time: <150s
·         Heater voltage: 5.0v
·         Dimensions: 16mm

Co2 Gas concentration module:
Complete and ready-to-run carbon dioxide concentration module for outputting the CO2 concentration in digital format to microcontrollers or computer systems. The unit can measure co2 concentration from 0 to 10,000ppm, with concentration readings provided as either an analog signal, PWM or digital UART for direct connection to a microcontroller.
No calibration is required and the output is highly accurate to within 50ppm. Built-in temperature compensation ensures readings are accurate over a wide temperature range. The unit is compact and easy equipment, air conditioning equipment, research projects and much more.

Configuration of CO2 Gas Sensor
Features:
  • Ready-to-run no additional circuit or calibration required
  • Highly accurate didital output
  • Concentration readings available in either analog, PWM or digital format
  • Detection range:0-120,000ppmCo2 (carbon dioxide)
  • Accuracy: ±50ppm
  • Dimensions: 57mm Length, 35mm width

LCD Display :

Figure 4.13 Liquid crystal display

One of the most common devices attached to an 8051 is an LCD display. Some of the most common LCDs connected to the 8051 are 16x2 and 20x2 displays. This means 16 characters per line by 2 lines and 20 characters per line by 2 lines, respectively. In recent years the LCD is finding widespread use replacing LED’s. This is due to the following reasons- Declining prices, ability to display numbers, characters and graphics, Incorporation of a refreshing controller into the LCD and ease of programming.

ARCHITECTURE 0F AT89C51 :

The Accumulator
The Accumulator is used as a general register to accumulate the results of a large number of instructions. It can hold an 8-bit (1-byte) value and is the most versatile register the 8051 has due to the shear number of instructions that make use of the accumulator. Accumulator performs arithmetic and logic functions. Accumulator is also responsible for conditional branching and provides a temporary place in a data transfer operations within the device. More than half of the 8051’s 255 instructions manipulate or use the accumulator in some way.
The "R" registers     
The "R" registers are a set of eight registers that are named R0, R1, up to and including R7.
These registers are used as auxiliary registers in many operations.
The Accumulator alone would not be very useful if it were not for these "R" registers. The "R" registers are also used to temporarily store values.
The "B" Register
The "B" register is very similar to the Accumulator in the sense that it may hold an 8-bit (1-byte) value.
The "B" register is only used by two 8051 instructions: MUL AB and DIV AB. It enables quick and easier way of multiplying or dividing a number by another number, and stores the other number in "B" and makes use of these two instructions.
Aside from the MUL and DIV an instruction, the “B” register is often used as yet another temporary storage register much like a ninth "R" register.
The Data Pointer (DPTR)
The Data Pointer (DPTR) is the 8051’s only user-accessible 16-bit (2-byte) register. DPTR is used to point to data. It is used by a number of commands which allow the 8051 to access external memory. When the 8051 accesses external memory it will access external memory at the address indicated by DPTR.
 While DPTR is most often used to point to data in external memory, many programmers often take advantage of the fact that it’s the only true 16-bit register available. It is often used to store 2-byte values which have nothing to do with memory locations.
The Program Counter (PC)
The Program Counter (PC) is a 2-byte address which tells the 8051 where the next instruction to execute is found in memory. When the 8051 is initialized PC always starts at 0000h and is incremented each time an instruction is executed. It is important to note that PC isn’t always incremented by one. Since some instructions require 2 or 3 bytes the PC will be incremented by 2 or 3 in these cases. The Program Counter is special in that there is no way to directly modify its value.
The Stack Pointer (SP)
The Stack Pointer, like all registers except DPTR and PC, may hold an 8-bit (1-byte) value. The Stack Pointer is used to indicate where the next value to be removed from the stack should be taken from.
When you push a value onto the stack, the 8051 first increments the value of SP and then stores the value at the resulting memory location.
When you pop a value off the stack, the 8051 returns the value from the memory location indicated by SP, and then decrements the value of SP.
When the 8051 is initialized SP will be initialized to 07h. If you immediately push a value onto the stack, the value will be stored in Internal RAM address 08h. This makes sense taking into account what was mentioned two paragraphs above: First the 8051 will increment the value of SP (from 07h to 08h) and then will store the pushed value at that memory address (08h).
SP is modified directly by the 8051 by six instructions: PUSH, POP, ACALL, LCALL, RET, and RETI.

 

PSW Program Status Word

PSW, the Program Status Word is at address D0h and is a bit-addressable register. The status bits are listed in table 1.1.

Table.1.1 Program Status Word
Symbol Bit
Address
Description
C (or CY)
PSW.7 D7h
Carry flag
AC
PSW.6 D6h
Auxiliary carry flag
F0
PSW.5 D5h
Flag 0
RS1
PSW.4 D4h
Register bank select 1
RS0
PSW.3 D3h
Register bank select 0
0V
PSW.2 D2h
Overflow flag

PSW.1 D1h
Reserved
P
PSW.0 D0h
Even Parity flag


Carry flag(C)
This is a conventional carry, or borrows, flag used in arithmetic operations. The carry flag is also used as the ‘Boolean accumulator’ for Boolean instruction operating at the bit level. This flag is sometimes referenced as the CY flag.
Auxiliary carry flag (AC)
This is a conventional auxiliary carry (half carry) for use in BCD arithmetic.
Flag 0(F0)
This is a general-purpose flag for user programming.
Register bank select 0 and register bank select 1. RS0 and RS1
These bits define the active register bank (bank 0 is the default register bank).
Overflow flag. OV
This is a conventional overflow bit for signed arithmetic to determine if the result of a signed arithmetic operation is out of range.
Even Parity flag (P)
The parity flag is the accumulator parity flag, set to a value, 1 or 0, such that the number of ‘1’ bits in the accumulator plus the parity bit add up to an even number.

SFR Registers for the Internal Timer

TCON, the Timer Control register is an SFR at address 88h, which is bit-addressable. TCON is used to configure and monitor the 8051 timers. TMOD, the Timer Mode register is an SFR at address 89h and is used to define the operational modes for the timers. TL0 (Timer 0 Low) and TH0 (Timer 0 High) are two SFR registers addressed at 8Ah and 8Bh respectively. The two registers are associated with Timer 0.
TL1 (Timer 1 Low) and TH1 (Timer 1 High) are two SFR registers addressed at 8Ch and 8Dh respectively. These two registers are associated with Timer 1.

Power Control Register

PCON (Power Control) register is an SFR at address 87h. It contains various control bits including a control bit, which allows the 8051 to go to ‘sleep’ so as to save power when not in immediate use.

SerialPort Registers

The SCON (Serial Control) is an SFR register located at addresses 98h, and it is bit-addressable. SCON configures the behavior of the on-chip serial port, setting up parameters such as the baud rate of the serial port, activating send and/or receive data, and setting up some specific control flags.
The SBUF (Serial Buffer) is an SFR register located at address 99h. SBUF is just a single byte deep buffer used for sending and receiving data via the on-chip serial port.

Interrupt Registers

IE (Interrupt Enable) is an SFR register at addresses A8h and is used to enable and disable specific interrupts. The MSB bit (bit 7) is used to disable all interrupts.
IP (Interrupt Priority) is an SFR register at addresses B8h and it is bit addressable. The IP register specifies the relative priority (high or low priority) of each interrupt. On the 8051, an interrupt may either be of low (0) priority or high (1) priority.
4.4.1  PIN DESCRIPTION




VCC
Supply voltage.
GND
Ground.
Port 0
Port 0 is an 8-bit open-drain bi-directional 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 may 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
Port 1 is an 8-bit bi-directional 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 internal 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.
Port 1 also receives the low-order address bytes during Flash programming and verification.
Port 2
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source Current (IIL) because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application, it 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 3
Port 3 is an 8-bit bi-directional 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 also serves the functions of various special features
of the AT89C51 as listed below:

Port 3 Functions
Port 3 also receives some control signals for Flash programming and verification.

RST
Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device.
ALE/PROG
Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming.
In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped 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.
PSENProgram Store Enable is the read strobe to external program Memory. When the AT89C51 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. 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, for parts that require 12-volt VPP.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2


Output from the inverting oscillator amplifier is XTAL2 pin.

OSCILLATOR CHARACTERISTICS
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can be configured for use as an on-chip oscillator, as shown in Figure 1. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 2. There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed.

IDLE MODE
In idle mode, the CPU puts itself to sleep while all the on chip peripherals remain active. The mode is invoked by software. The content of the on-chip RAM and all the special functions registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset. It should be noted that when idle is terminated by a hard ware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited.
To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction following the one that invokes Idle should not be one that writes to a port pin or to external memory.

POWER DOWN MODE
In the power-down mode, the oscillator is stopped, and the instruction that invokes power-down is the last instruction executed. The on-chip RAM and Special Function Registers retain their values until the power-down mode is terminated. The only exit from power-down is a hardware reset. Reset redefines the SFR’s but does not change the on-chip RAM. The reset should not be activated before VCC
is restored to its normal operating level and must be held active long enough to allow the oscillator to restart and stabilize.

AT89C51 RESET



  • RESET is an active high input.
  • When RESET is set to high, AT89C51 goes to the power on state.
  • Power-On Reset.
  • Push PB and active high on RST.
  • Release PB, Capacitor discharges and RST goes low.
  • RST must stay high for a min of 2 machine cycles.                                                                                                                               
TIMER/COUNTERS
The 8051 has two internal sixteen bit hardware Timer/Counters. Each Timer/Counter can be configured in various modes, typically based on 8-bit or 16-bit operation. The 8051 product has an additional (third) Timer/Counter.
 8-bit COUNTER OPERATION
First let us consider a simple 8-bit counter. Since this is a modulo-8 set up we are concerned with 256 numbers in the range 0 to 255 (28 =256). The counter will count in a continuous sequence as follows:
Hex                 Binary                        Decimal
00h                  00000000                    0
01h                  00000001                    1
02h                  00000010                    2                      .                                   .
FEh                 11111110                    254
FFh                  11111111                    255
00h                  00000000                    0          here the counter overflows to zero1
01h                  00000001                    1


RF MODULE-XBEE :

zigbee module XBee and XBee-PRO Modules were engineered to meet ZigBee/IEEE 802.15.4 standards and support the unique needs of low-c...