-->

GSM Based Temperature Monitoring System

By







TMS aims at monitoring the temperature statistics in a factory, room etc, and controlling peripheral systems. It uses embedded technology from Intel Corporation and built for application in highly sensitive and critical systems.                           ( you can Download Full project report at bottom)

Through the system we try to bring down the overhead involved in monitoring the temperature statistics in various fields such as factory, air condition areas etc. With the obvious and immediate usage as a system controller it is a complete implementation of dynamic system management.

The system is aimed to meet the following prerequisites:
         To sense the temperature
         To display the temperature
         To display the date and time
         To set temperature limits
         To control the connected systems
         To save the history of limit crossings

Advantages

In a dynamic scenario wherein the breed and nature of real time systems are subjected to promising changes TMS is aimed at adding the fundamental functionality of interfacing them with varying ambience enabling them to be stable and reliable.

































































BLOCK DIAGRAM DESCRIPTION SIGNAL CONITIONING CIRCUIT: -
Signal conditioning circuit consists of two temperature transducers and an Analog to Digital Converter. The transducer converts the temperature to proportional electrical signal. The Temperature sensor used here is LM35 which has a resolution of
1 ° Celsius.


ANALOG TO DIGITAL CONVERTER:

An 8 Channel ADC is used since there is more than one sensor output that should be converted into digital format before feeding to the Micro Controller.

INTERFACING OF GSM UNIT: -

Interfacing of GSM unit through a serial communication link with microcontroller 89S51. Whatever data is to be sent to GSM unit is done through this RS 232 link.

LEVEL TRASLATOR: -

Level translator Translates TTL voltage level to RS-232 compatible level. It is realized with MAX 232.


SIGNAL CONDITIONING CIRCUIT:

Signal conditioning is widely used in the word of data acquisition. Signal conditioning circuit have two parts- two temperature transducers and an analog to digital converter.

Transducer Section (Temperature Sensor) LM 35:
+VS g VOUT


VCC                     LM35D
1—A






Transducers convert physical data such as temperature, light intensity, flow and speed to electrical signals. Depending on the transducer the output produced is in the form of voltage, current, resistance or capacitance.

The temperature transducers convert temperature into electrical parameters, e.g.: thermistor, thermocouple. A thermistor responds to temperature change by changing resistance but its response is not linear. Simple and widely used temperature sensors include the LM 34 and LM 35 series.

The LM 35 series sensors are 3 pin precision integrated circuit temperatures whose output voltage is linearly proportional to the Celsius (centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in 0 Kelvin, as the 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 ±1/4°C at room temperature and ±3/4°C over a full -55 to +150°C temperature range. It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 uA from its supply, it has very low self-heating, less than 0.1 °C in still air.


Features:
>        Calibrated directly in ° Celsius (Centigrade)
>        Linear + 10.0 mV/°C scale factor
>        Rated for full -55° to +150°C range
>        Suitable for remote applications
>        Operates from 4 to 30 volts
>        Less than 60 uA current drain




Analog to Digital Converter 0808:
Analog to digital converters are among the most widely used devices for data acquisition. Microcontrollers use binary (discrete) values, but in the physical world everything is analog (continuous). Here the output of LM 35 is an analog signal in the form of voltage. Therefore, we need an analog to digital converter to translate the analog voltage to digital form so that the microcontroller can read and process them.

An 8 Channel ADC is used since there is more than one sensor output that should be converted into digital format before feeding to the Micro Controller.


Both the sensor outputs are fed to the two different channels of ADC 0808.The channels are selected using the select pins which are controlled according to the signals from micro controller.

The ADC0808 is a monolithic CMOS device with an 8-bit Analog-to-Digital converter, 8-channel multiplexer and microprocessor compatible control logic. The 8-bit A/D converter uses successive approximation as the conversion technique. The converter features a high impedance chopper stabilized comparator, a 256R voltage divider with analog switch tree and a successive approximation register. . The 8-channel multiplexer can directly access any of 8-single-ended analog signals. The device eliminates the need for external zero and full scale adjustments. Easy interfacing to microprocessors is provided by the latched and decoded multiplexer address inputs. The ADC0808 offers high speed, high accuracy, minimal temperature dependence, excellent long-term accuracy and repeatability, and consumes minimal power. These features make this device ideally suited to applications from process and machine control to consumer and automotive applications.

In ADC 0808. Vref (+) and Vref (-) set the reference voltage. If Vref (-) = GND and Vref-(+) = 5V, the step size is 5v/256 = 19.53mv. Therefore to set a lOmv step size we need to set Vref (+) = 2.56v and Vref (-) = GND. SC is for Start Conversion. SC is the same as the WR pins in other chips. EOC is for End Of Conversion and OE is for Output Enable (READ). The EOC and OE are the same as INTR and RD pins respectively.

The ADC 0808 has no self clocking. So the clock must be provided from an external source to the CLK pin. Although the speed of conversion depends on the frequency of the clock connected to the CLK pin, it cannot be faster than lOOmicrosecs.



Features:
>       Easy interface to all microprocessors
>       8-channel multiplexer with address logic
>       OV to 5V input range with single 5V power supply
>       Outputs meet TTL voltage level specifications
>       Resolution 8 Bits
>       Single Supply 5 VDC
>       Conversion Time 100 ms

CLOCK GENERATOR:

An astable multivibrator using IC 555 is used here for providing the clock signals. The frequency of the clock signal is 500Hz. NE 555 is a timer IC configured as the frequency running oscillator provides the clock for ADC. It is basically switching circuit that has two distinct output levels. As a result the circuit continuously switches back and forth between two unstable states. In other words, circuit oscillates and output is a periodic rectangular waveform. Since neither output





state is stable, then circuit is said to be astable and is often referred to as free running or astable multivibrator.

In the circuit, the capacitor, the timing capacitor is charged towards +Vcc through Rl and R2. The charging time Tl is given as

T1=0.693(R1+R2)C1.

This is the time during which output is high. The timing capacitor CI is then discharged towards GND through the resistor R2. The discharge time T2 is gives as

T2=0.693R2.C1

This is the time during which the time is low. The period T of the oscillating clock is the sum of Tl and T2. Thus

T= Tl+T2= 0.693(R1+2R2).C1

The frequency oscillation is then found as

F=1/T=1.44/(R1+2R2)C


MICROCONTROLLER 89S51:

The AT89S51 is a low-power, high-performance CMOS 8-bit microcontroller with 4K bytes of downloadable Flash programmable and erasable read-only memory. The on-chip downloadable Flash allows the program memory to be reprogrammed In-System through an SPI serial interface or by a conventional non­volatile memory programmer. The AT89S51 provides the following standard features: 4K bytes of downloadable Flash. 128 bytes of RAM, 32 I/O lines, programmable watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port. In addition, the AT89S51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next external interrupt or hardware reset.

Features:
>       4K Bytes of In-System Reprogrammable Downloadable Flash Memory
>       4V to 6V Operating Range
>       Fully Static Operation: 0 Hz to 24 MHz
>       128 x 8-bit Internal RAM
>       32 Programmable I/O Lines
>       Three 16-bit Timer/Counters
>       SPI Serial Interface

AT 89S51 Serial Programming
The microcontroller AT 89S51 can be programmed in both serial mode and parallel mode. The Serial programming was carried out as it does not required extra burning module. The serial programming of AT 89S51 is done using the personal computer, through the printer port. The AT89S51 in its serial mode programming mode is shown in the figure.











The microcontroller AT 89S51 is serially programmed using the software ATMEL ISP Flash Programmer Version 3.0 through the printer port of the computer.

Serial Programming Algorithm
To program and verify the AT89S52 in the serial programming mode, the following sequence is recommended:
1.   Power-up sequence: Apply power between VCC and GND pins. Set RST pin to "H". If a crystal is not connected across pins XTAL1 and XTAL2, apply a 3 MHz to 33 MHz clock to XTAL1 pin and wait for at least 10 milliseconds.
2.   Enable serial programming by sending the Programming Enable serial instruction to pin MOSI/P1.5. The frequency of the shift clock supplied at pin SCK/P1.7 needs to be less than the CPU clock at XTAL1 divided by 16.
3.   The Code array is programmed one byte at a time by supplying the address and data together with the appropriate Write instruction. The write cycle is self timed and typically takes less than 1 ms at 5V.
4.   Any memory location can be verified by using the Read instruction which returns the content at the selected address at serial output MISO/P1.6.
5.   At the end of a programming session, RST can be set low to commence normal device operation.
The connection diagram with the pins of the serial port for serial programming of AT 89S51 is as shown in the figure below



LIQUID CRYSTAL DISPLAY:

Liquid state have been called the fourth state of matter(after solids, liquids and gases) because they have certain crystal properties normally found in solids, yet flow like liquids. Unlike LEDs and other electronic devices, LCDs do not generate light energy, but simply alter or control existing light to make selected areas appear bright or dark.

There are two fundamental ways in which liquid crystal are used to control properties of light and therefore after its appearance. In the dynamic scattering method, the molecules of the liquid crystal acquire a random orientation by virtue of an extremely applied electric potential. As a result light passing through the material is reflected in many different directions and has a bright frosty appearance as it emerges.
In the absorption method the molecules are oriented in such a way that then after the polarization of light passing through the material. Polarizing filters are used 2 absorb or pass the light depending on the polarization it has given, so light is visible only in those regions where it cam emerge from the filter.

In recent years, LCD is finding wide spread use of replacing LEDs. This is due to the following reasons:
1.      The declining prices of LCDs.
2.      The ability to display numbers, characteristics and graphics. This is in contrast to LEDs which are limited to numbers and a few characteristics.
3.      In corporation of a refreshing controller into the LCD, thereafter relieving the CPU of the task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep displaying the date.
4.      Ease of programming for characteristics and graphics.









The connection of LCD with microprocessor is shown in the figure.

The 8-bit data pins, D0-D7, are used to send information to the LCD or read the contents of the LCDs internal registers. To display letters and numbers, we send ASCII codes for the letters A-Z, a-z and numbers 0-9 to these pins while making RS=1( to select data registers).

There are also instruction command codes that can be sent to the LCD to clear the display or force the cursor to the home position or blink the cursor.

We also use RS=l(to select command register) to check the flag bit if the LCD is ready to receive information. The flag is D7 and can be read when R/W=l and ■ RS=0. When D7=l (flag=l), the LCD is taking care of internal operation and will not accept any new information. When D7=0, the LCD is ready to receive new information.


RS 232 INTERFACE:











„..:... + 85 v

..... -........ -3.5 V
C4'X^ 1 uF
EIA-232 Output EIA-232 Output EIA-232 input EIA-232 Input


I 15 GND
Serial port is harder to interface than parallel port. In most cases, any device you connect to serial port will need the serial transmission converted back to parallel so that it can be used. This can be done using a UART. On the software side of things, there are many more registers that you have to attend then on a standard parallel port (SPP). Serial cables can be longer than parallel cables. They also do not need as many wires as parallel transmission.

RS 232 stands for Recommended Standard 232. RS 232 is the most widely used serial I/O interfacing standard. This standard is used in PCs and numerous types of equipment.

In RS 232, a l is represented by -3 to -25V while a 0 is represented by +3 to +25V,making -3 to +3 undefined where as a serial port transmits a 0 as 0V and l as 5V. This standard was set long before the advent of the TTL family, its input and output voltage levels are not TTL compatible. For this reason to connect any RS 232 to a microcontroller system we must use voltage converts such as MAX 232 to convert the TTL logic levels to the RS 232 levels and vice versa.


MAX 232:

The 8051 has two pins that are used specifically for transferring and receiving data serially. These two pins are TxD and RxD which are TTL compatible. Therefore this requires a line driver to make their RS 232 compatible. One such line driver is the MAX 232 chip from maximum co-orperation.the MAX 232 converts from RS 232 voltage levels to TTL voltage levels and vice versa. One advantage of the MAX 232 chip is that it uses a +5V power source which is the same source voltage for the 8051. In other words with a single +5v power supplies we can power both 8051 and MAX 232, with no need for the dual power supplies that are common in many older systems.

The MAX 232 has two sets of line drivers for transferring and receiving data. The line drivers used for TxD are called Tl and T2 which the line drivers for RxD are designated as Rland R2. In many applications only one of each is used. Here also used only one set of transmitter and receiver Tl and Rl.MAX 232 requires four capacitors ranging from 1 to 22microF.the most widely used value for these capacitors is 22microF.


GSM EQUIPMENT: Introduction to GSM:
GSM (Global System for Mobile Communications) is world's most famous Mobile platform. Mobile phones with SIM cards use GSM technology to help you communicate with your family, friends and business associates.

GSM systems have following advantages over basic land line telephony systems:
1.  Mobility
2.  Easy availability
3.  High uptime
We use communication feature of Telephone landlines for internet, e-mail, data connectivity, remote monitoring, computer to computer communication, security systems. In the same way we can use GSM technology and benefit from its advantages.

Uses GSM technology for following applications:
1.    Access control devices: Access control devices can communicate with servers and security staff through SMS messaging. Complete log of transaction is available at the head-office Server instantly without any wiring involved and device can instantly alert security personnel on their mobile phone in case of any problem.
2.    Transaction terminals: EDC (Electronic Data Capturing) machines can use SMS messaging to confirm transactions from central servers. The main benefit is that central server can be anywhere in the world.
3.    Supply Chain Management: With a central server in your head office with GSM capability, you can receive instant transaction data from all your branch offices, warehouses and business associates with nil downtime and low cost.
GSM UNIT:

The GSM Modem supports popular "AT" command set so that users can develop applications quickly. The product has SIM card holder to which activated SIM card is inserted for normal use. The power to this unit can be given from UPS to provide uninterrupted operation. This product provides great feasibility for devices in remote location to stay connected which otherwise would not have been possible where telephone line do not exist.

"AT" COMMANDS:

AT commands, also called Hayes AT commands, are based on the Hayes Modem de facto standard, ATTENTION Commands for modems. They are used to communicate with your modem. These commands modify your modem's behaviour or instruct the modem to do something specific, such as dialling a telephone number. The "AT" refers to getting the Attention of your modem.

To send a command to modem, we need to start a terminal program such as Windows Hyper Terminal .No matter which terminal program you use, it should be configured to communicate with the COM port that your modem is attached to. You then type commands in the Terminal window. The modem executes the command and responds appropriately. One set of AT commands will identify your modem and version information.
Eg: -ATD [<dial_string>][;]
Dials the phone number specified in the <dial string>parameter.
INTERFACING OF GSM UNIT:
Interfacing of GSM modem is done through a serial communication link between the modem and microcontroller 89S51. Whatever data is to be sent to GSM modem is done through this RS 232 link. The different initialising signals and commands are sent as data packets.


APPLICATIONS OF GSM MODULE:

1.     Remote Condition Monitoring:

Wire free telemetry allows the early identification of a problem and can save expensive down time and repair costs. Automated data collection means the information is available at any time, any place, saving costly visits to site. In a typical remote industrial monitoring application, when perhaps a cellular solution is being used to check the status of a machine using GSM, then the use of a wireless monitor comes into its own.

2.    Data Capture for Remote People Counting:

Remote monitoring techniques used in conjunction with suitable sensors are used capture data and count people in retail outlets. By knowing how many people have entered or left each establishment then the effectiveness of sales and marketing campaigns can be monitored. When used in conjunction with RFID then the movement of staff can be monitored which is particularly appropriate in areas where there are a lot of staff and relatively few customers. By monitoring footfall remotely the data can be viewed centrally, so you could look at many stores across regions to compare effectiveness geographically.

3.    Wire Free Security Alarms:

Wire free security alarms using cable free motion detectors and GSM capable communication devices for sending text messages are well suited to building sites, temporary offices. The lack of cable means that the can be installed very quickly, location of sensors can be quickly altered to suit the changing needs of the building and alarms can be quickly and easily configured to be sent to mobile phones. The remote alarm system can also works without mains power.


POWER SUPPLY SECTION:

►f

The power section consists of a transformer, bridge rectifier and voltage regulator. This project uses a transformer of 230V ac primary to 0-9V, 1A secondary. A transformer isolates dc supply from ac main. The bridge rectifier converts AC signal into DC and is filtered using capacitor filter. Its output voltage changes when load current or line voltage varies. An electronic circuit which keeps the output voltage constant irrespective of the variation in the load current, line voltage and temperature is an electronic voltage regulator. This is added at the output of the unregulated power supply.

The voltage regulator is a circuit that provides a precision output voltage under varying load condition and possibly varying input voltage. Here we need a +5V so that the output of the filter is fed to LM 7805, a voltage regulator which gives an output voltage of +5v dc.

Voltage Regulator LM7805C:

The LM78XXC monolithic 3-terminal positive voltage regulators employ internal Current-limiting, thermal shutdown and safe-area compensation, making them essentially indestructible. If adequate heat sinking is provided, they can deliver over 1 .OA output current. They are intended as fixed voltage regulators in a wide range of applications including on-card regulation for elimination of noise and distribution problems associated with single-point regulation. In addition to use as fixed voltage regulators, these devices can be used with external components to obtain adjustable output voltages and currents.




SOURCE CODE:



/* PORT ASSFNGMENT:-
P0->LCD DATA LINES P1->ADC DATA P3.4->SELECT LINE A P3.5->SELECT LINE B P3.6->SELECT LINE C P2.5->LCD RS P2.6->LCD E P2.7->LCD R/W */

ORG 0000H AJMP 0020H; ORG 0020H
MAINE
LOC:


MOV P1.#0FFH; ACALL DISPINIT; MOV A,#80H; ACALL CWRT; ACALL DORG; MOV A,#0C0H ACALL CWRT; ACALL DORG1; ACALL ADCREAD; MOV R5,#0FFH; ACALL DELAY; MOV R5,#0FFH; ACALL DELAY; MOV R5.#0FFH; ACALL DELAY; JMP MAIN1 ;
PORT 1 AS I/P

FIRST LINE OF LCD

INITIALIZING ;SECOND LINE OF LCD











Text Box: DISPLAY ORG IN** *


Text Box: DORG:



CLR A;
MOV DPTR,#8F8H; ACALL DSEND; MOV R5,#02H;
LOADING; CALL DELAY;







Text Box: DORG1:




clr a;
mov dptr,#911h; acall dsend; ret;
load gsm temp


I* ****************** display initialisation* * *******************/

dispinit:


mov a,#38h; acall cwrt; mov a,#14h;

acall cwrt; mov a,#0ch;

acall cwrt; mov a,#01h; acall cwrt; ret;


lcd 5*7&2lines

display on curser not blink

display on curser not blink

display clear











Text Box: COMMAND WRITE TO LCD**********************/


Text Box: CWRT:



mov p0,a; clr p2.5; setb p2.6; acall sdelay; clr p2.6; acall sdelay; setb p2.6; ret;


rs->0 e->1

e->0

e->1


/********************q^'t'^ write to lcd*************************/ dwrt:
mov p0,a;
setb p2.5;                                                     rs->1
setbp2.6;                                                       e->1
acall sdelay;
clr p2.6;                                                        e->0
acall sdelay;.
setb p2.6;                                                       e->1
acall sdelay;
ret;



short delay*******************/

sdelay:
MOV r3,#10h;
LOCI:                    djnz r3,LOCl;
ret;

/*************************l)ata send to lcd**************/ dsend:
clr a;
acall sdelay; movc a,@a+dptr; cjne a,#00h,loc4; ret;

loc4:
acall dwrt; inc dptr; sjmp dsend;




delay:                              mov r4, #0ffh;
here:                  djnz r4, here;
djnz r5, delay;
ret;




adcread:
mov p1,#0ffh;                                                            port 1 as i/p
clr p3.4;
clrp3.5;                                                           add select
clr p3.6;
clr p3.7;ale
acall sdelay;
setb p3.7;
acall sdelay;
clr p3.7;
mov r5,#010h;
call delay;
mov a,p 1;                                                      reading adc
anl a,#1fh;
mov r7.a;
setb p3.5;
clr p3.7;ale
acall sdelay;
setb p3.7:
acall sdelay;
clrp3.7;
mov r5,#010h;
call delay;
mov a,p1;
anl a,#1fh;
add a,r7
rrc a;
mov r6.#030h; jc five;

carry:       mov r7,a;
clrc
subb a,#018h; jnc alarm; mov a.r7; acall conve; mov a,r0; acall dwrt; mov a,r1; acall dwrt; mov a.r2; acall dwrt; mov a,#02eh; acall dwrt;
mov a,r6;                                                       adding decimal point &
display
acall dwrt;
loc3:
                 ret;



^**si:********h<******i_jc7^ to f3CD (conversion***********************/

conve:
mov r(),#30h; mov r1,#30H; mov r2,#30h mov b,#02h; mul ab; mov b,#64h


LOC2:


DIV AB; ADD A?R0 MOV RO.A; MOV A,B; JZ LOC2; MOV B.#0AH; DIV AB; ADD A.Rl; MOV Rl.A; MOV A,B JZ LOC2; ADD A,R2; MOV R2,A; RET;





ALARM* * *************


**/



ALARM:


MOV A,#01H; ACALL CWRT; MOV R5,#02H; ACALL DELAY; MOV A,#80H; ACALL CWRT; MOV R5,#02H; ACALL DELAY; CLR A;
MOV DPTR,#91BH; ACALL DSEND; CALL SERIALROUTINE; JMP LOC3;



CALL DELAY;



CALL DELAY;




y***************** * *S£RiALROUTINE* * *******************************/

SERIALROUTINE:

UARTINIT:


MOV TMOD,#020H;#10H

MOV TH1,#0FDH MOV SCON,#050H;#10H SETB TR1 CLRTF1
MOV PCON,#070H
TIMER1 IN MODE [(ADC)JIMERO IN MODE 2(RS232) BAUD RATE SET SERIAL MODE


RUN TIMERO




• ******************************************************************!(:*


;TX_CHAR      TRANSMIT ONE CHAR. THRO' SERIAL INTERFACE ;INPUT CHAR. TO BE TRANSMITTED IN ACC.




TX CHAR:



TRANS 1:







SKIP:


HERE2:


MOV DPTR,#800H

MOV R5,#010H ACALL DELAY CLR A
MOVC A,@A+DPTR; CINE A,#00H,SKIP JMP OVE;

INC DPTR; MOV SBUF, A

JNB Tl, HERE2 CLR Tl


SKIPTX: OVE:

JMP TRANS 1; RET:





/


DATA TO BE DISPLAYED**********





ORG 800H




ORG 900H







END


DB "ATD9995238051;" DB ODH: DB 00H


DB " INITIALIZING " DB 00H;
DB "GSM TEMP:"; DB 00H;
DB "   ALARM!!!"; DB 00H;







Download full project here

More Posts

gElectron. Powered by Blogger.

Contributors

16x2 LCD Interfacing with STM32,STM32F103C6

 16x2 LCD  Interfacing with STM32,STM32F103C6 lcd_init(); LCD_LINE1; lcd_String(" GeElectron"); LCD_LINE2; lc...

Contact Form

Name

Email *

Message *

Contact us

Name

Email *

Message *

Follow Us

https://www.facebook.com/gElectron-393939667321867/ FBbox/https://www.facebook.com/IVYthemes

Comments

[blogger]

MKRdezign

Test
google.com, pub-8429441124104529, DIRECT, f08c47fec0942fa0
[blogger]

Latest

[recent][newsticker]

Technology

Top Ads

RECENT COMMENTS

Subscribe Via Email

Subscribe to our newsletter to get the latest updates to your inbox. ;-)


Your email address is safe with us!

RECENT COMMENTS