SlideShare a Scribd company logo
1
Al – Najah National University
Factually Of Engineering
Electrical Engineering Department
Monitoring and Controlling System in a Chicken
Farm
Students:
Eman Madi
Maysoon Mohanna
Supervisor :
Dr. Jamal Kharousheh.
2
Contents
Abstract…………………………………………….…4
Chapter one : Introduction
1.1 Introduction…………………………………………….5
1.2 Objectives……………………………………..................5
1.3 Where we can use this project?..........................................5
1.4 Project definitions…………………………….................6
1.4.1 Why we need SMS control system? …………….……...6
1.4.2 What is SMS ?...................................................................6
1.5 Introduction to AT commands…………...………….........8
Chapter two: Project Idea and Problem Statement
2.1 Project Idea………………………………………...…...10
2.2 Problem statement……………………………………..11
Chapter three: AT Command Test
3.1 AT Test…………………………………………….…12
3.1.1 To perform test………………………………..12
3.1.2 Sending SMS…………………………….……16
3.1.3 Receiving SMS………………………………..17
3.1.2 Reading a message…………………...……….18
Chapter four: Project Hardware and Software
4.1 Connecting mobile to PIC (16F877)…………………...20
4.2 Project Hardware…………………………….………...23
3
4.2.1 Hardware Elements……………………….…….22
4.3 Project software…………………………….…………27
4.3.1 project flow chart …..……….………….............27
4.3.2 Project Code ………………………………..….28
problems ………………………………………...…..38
Appendixes …………………………………………….. 39
References ……………………………………………….44
4
Abstract:
In our project we aim to control such place and monitor it by making
direct communication between the Mobile and Microcontroller (PIC
16F877) , in our case a chicken farm in order to help the owners to
control the farm temperature degree with respect to weather conditions,
and it can be use in security purposes such as monitor any unfamiliar
movement in the farm by using modern technologies especially SMS
technology.
In order to detect the farm temperature we will use a temperature
sensor, and for motion monitoring we will use an infra red sensor.
After we will take the signal to the PIC it will send an SMS to the
owner’s mobile who will send another SMS to determine the action that
he want such as turn on a conditioner or a fan if it is hot or turn on a
heater if it is cold .
Or turn on an alarm if anyone cut the infrared sensor.
Fig.: Project general view
5
Chapter One Introduction
1.1 Introduction:
The mobile communication is now available every where the easy with
which you can deal with mobile phone to make calls and to make SMS
made the mobile phone very popular we can also see that the SMS price is
very cheap and because of that we made our minds to co this project to
add anew dimension to the mobile phone .
Our project offers wide range of remote monitoring and controlling
actions .
Imagine you can monitor and control any place you want via SMS as
turning on fans ,heaters ,alarms ……etc .
1.2 Objectives :
1-our project aims to allow owners to monitor and control their farms or
houses devices from far places.
2-allow owners to control their farms or houses by cheap cost.
1.3 Where we canusethis project?
We can use this project in any place need to be controlled and monitored ,
such as your home, company ,farms , …….
In our case we choose the chicken farm to control and monitor it.
6
1.4 Project definitions
control system?SMSWhy we need1.4.1
SMS control system is very useful at the place we have the devices that
we need to monitor & control them from any where , such that when we
are in travel .
Monitoring & controlling device from a far location is wonderful thing
so , we enjoy in working on this project because of it is multi –
application.
This project application can be used in every home , school ,office , factory
,and any residential ,commercial ,educational and industrial building .
?SMSWhat is1.4.2
Short message service (SMS) is the ability to send & receive short
alphanumeric messages to and from mobile telephones . the first short text
message is believed to have been transferred in 1992 over signaling
channels of a European GSM network .
Since this successful trial SMS usage has been the subject of tremendous
growth .
Work on the standardization of SMS was initiated by ETSI –actually it
was created as part of the GSM phase 1 standard , and it is now being
carried out in the scope of 3GPP activities . since it is initial introduction
in GSM networks, SMS has been ported to other network technologies
such as GPRS and CDMA .
The short messages service allows users to exchange messages containing
a short amount of text –up to 160 characters .these messages can be sent
from GSM /UMTS mobile devices & also from a wide range of other
devices such as internet hosts , telex , and facsimile . the SMS is a very
mature technology supported by 100% of GSM handsets and by most
GSM networks worldwide.
7
1.4.3 Advantages and disadvantages of SMS :
 Advantages of SMS:
1-SMS allows users to directly transmit messages To each other without
operator
2- store and forward If the recipient is not available when the message
arrives the message is stored
3- when the message is sent all the delivery details and processes are
handled by the SMS center which is located at the mobile network
operators site .
4- message delivery notification User is informed that his or her message
has been delivered to the destination point .in a circuit –switched data
transmission environment a dedicated line is formed between the two
points and the user is kept apprised of the connection delivery situation.
 Disadvantages of SMS
1-limited message length
Because of the limitations associated with the MPA( mobile application
part) signal layer ,an SMS message may contain maximum 160 characters
in a GSM environment for latin characters & a max of 140 for non
latin characters
2- inflexible structure
The frame work of the SMS protocol data unit that was defined in GSM
03.40 standard is not flexible enough .data coding scheme , origination
address ,protocol identifier , and other header fields .
3- slow signal channel
Congestion in the SMS traffic may give rise to overuse .this inefficient
use makes network operator anxious about the potential service
bottlenecks.
8
4- always store & forward
In current SMS architecture all messages must pass through the SMS
center before pointing to the destination address.
1.5 Introduction to AT commands:
AT commands are instructions used to control a modem.
AT is the Abbreviation of Attention , every command line starts with
"AT" for this reason modem commands are called AT commands .
Many of the commands that are used to control wired dial-up modems
,such as:
 ATD (dial)
 ATA(answer)
 ATH(hook control)
 ATO (return to on line data state)
Are also supported by GSM/GPRS modems and mobile phones.
Besides this common AT command set , GSM/GPRS modems and mobile
phones support an AT command set that is specific to the GSM
technology ,which includes SMS -related commands .
The following table lists the AT commands that are related to the writing
and sending of SMS messages:
AT command Meaning
+CMGS Send message
+CMSS Send message from storage
+CMGW Write message to memory
+CMGD Delete message
+CMGC Send command
+CMMS More messages to send
+CMGR Read SMS messages
+CMGL list SMS messages
9
One way to send AT commands to a mobile phone or GSM/GPRS modem
is to use a terminal program. A terminal program's function is like this: It
sends the characters you typed to the mobile phone or GSM/GPRS
modem. It then displays the response it receives from the mobile phone or
GSM/GPRS modem on the screen. The terminal program on Microsoft
Windows is called HyperTerminal
10
Chapter two Project Idea and Problem Statement
2.1 Project Idea:
The goal of this project is monitoring & controlling the temperature
degree in a chicken farm by SMS from far place ,this achieved by using
two part one is serial port with mobile & temperature sensor & infra red
sensor that sense the change in degree in the farm & any unfamiliar
movement , this part can send SMS to second part which is simply mobile
tell the owner what happens to the degree if it is high or low & if there is
any unfamiliar movement this part called (sensing part) . then the owner
of the mobile decide the action to return the degree in the farm suitable by
sending SMS to the first part to make specific action like turn on fan or
heater ,& turn on alarm system this called the (controlling part ).
The following block diagram illustrate the idea :
SMS
Fig. : Basic Over view
Interfacing
Circuit .
Sensing&
monitoring
System
11
2.2 Problem statement :
To get started doing our project several points are to be determined :
1- type of GSM network :
In our project we select GSM 900 MHZ JAWWAL it is the available
one in Palestine
2- Type of mobile useable :
We decide to use Nokia 6070 mobile phone, it is support AT commands &
easy to deal with it
3- SMS Coding System:
We must know how the coding system of SMS in the network work .
4- Sensors behavior:
a- Temperature sensor:
We must learn how the sensor read the change in temperature degree &
how we can read data from it & that will explain later .
b- infrared sensor:
We must learn how the sensor sense the unfamiliar movement in the
farm & how we can read data from it & that will explain later .
12
Chapter Three AT CommandTest
We find that the PIC support the AT commands , so we decide to use
these command to program the PIC , to do so first we must test our mobile
response for this commands by the following AT test.
3.1 AT Test
After we succeed in finding the right mobile which supports the AT
commands, we started looking for it's AT command.
Fig: The mobile phone & it is serial we use
To perform test:3.1.1
To use HyperTerminal to send SMS to your mobile phone using AT
commands we follow the procedure below:
1. Connect your mobile phone to a computer by using a serial cable.
2. Run HyperTerminal by selecting Start -> Programs -> Accessories -
> Communications -> HyperTerminal.
3. In the Connection Description dialog box, enter a name and choose
an icon you like for the connection. Then click the OK button.
13
Fig.: HyperTerminal's Connection Description dialog box
4. In the Connect To dialog box, choose the COM port that your mobile
phone is connecting to in the Connect using combo box. For example,
choose COM1 if your mobile phone is connecting to the COM1 port. Then
click the OK button.
Fig. : HyperTerminal's Connect dialog box.
5. The Properties dialog box comes out. Enter the correct port settings
for your mobile phone. Then click the OK button.
In our case the baud rate to be 115200 bps ,the other parameters are :
data bits 7,parity none ,stop bits 1,fiow control none
14
Fig.: The COM properties box
6. Then go to file > properties>setting >ASCII setup> echo typed
characters locally then click the ok button.
Fig. : properties
15
Fig. : Settings
Fig. : ASCII Setup
After that the first step to start your test Type " AT " on the Hyper
Terminal , then the GSM phone " mobile" will respond with an " OK "
16
Fig. : AT Response
SendingSMS:1.23.
Fig . : Sending SMS
1- Line1:"AT" is sent to the GSM/GPRS modem to test the connection .
the GSM/GPRS modem sends back the result code "ok" (line 2), which
means the connection between the hyper terminal program & the
GSM/GPRS modem works fine .
2- Line 3: the AT command +CMGF is used to instruct the GSM/GPRS
17
modem to operate in SMS text mode . the result code "ok" is returned (line
4) , which indicates the command line "AT +CMGF=1" has been executed
successfully .
3- Line 5 and 6: the AT command +CMGS is used to send an SMS text
message to GSM/GPRS modem "0599* * * * * * " is the recipient mobile
phone number . after typing the recipient mobile phone number ,you
should press the enter button of the keyboard .
The GSM/GPRS modem will then return a prompt">" and you can start
typing the SMS text message when finished ,press ctrl+z of the keyboard
.
4- line 7: the result code "ok" indicates the execution of the AT command
+CMGS is successful.
Receiving SMS :1.33.
Fig. : Receiving SMS
1- line 1:"AT" is sent to the GSM/GPRS modem to test the connection
.the GSM/GPRS sends back the result code "ok"(line 2), which means the
18
connection between the hyper terminal program & GSM/GPRS modem
works fine .
2- line 3 :the AT command +CMGF is used to instruct the GSM/GPRS
modem to operate in SMS text mode . the result code "ok" is returned
(line4), which indicates the command line "AT+CMGF=1" has been
executed successfully
3- line 5: the AT command +CMGR is used to receive SMS text message
of the GSM/GPRS modem ."0599 * * * * * *" is the sender mobile phone
number
4- Line 6:the result code "ok" indicates the execution of the AT command
+CMGR is successful .
3.1.2 Reading a message:
The AT command responsible for this is :
AT + CMGR
Fig. :Reading Message
19
Chapter Four Project Hardware and Software
4.1 Connecting Mobileto PIC(16F877)
A microcontroller , PIC 16F877, is connecting with a RS232 transceiver
to provide a 9600 bps serial link to the Nokia 6070 mobile phone .
Fig. : Mobile To Serial
With this circuit we can monitor temperature degree and any un familiar
movement , and controlling them by sending and receiving SMS message
with any mobile phone.
4.2 Project Hardware
To perform this project we need to perform hardware which consist of
two parts .
Part One :
Part one is a monitor & sensing part that consist of
First we build the basic cct of PIC & we add to it LCD to show & notice
the commands when comes out from mobile to PIC & vise versa ,also we
add (DB9) connector to interface the mobile phone with PIC & we need
to add an interfacing to the element which we want to control like fans
,heaters …..etc .
20
Part Two :
Simply mobile phone to receive the change in degree from first part. And
to send orders to first part to control elements or machines or what we
need to control.
Fig. : Schematic Diagram
21
4.2.1 Hardware Elements:
1- Microcontroller (PIC16f877):
A microcontroller is a miniature computer . it is an integrated chip (IC)
that has a central processing unit (CPU) ,random access memory (RAM)
,read only memory (ROM) and other components that is present in a
computer. the PIC microcontroller is manufactured by microchip
technology Inc .
We choose PIC 16f877 microcontroller for the following reason :
1-it is a flash programmable device (no need for UV eraser ).
2-it has a built –in EEPROM (non- volatile memory ).
3-it is in-circuit programmable (only a small circuit needs to be built for
programming ).
4-it has support for various boot –loader .
5-it is cheap .
We use the PIC to control some external devices ,a microcontroller
executes a user program which is loaded in its program memory .in our
project we received data from sensors located in farms,
then data is sent to external output devices (mobile) in SMS form &
then it received SMS from mobile that include orders to control devices as
conditioners or heaters .
2-Voltage Regulation
The voltage regulator circuit consisted of a MC7805ACT chip
which would provide a step down from 12V to 5V , The 100 μF
Capacitor provide circuit protection.
Additionally, the module would need to provide protection against both
incorrect setup and any possible voltage spikes.
22
Fig. : Voltage Ragulator
3- Max232:
We can send and receiving data at the same time due to the lines of
sending and receiving data (full-duplex mode).
Fig. MAX 232
4- Lcd:
A liquid crystal display (LCD) is an electronically-modulated optical
device shaped into a thin, flat panel made up of any number of color or
monochrome pixels filled with liquid crystals and arrayed in front of a
light source (backlight) or reflector. It is often utilized in battery-powered
electronic devices because it uses very small amounts of electric power.
23
Fig. :LCD
5- Precision temperature sensor
The LM335 are precision temperature sensors which can be easily
calibrated. They operate as a 2-terminal Zener and the breakdown
voltage is directly proportional to the absolute temperature at
10mV/K. The circuit has a dynamic impedance of less than 1 Ω
and operates within a range of current from 450μA to 5mA
without alteration of its characteristics.
Calibrated at +25oC, the LM335 have a typical error of less
than 1oC over a 100oC temperature range. Unlike other sensors, LM335
have a linear output.
Fig. : Temperature Sensor
24
 Application Hints:
There is an easy method of calibrating the device for higher accuracies .
The single point calibration works because the output of the LM335 is
proportional to the absolute temperature with the extrapolated output of
sensor going to 0V at 0K ( –273.15oC).
 Temperature sensor calibration:
We make calibration for this sensor by building the following circuit ,
then measuring the output voltage while changing the temperature the
sensor exposure to .
Fig. : Temperature Sensor Diagram
 The practical calibration:
At 20 c° the output voltage = 2.5 V.
At 30 c° the output voltage = 3.5 V.
25
6- Infrared Sensor:
Infrared light lies between the visible and microwave portions of the
electromagnetic spectrum. Infrared light has a range of wavelengths,
just like visible light has wavelengths that range from red light to violet.
IR circuits:
This circuit has two stages: a transmitter unit and a receiver unit. The
transmitter unit consists of an infrared LED and its associated circuitry.
IR transmitter:
The transmitter circuit consists of the following components:
 IC 555
 Resistors
 Capacitors
 IR LED

The IR LED emitting infrared light is put on in the transmitting unit.
To generate IR signal, 555 IC based a stable multivibrator is used.
Infrared LED is driven through transistor BC 548.
IC 555 is used to construct an a stable multivibrator which has two
quasi-stable states. It generates a square wave of frequency 38kHz and
amplitude 5Volts. It is required to switch ‘ON’ the IR LED.
Fig :infrared transmitter cct
26
:ReceiverIR
The receiver circuit consists of the following components:
 TSOP1738 (sensor)
 IC 555
 Resistors
 Capacitors
The receiver unit consists of a sensor and its associated circuitry.
In receiver section, the first part is a sensor, which detects IR
pulses transmitted by IR-LED. Whenever a train crosses the
sensor, the output of IR sensor momentarily transits through a low
state. As a result the monostable is triggered and a short pulse is
applied to the port pin of the 8051 microcontroller. On receiving a
pulse from the sensor circuit, the controller activates the circuitry
required for closing and opening of the gates and for track
switching.
The IR receiver circuit is shown in the figure below.
Fig : infrared receiver cct
27
4.3 Project software
4.3.1 Project flow chart:
start
28
4.3.2 Project Code
#include "ADC_on_new_picc.h"
#include <LCD.C>
#include <float.h>
#include <math.h>
void SendSms;)(
void TestAdc;)(
void readSms(int x;)
void fan(int command;)
void killEcho;)(
void initRecSms;)(
void delSms (int pos;)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int i,j;
char c1,c2;
int index = 0;
char str[50;]
int flag = 5;
int pos = 0;
char number[11;]
void SendSms;)(
void delSms (int pos;)
void Fan(int command);//if command =0 turn the fan off if command =1 turn the on
int fanst = 0;///off
int x;
/////////////
float power;
float valv;
float vali;
//float Vmpp;
float max;
//float Isc;
//float Impp;
////////////
#int_AD
AD_isr)(
{
if(x==0)
{
set_adc_channel(1;)
x=1;
}
else
{
set_adc_channel(0;)
x=0;
29
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#int_RDA
RDA_isr)(
{
index = 0;
i = 0;
c1= getc;)(
if(c1)'+'==
{
disable_interrupts(INT_RDA;)
disable_interrupts(global;)
while(c1!='O)'
{
while (kbhit))(
{
c1=getc;)(
if(c1!='n'&&c1!='r)'
{
str[index]= c1;
}
if(index==16)
printf(LCD_PUTC, "n;)"
index;++
}
restart_wdt;)(
}
c1= getc;)(
pos = str[10]-'0;'
i=0;
index =0;
delay_ms(1000;)
readSms(pos;)
delay_ms(3000;)
restart_wdt;)(
while (kbhit))(
{
c1=getc;)(
i;++
if(i==100)
break;
restart_wdt;)(
}
i=0;
enable_interrupts(INT_RDA;)
enable_interrupts(global;)
//restart_wdt;)(
delSms(pos;)
30
restart_wdt;)(
}
}
void main)(
{
setup_adc_ports(AN0_AN1_AN3;)
setup_adc(ADC_CLOCK_INTERNAL;)
setup_psp(PSP_DISABLED;)
setup_spi(FALSE;)
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1;)
setup_timer_1(T1_DISABLED;)
setup_timer_2(T2_DISABLED,0,1;)
setup_comparator(NC_NC_NC_NC;)
setup_vref(FALSE;)
lcd_init;)(
initRecSms;)(
fan(0;)
enable_interrupts(INT_AD;)
enable_interrupts(INT_RDA;)
enable_interrupts(GLOBAL;)
restart_wdt;)(
printf(LCD_PUTC, "fStarting;)"........
i=0;
while(1)
{
restart_wdt;)(
}
}
void TestAdc)(
{
i=0;
while (kbhit))(
{
c1=getc;)(
i;++
if(i==100)
break;
restart_wdt;)(
}
31
max= 0.0;
power=0.0;
i=j=0;
j=15;
x=0;
set_adc_channel(0;)
enable_interrupts(INT_AD;)
enable_interrupts(global;)
///////////////
//printf(LCD_PUTC,"fstartadc;)"
while(i<15)
{
if(x==1)//ch1
{
vali =read_adc;)(
delay_ms(5;)
vali=(vali/1023.0;)
vali=vali*3;
}
if(x==0)//x=0 ch0
{
valv= read_adc;)(
delay_ms(5;)
valv=(valv/1023.0;)
valv=valv*5;
}
power=valv*vali;
if(power>max)
{
max=power;
sprintf(str,"MaxPower =%2.2f w ,volt%2.2f v,Cur%2.2f A",max,valv,vali;)
}
printf(LCD_PUTC, "fWorking..%d",j;)
i;++
j--;
delay_ms(1000;)
}
sprintf(number,"%s","0599748051;)"
SendSms;)(
//printf(LCD_PUTC,"fMAXPower=%2.1f wat",max;)
//printf(LCD_PUTC,"n End Working;)"...
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void readSms(int x)
{
32
i =0;
flag = 5;
printf("AT+CMGR=%d",x;)
PRINTF("%c",0x0D;)
PRINTF("%c",0x0B;)
c1;'!' =
c2;'!'=
printf(LCD_PUTC,"f%d",x;)
for(index = 0 ;index <50;index)++
{
str[index]= 'c;'
restart_wdt;)(
}
index =0;
while(c1!='O)'
{
while (kbhit))(
{
c1=getc;)(
if(i>61)
{
if(c1!='n'&&c1!='r)'
{
str[index]= c1;
index;++
}
restart_wdt;)(
}
i;++
restart_wdt;)(
}
restart_wdt;)(
}
c1=getc;)(
index = 0;
printf(LCD_PUTC, "f;)"
*/for(index = 0 ;index <50;index)++
{
printf(LCD_PUTC, "%c",str[index;)]
if(index==16)
33
printf(LCD_PUTC, "n;)"
restart_wdt;)(
/*}
index=0;
delay_ms(5000;)
while((index <50 )&&( flag==5))
{
//printf(LCD_PUTC, "floop%d",index;)
restart_wdt;)(
if((str[index] =='o')||(str[index] =='O))'
{
if((str[index+1] =='n')||(str[index+1] =='N))'
{
flag = 0;
break;
///}on command
else if((str[index+1] =='f')||(str[index+1] =='F))'
if((str[index+2] =='f')||(str[index+2] =='F))'
{
flag = 1;
break;
///}off command
restart_wdt;)(
}
else if((str[index] =='s')||(str[index] =='S))'
{
if((str[index+1] =='t')||(str[index+1] =='T))'
if((str[index+2] =='a')||(str[index+2] =='A))'
if((str[index+3] =='t')||(str[index+3] =='T))'
if((str[index+4] =='u')||(str[index+4] =='U))'
if((str[index+5] =='s')||(str[index+5] =='S))'
{
flag = 2;
break;
////}status command
restart_wdt;)(
}
else if((str[index] =='t')||(str[index] =='T))'
{
if((str[index+1] =='e')||(str[index+1] =='E))'
if((str[index+2] =='s')||(str[index+2] =='S))'
if((str[index+3] =='t')||(str[index+3] =='T))'
{
flag =3;
break;
34
////}status command
restart_wdt;)(
}
index;++
restart_wdt;)(
}
if(flag==0)
{
printf(LCD_PUTC, "f On Command;)"
fanst =1;///fan on
fan(1;)
}
else if(flag==1)
{
printf(LCD_PUTC, "f OFF Command;)"
fanst =0;///fan off
fan(0;)
}
else if(flag==2///////)
{
printf(LCD_PUTC, "f status Command;)"
sprintf(number,"%s","0599748051;)"
if(fanst==0)
{
sprintf(str,"%s","fan is off;)"
}
else if(fanst==1)
{
sprintf(str,"%s","fan is on;)"
}
SendSms;)(
restart_wdt;)(
}
else if(flag==3)
{
printf(LCD_PUTC, "f test Command;)"
//start testing
//fan(0;)
TestAdc;)(
restart_wdt;)(
}
35
else
printf(LCD_PUTC, "f%d Error",flag;)
restart_wdt;)(
i=0;
index = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void SendSms)(
{
PRINTF("AT+CMGF=1;)"
PRINTF("%c",0x0D;)
PRINTF("%c",0x0B;)
/////////
while( c1!='O)'
{
while ( !kbhit) )(
{
restart_wdt;)(
}
c1= getc;)(
}
c1= getc;)(
/////////
delay_ms(200;)
PRINTF("AT+CMGS="%s",129",number;)
PRINTF("%c",0x0D;)
PRINTF("%c",0x0B;)
delay_ms(200;)
PRINTF(str;)
PRINTF("%c",0x1A;)
PRINTF("%c",0x0D;)
PRINTF("%c",0x0B;)
delay_ms(200;)
i=0;
while (kbhit))(
{
c1=getc;)(
i;++
if(i==100)
break;
restart_wdt;)(
}
36
i=0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void initRecSms)(
{
printf("AT+CMGF=1;)"
PRINTF("%c",0x0D;)
PRINTF("%c",0x0B;)
while( c1!='O)'
{
while ( !kbhit) )(
{
restart_wdt;)(
}
c1= getc;)(
}
c1= getc;)(
printf(LCD_PUTC, "f1;)"
delay_ms(4000;)
printf("AT+CNMI=2,1,0,1,0;)"
PRINTF("%c",0x0D;)
PRINTF("%c",0x0B;)
while( c1!='O)'
{
while ( !kbhit) )(
{
restart_wdt;)(
}
c1= getc;)(
}
c1= getc;)(
printf(LCD_PUTC, "f 2;)"
delay_ms(1000;)
restart_wdt;)(
printf(LCD_PUTC, "f SMS init;)"
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
37
void delSms (int pos)
{
printf("AT+CMGD=%d",pos;)
PRINTF("%c",0x0D;)
PRINTF("%c",0x0B;)
while( c1!='O)'
{
while ( !kbhit) )(
{
restart_wdt;)(
}
c1= getc;)(
restart_wdt;)(
}
c1= getc;)(
printf(LCD_PUTC, "f SMS deleted;)"
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void fan(int command)
{
if(command == 1)//turn the fan on
{
output_bit( PIN_B0, 1;)
}
else if (command ==0) //turn the fan off
{
output_bit( PIN_B0, 0;)
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
38
Problems
1. It is difficult to choose the kind of temperature sensor & to find it is
correct cct that we will use it to calibrate it .
2. The connection between microcontroller (PIC) and mobile phone.
3. Programming the microcontroller (PIC).
39
Appendix
Data sheets
(PIC 16F877):icrocontrollerM
40
CD:L
PROPRTIESPIN #
DATA (D7)1
DATA(D6)2
DATA (D5)3
DATA (D4)4
DATA (D3)5
DATA (D2)6
DATA (D1)7
DATA (D0)8
ENABLE9
RS10
RB11
GROUND12,13
VCC14
41
Temperature sensor LM 335:
42
MAX 232:
ELECTRICAL CHARACTERISTICS
43
IR Sensor:
 TransmitterCircuit
 Receiver Circuit
44
References
1. Cellular Online, “Extended ETSI Hayes AT command
parameters for SMS” [Online Document], Available HTTP:
http://www.cellular.co.za/at_etsi.htm.
2. Pettersson, Lars, “SMS and the PDU Format” [Online
Document], Available HTTP:
http://www.dreamfabric.com/sms/
3. www.developershome.com/sms/howToUseHyperTerminal.asp
4. http://www.embedtronics.com/nokia/fbus.htm
5. ww1.microchip.com/downloads/en/AppNotes/21895d.pdf
6. www.circuits-lab.com
7. cognoscis.wordpress.com/.../modulated-ir-sensor/
elka.brawijaya.ac.id/.../RS232_adapter.PNG

More Related Content

What's hot

Iaetsd wireless electronic notice board using gsm
Iaetsd wireless electronic notice board using gsmIaetsd wireless electronic notice board using gsm
Iaetsd wireless electronic notice board using gsm
Iaetsd Iaetsd
 
Wireless electronic notice board using gsm technolgy
Wireless electronic notice board using gsm technolgyWireless electronic notice board using gsm technolgy
Wireless electronic notice board using gsm technolgydhanshri_deshmukh
 
GSM Based e-Notice Board
GSM Based e-Notice BoardGSM Based e-Notice Board
GSM Based e-Notice Board
Venkatesh Agnihotri
 
Project report on gsm based digital notice board
Project report on gsm based digital notice boardProject report on gsm based digital notice board
Project report on gsm based digital notice boardmanish katara
 
Gsm anti theft system
Gsm anti theft systemGsm anti theft system
Gsm anti theft systemAshu0711
 
Sms based notice board with 3 lcd
Sms based notice board with 3 lcdSms based notice board with 3 lcd
Sms based notice board with 3 lcd
Ankur Kumar
 
Gsm based-automatic-motor-control-and-protection-system(1)
Gsm based-automatic-motor-control-and-protection-system(1)Gsm based-automatic-motor-control-and-protection-system(1)
Gsm based-automatic-motor-control-and-protection-system(1)
aayushi vijh
 
Gsm based control system
Gsm based control systemGsm based control system
Gsm based control system
electronicsbaazar
 
GSM Introduction
GSM IntroductionGSM Introduction
GSM Introduction
Tempus Telcosys
 
Multiuser sms based microcontroller wireless electronic board
Multiuser sms based microcontroller wireless electronic boardMultiuser sms based microcontroller wireless electronic board
Multiuser sms based microcontroller wireless electronic board
Kalees Pandiyan
 
Agriculture field motor control system by using Global System for Mobile comm...
Agriculture field motor control system by using Global System for Mobile comm...Agriculture field motor control system by using Global System for Mobile comm...
Agriculture field motor control system by using Global System for Mobile comm...
venu452
 
Gsm overview for beginners v2
Gsm overview for beginners v2Gsm overview for beginners v2
Gsm overview for beginners v2
Assim Mubder
 
Getting Started with SainSmart SIM900 GPRS (Autosaved)
Getting Started with SainSmart SIM900 GPRS (Autosaved)Getting Started with SainSmart SIM900 GPRS (Autosaved)
Getting Started with SainSmart SIM900 GPRS (Autosaved)Devrhoid Davis
 
sms based enotice board
sms based enotice boardsms based enotice board
sms based enotice boardDinesh Kumaar
 
E notice board project report
E notice board project reportE notice board project report
E notice board project report
amit chaudhary
 
Real time tracking based on gsm and ir module for running train
Real time tracking based on gsm and ir module for running trainReal time tracking based on gsm and ir module for running train
Real time tracking based on gsm and ir module for running train
eSAT Journals
 
Industrial automation using gsm (ppt)
Industrial automation using gsm (ppt)Industrial automation using gsm (ppt)
Industrial automation using gsm (ppt)Mahira Banu
 
Rfid based traffic controller using gsm
Rfid based traffic controller using gsmRfid based traffic controller using gsm
Rfid based traffic controller using gsmramesh chatty
 
GSM based e-Notice Board
GSM based e-Notice BoardGSM based e-Notice Board
GSM based e-Notice Boardvivekranu1
 
GSM GPRS SIM900A Modem
GSM GPRS SIM900A ModemGSM GPRS SIM900A Modem
GSM GPRS SIM900A Modem
Raghav Shetty
 

What's hot (20)

Iaetsd wireless electronic notice board using gsm
Iaetsd wireless electronic notice board using gsmIaetsd wireless electronic notice board using gsm
Iaetsd wireless electronic notice board using gsm
 
Wireless electronic notice board using gsm technolgy
Wireless electronic notice board using gsm technolgyWireless electronic notice board using gsm technolgy
Wireless electronic notice board using gsm technolgy
 
GSM Based e-Notice Board
GSM Based e-Notice BoardGSM Based e-Notice Board
GSM Based e-Notice Board
 
Project report on gsm based digital notice board
Project report on gsm based digital notice boardProject report on gsm based digital notice board
Project report on gsm based digital notice board
 
Gsm anti theft system
Gsm anti theft systemGsm anti theft system
Gsm anti theft system
 
Sms based notice board with 3 lcd
Sms based notice board with 3 lcdSms based notice board with 3 lcd
Sms based notice board with 3 lcd
 
Gsm based-automatic-motor-control-and-protection-system(1)
Gsm based-automatic-motor-control-and-protection-system(1)Gsm based-automatic-motor-control-and-protection-system(1)
Gsm based-automatic-motor-control-and-protection-system(1)
 
Gsm based control system
Gsm based control systemGsm based control system
Gsm based control system
 
GSM Introduction
GSM IntroductionGSM Introduction
GSM Introduction
 
Multiuser sms based microcontroller wireless electronic board
Multiuser sms based microcontroller wireless electronic boardMultiuser sms based microcontroller wireless electronic board
Multiuser sms based microcontroller wireless electronic board
 
Agriculture field motor control system by using Global System for Mobile comm...
Agriculture field motor control system by using Global System for Mobile comm...Agriculture field motor control system by using Global System for Mobile comm...
Agriculture field motor control system by using Global System for Mobile comm...
 
Gsm overview for beginners v2
Gsm overview for beginners v2Gsm overview for beginners v2
Gsm overview for beginners v2
 
Getting Started with SainSmart SIM900 GPRS (Autosaved)
Getting Started with SainSmart SIM900 GPRS (Autosaved)Getting Started with SainSmart SIM900 GPRS (Autosaved)
Getting Started with SainSmart SIM900 GPRS (Autosaved)
 
sms based enotice board
sms based enotice boardsms based enotice board
sms based enotice board
 
E notice board project report
E notice board project reportE notice board project report
E notice board project report
 
Real time tracking based on gsm and ir module for running train
Real time tracking based on gsm and ir module for running trainReal time tracking based on gsm and ir module for running train
Real time tracking based on gsm and ir module for running train
 
Industrial automation using gsm (ppt)
Industrial automation using gsm (ppt)Industrial automation using gsm (ppt)
Industrial automation using gsm (ppt)
 
Rfid based traffic controller using gsm
Rfid based traffic controller using gsmRfid based traffic controller using gsm
Rfid based traffic controller using gsm
 
GSM based e-Notice Board
GSM based e-Notice BoardGSM based e-Notice Board
GSM based e-Notice Board
 
GSM GPRS SIM900A Modem
GSM GPRS SIM900A ModemGSM GPRS SIM900A Modem
GSM GPRS SIM900A Modem
 

Viewers also liked

A Combinatorial Approach to the Optimisation of Cd (1−x) Zn x S Layers for Cd...
A Combinatorial Approach to the Optimisation of Cd (1−x) Zn x S Layers for Cd...A Combinatorial Approach to the Optimisation of Cd (1−x) Zn x S Layers for Cd...
A Combinatorial Approach to the Optimisation of Cd (1−x) Zn x S Layers for Cd...
University of Liverpool
 
Lecture 4: Semiconductors and Recombination
Lecture 4: Semiconductors and RecombinationLecture 4: Semiconductors and Recombination
Lecture 4: Semiconductors and Recombination
University of Liverpool
 
Measuring the power output of a solar cell
Measuring the power output of a solar cellMeasuring the power output of a solar cell
Measuring the power output of a solar cell
University of Liverpool
 
A low-cost non-toxic post-growth activation step for CdTe solar cells
A low-cost non-toxic post-growth activation step for CdTe solar cellsA low-cost non-toxic post-growth activation step for CdTe solar cells
A low-cost non-toxic post-growth activation step for CdTe solar cells
University of Liverpool
 
Smart home
Smart homeSmart home
Smart home
slmnsvn
 
Optical Characterization of Inorganic Semiconductors
Optical Characterization of Inorganic SemiconductorsOptical Characterization of Inorganic Semiconductors
Optical Characterization of Inorganic Semiconductors
University of Liverpool
 
Pv i v characteristic tester(eee499.blogspot.com)
Pv i v characteristic tester(eee499.blogspot.com)Pv i v characteristic tester(eee499.blogspot.com)
Pv i v characteristic tester(eee499.blogspot.com)
slmnsvn
 
Pv i v characteristic tester(eee499.blogspot.com)
Pv i v characteristic tester(eee499.blogspot.com)Pv i v characteristic tester(eee499.blogspot.com)
Pv i v characteristic tester(eee499.blogspot.com)
slmnsvn
 
Shade Measurement Overview
Shade Measurement OverviewShade Measurement Overview
Shade Measurement Overview
phoberg
 
Photovoltaic By-Pass Diodes Simulation
Photovoltaic By-Pass Diodes SimulationPhotovoltaic By-Pass Diodes Simulation
Photovoltaic By-Pass Diodes Simulation
Tsuyoshi Horigome
 
Predicting mismatch losses in utility-scale photovoltaic systems
Predicting mismatch losses in utility-scale photovoltaic systemsPredicting mismatch losses in utility-scale photovoltaic systems
Predicting mismatch losses in utility-scale photovoltaic systems
Sandia National Laboratories: Energy & Climate: Renewables
 
A study on modelling and simulation of photovoltaic cells
A study on modelling and simulation of photovoltaic cellsA study on modelling and simulation of photovoltaic cells
A study on modelling and simulation of photovoltaic cells
eSAT Publishing House
 
Lecture 5: Junctions
Lecture 5: JunctionsLecture 5: Junctions
Lecture 5: Junctions
University of Liverpool
 
Performance analysis of stand alone ( roof top ) PV system.
Performance analysis of stand alone ( roof top ) PV system.Performance analysis of stand alone ( roof top ) PV system.
Performance analysis of stand alone ( roof top ) PV system.
Chandra Mohan Mishra
 
Lecture 6: Junction Characterisation
Lecture 6:   Junction CharacterisationLecture 6:   Junction Characterisation
Lecture 6: Junction Characterisation
University of Liverpool
 
Solar Challenge Briefing | University of Liverpool
Solar Challenge Briefing | University of LiverpoolSolar Challenge Briefing | University of Liverpool
Solar Challenge Briefing | University of Liverpool
University of Liverpool
 
The Physics of Transparent Conducting Oxides
The Physics of Transparent Conducting OxidesThe Physics of Transparent Conducting Oxides
The Physics of Transparent Conducting Oxides
University of Liverpool
 
Metal semiconductor contacts
Metal semiconductor contactsMetal semiconductor contacts
Metal semiconductor contacts
Kasif Nabi
 

Viewers also liked (20)

A Combinatorial Approach to the Optimisation of Cd (1−x) Zn x S Layers for Cd...
A Combinatorial Approach to the Optimisation of Cd (1−x) Zn x S Layers for Cd...A Combinatorial Approach to the Optimisation of Cd (1−x) Zn x S Layers for Cd...
A Combinatorial Approach to the Optimisation of Cd (1−x) Zn x S Layers for Cd...
 
Lecture 4: Semiconductors and Recombination
Lecture 4: Semiconductors and RecombinationLecture 4: Semiconductors and Recombination
Lecture 4: Semiconductors and Recombination
 
Measuring the power output of a solar cell
Measuring the power output of a solar cellMeasuring the power output of a solar cell
Measuring the power output of a solar cell
 
Lecture 4: Semiconductors and Reco
Lecture 4: Semiconductors and RecoLecture 4: Semiconductors and Reco
Lecture 4: Semiconductors and Reco
 
A low-cost non-toxic post-growth activation step for CdTe solar cells
A low-cost non-toxic post-growth activation step for CdTe solar cellsA low-cost non-toxic post-growth activation step for CdTe solar cells
A low-cost non-toxic post-growth activation step for CdTe solar cells
 
Smart home
Smart homeSmart home
Smart home
 
Optical Characterization of Inorganic Semiconductors
Optical Characterization of Inorganic SemiconductorsOptical Characterization of Inorganic Semiconductors
Optical Characterization of Inorganic Semiconductors
 
Pv i v characteristic tester(eee499.blogspot.com)
Pv i v characteristic tester(eee499.blogspot.com)Pv i v characteristic tester(eee499.blogspot.com)
Pv i v characteristic tester(eee499.blogspot.com)
 
Pv i v characteristic tester(eee499.blogspot.com)
Pv i v characteristic tester(eee499.blogspot.com)Pv i v characteristic tester(eee499.blogspot.com)
Pv i v characteristic tester(eee499.blogspot.com)
 
Shade Measurement Overview
Shade Measurement OverviewShade Measurement Overview
Shade Measurement Overview
 
Photovoltaic By-Pass Diodes Simulation
Photovoltaic By-Pass Diodes SimulationPhotovoltaic By-Pass Diodes Simulation
Photovoltaic By-Pass Diodes Simulation
 
Predicting mismatch losses in utility-scale photovoltaic systems
Predicting mismatch losses in utility-scale photovoltaic systemsPredicting mismatch losses in utility-scale photovoltaic systems
Predicting mismatch losses in utility-scale photovoltaic systems
 
A study on modelling and simulation of photovoltaic cells
A study on modelling and simulation of photovoltaic cellsA study on modelling and simulation of photovoltaic cells
A study on modelling and simulation of photovoltaic cells
 
Lecture 5: Junctions
Lecture 5: JunctionsLecture 5: Junctions
Lecture 5: Junctions
 
Performance analysis of stand alone ( roof top ) PV system.
Performance analysis of stand alone ( roof top ) PV system.Performance analysis of stand alone ( roof top ) PV system.
Performance analysis of stand alone ( roof top ) PV system.
 
Lecture 6: Junction Characterisation
Lecture 6:   Junction CharacterisationLecture 6:   Junction Characterisation
Lecture 6: Junction Characterisation
 
Solar shading and its effects
Solar shading and its effectsSolar shading and its effects
Solar shading and its effects
 
Solar Challenge Briefing | University of Liverpool
Solar Challenge Briefing | University of LiverpoolSolar Challenge Briefing | University of Liverpool
Solar Challenge Briefing | University of Liverpool
 
The Physics of Transparent Conducting Oxides
The Physics of Transparent Conducting OxidesThe Physics of Transparent Conducting Oxides
The Physics of Transparent Conducting Oxides
 
Metal semiconductor contacts
Metal semiconductor contactsMetal semiconductor contacts
Metal semiconductor contacts
 

Similar to Monitoring and controlling_system_in_a_chicken_farm(eee499.blogspot.com)

Gsm based wireless notice board Rajneesh
Gsm based wireless notice board RajneeshGsm based wireless notice board Rajneesh
Gsm based wireless notice board Rajneesh
RAJNEESH KUMAR SALGOTRA
 
Mini p gsm based display
Mini p gsm based displayMini p gsm based display
Mini p gsm based displayAshu0711
 
Anti theftsystemforvechicles1 final
Anti theftsystemforvechicles1 finalAnti theftsystemforvechicles1 final
Anti theftsystemforvechicles1 final
Ashu0711
 
Ijmsr 2016-01
Ijmsr 2016-01Ijmsr 2016-01
Ijmsr 2016-01
ijmsr
 
Project ppt
Project pptProject ppt
Project ppt
Ashu0711
 
Iirdem implementation of smart homes and industrial automation system with se...
Iirdem implementation of smart homes and industrial automation system with se...Iirdem implementation of smart homes and industrial automation system with se...
Iirdem implementation of smart homes and industrial automation system with se...
Iaetsd Iaetsd
 
Implementation Of GSM Based Fire Alarm and Protection System
Implementation Of GSM Based Fire Alarm and Protection SystemImplementation Of GSM Based Fire Alarm and Protection System
Implementation Of GSM Based Fire Alarm and Protection System
BUBT
 
GSM based Campus Display System
GSM based Campus Display SystemGSM based Campus Display System
GSM based Campus Display System
Pula Likhitha
 
SMS-SMPP-Concepts
SMS-SMPP-ConceptsSMS-SMPP-Concepts
SMS-SMPP-ConceptsDuy Do Phan
 
Monitoring and controlling_system_in_a_chicken_farm(eee499.blogspot.com)
Monitoring and controlling_system_in_a_chicken_farm(eee499.blogspot.com)Monitoring and controlling_system_in_a_chicken_farm(eee499.blogspot.com)
Monitoring and controlling_system_in_a_chicken_farm(eee499.blogspot.com)
slmnsvn
 
Advanced Automation System in Industrial Applications Using PIC Microcontrol...
Advanced Automation System in Industrial Applications Using  PIC Microcontrol...Advanced Automation System in Industrial Applications Using  PIC Microcontrol...
Advanced Automation System in Industrial Applications Using PIC Microcontrol...
IJMER
 
Yuva Home automation project
Yuva Home automation projectYuva Home automation project
Yuva Home automation project
Yuvaraja Ravi
 
Gsm ( Cdma ( Gsm )
Gsm ( Cdma ( Gsm )Gsm ( Cdma ( Gsm )
Gsm ( Cdma ( Gsm )
Karen Gilchrist
 
Vehicle Theft Intimation Using GSM
Vehicle Theft Intimation Using GSMVehicle Theft Intimation Using GSM
Vehicle Theft Intimation Using GSM
ijceronline
 
Gsm energy meter
Gsm energy meterGsm energy meter
Gsm energy meterikm104
 
Remote PC Administration Using Mobile Phone
Remote PC Administration Using Mobile PhoneRemote PC Administration Using Mobile Phone
Remote PC Administration Using Mobile Phone
Chhatrapati shivaji institute of technology, Deori
 
Design and Implementation of Vehicle Gaseous Fuel Leakage Detection System us...
Design and Implementation of Vehicle Gaseous Fuel Leakage Detection System us...Design and Implementation of Vehicle Gaseous Fuel Leakage Detection System us...
Design and Implementation of Vehicle Gaseous Fuel Leakage Detection System us...
ijsrd.com
 
Project on gsm based mobile controlling robot
Project on gsm based mobile controlling robotProject on gsm based mobile controlling robot
Project on gsm based mobile controlling robot
Anwarul Islam Mithu
 

Similar to Monitoring and controlling_system_in_a_chicken_farm(eee499.blogspot.com) (20)

Gsm based wireless notice board Rajneesh
Gsm based wireless notice board RajneeshGsm based wireless notice board Rajneesh
Gsm based wireless notice board Rajneesh
 
Mini p gsm based display
Mini p gsm based displayMini p gsm based display
Mini p gsm based display
 
01362503
0136250301362503
01362503
 
Anti theftsystemforvechicles1 final
Anti theftsystemforvechicles1 finalAnti theftsystemforvechicles1 final
Anti theftsystemforvechicles1 final
 
M05078996
M05078996M05078996
M05078996
 
Ijmsr 2016-01
Ijmsr 2016-01Ijmsr 2016-01
Ijmsr 2016-01
 
Project ppt
Project pptProject ppt
Project ppt
 
Iirdem implementation of smart homes and industrial automation system with se...
Iirdem implementation of smart homes and industrial automation system with se...Iirdem implementation of smart homes and industrial automation system with se...
Iirdem implementation of smart homes and industrial automation system with se...
 
Implementation Of GSM Based Fire Alarm and Protection System
Implementation Of GSM Based Fire Alarm and Protection SystemImplementation Of GSM Based Fire Alarm and Protection System
Implementation Of GSM Based Fire Alarm and Protection System
 
GSM based Campus Display System
GSM based Campus Display SystemGSM based Campus Display System
GSM based Campus Display System
 
SMS-SMPP-Concepts
SMS-SMPP-ConceptsSMS-SMPP-Concepts
SMS-SMPP-Concepts
 
Monitoring and controlling_system_in_a_chicken_farm(eee499.blogspot.com)
Monitoring and controlling_system_in_a_chicken_farm(eee499.blogspot.com)Monitoring and controlling_system_in_a_chicken_farm(eee499.blogspot.com)
Monitoring and controlling_system_in_a_chicken_farm(eee499.blogspot.com)
 
Advanced Automation System in Industrial Applications Using PIC Microcontrol...
Advanced Automation System in Industrial Applications Using  PIC Microcontrol...Advanced Automation System in Industrial Applications Using  PIC Microcontrol...
Advanced Automation System in Industrial Applications Using PIC Microcontrol...
 
Yuva Home automation project
Yuva Home automation projectYuva Home automation project
Yuva Home automation project
 
Gsm ( Cdma ( Gsm )
Gsm ( Cdma ( Gsm )Gsm ( Cdma ( Gsm )
Gsm ( Cdma ( Gsm )
 
Vehicle Theft Intimation Using GSM
Vehicle Theft Intimation Using GSMVehicle Theft Intimation Using GSM
Vehicle Theft Intimation Using GSM
 
Gsm energy meter
Gsm energy meterGsm energy meter
Gsm energy meter
 
Remote PC Administration Using Mobile Phone
Remote PC Administration Using Mobile PhoneRemote PC Administration Using Mobile Phone
Remote PC Administration Using Mobile Phone
 
Design and Implementation of Vehicle Gaseous Fuel Leakage Detection System us...
Design and Implementation of Vehicle Gaseous Fuel Leakage Detection System us...Design and Implementation of Vehicle Gaseous Fuel Leakage Detection System us...
Design and Implementation of Vehicle Gaseous Fuel Leakage Detection System us...
 
Project on gsm based mobile controlling robot
Project on gsm based mobile controlling robotProject on gsm based mobile controlling robot
Project on gsm based mobile controlling robot
 

More from slmnsvn

Analysis optimization and monitoring system
Analysis optimization and monitoring system Analysis optimization and monitoring system
Analysis optimization and monitoring system
slmnsvn
 
Analysis optimization and monitoring system
Analysis optimization and monitoring system Analysis optimization and monitoring system
Analysis optimization and monitoring system
slmnsvn
 
Smart fuel theft detector
Smart fuel theft detectorSmart fuel theft detector
Smart fuel theft detector
slmnsvn
 
Smart fuel theft detector
Smart fuel theft detectorSmart fuel theft detector
Smart fuel theft detector
slmnsvn
 
Rfid attendace system
Rfid attendace systemRfid attendace system
Rfid attendace system
slmnsvn
 
Quad pod transformable vehicle
Quad pod transformable vehicleQuad pod transformable vehicle
Quad pod transformable vehicle
slmnsvn
 
Quad pod transformable vehicle
Quad pod transformable vehicleQuad pod transformable vehicle
Quad pod transformable vehicle
slmnsvn
 
Power factor correction
Power factor correctionPower factor correction
Power factor correction
slmnsvn
 
Power factor correction
Power factor correctionPower factor correction
Power factor correction
slmnsvn
 
Optimum performances of ramallah
Optimum performances of ramallahOptimum performances of ramallah
Optimum performances of ramallah
slmnsvn
 
Optimum performances of ramallah
Optimum performances of ramallahOptimum performances of ramallah
Optimum performances of ramallah
slmnsvn
 
Optimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate networkOptimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate network
slmnsvn
 
Optimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate networkOptimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate network
slmnsvn
 
Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2
slmnsvn
 
Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2
slmnsvn
 
Optimum performance for aqraba electrical network
Optimum performance for aqraba electrical networkOptimum performance for aqraba electrical network
Optimum performance for aqraba electrical network
slmnsvn
 
Multi tone test
Multi tone testMulti tone test
Multi tone test
slmnsvn
 
Multi tone test
Multi tone testMulti tone test
Multi tone test
slmnsvn
 
Mini scada system for monitoring pv and wind installation in meteorology stat...
Mini scada system for monitoring pv and wind installation in meteorology stat...Mini scada system for monitoring pv and wind installation in meteorology stat...
Mini scada system for monitoring pv and wind installation in meteorology stat...
slmnsvn
 
Mini scada system for monitoring pv and wind installation in meteorology stat...
Mini scada system for monitoring pv and wind installation in meteorology stat...Mini scada system for monitoring pv and wind installation in meteorology stat...
Mini scada system for monitoring pv and wind installation in meteorology stat...
slmnsvn
 

More from slmnsvn (20)

Analysis optimization and monitoring system
Analysis optimization and monitoring system Analysis optimization and monitoring system
Analysis optimization and monitoring system
 
Analysis optimization and monitoring system
Analysis optimization and monitoring system Analysis optimization and monitoring system
Analysis optimization and monitoring system
 
Smart fuel theft detector
Smart fuel theft detectorSmart fuel theft detector
Smart fuel theft detector
 
Smart fuel theft detector
Smart fuel theft detectorSmart fuel theft detector
Smart fuel theft detector
 
Rfid attendace system
Rfid attendace systemRfid attendace system
Rfid attendace system
 
Quad pod transformable vehicle
Quad pod transformable vehicleQuad pod transformable vehicle
Quad pod transformable vehicle
 
Quad pod transformable vehicle
Quad pod transformable vehicleQuad pod transformable vehicle
Quad pod transformable vehicle
 
Power factor correction
Power factor correctionPower factor correction
Power factor correction
 
Power factor correction
Power factor correctionPower factor correction
Power factor correction
 
Optimum performances of ramallah
Optimum performances of ramallahOptimum performances of ramallah
Optimum performances of ramallah
 
Optimum performances of ramallah
Optimum performances of ramallahOptimum performances of ramallah
Optimum performances of ramallah
 
Optimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate networkOptimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate network
 
Optimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate networkOptimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate network
 
Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2
 
Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2
 
Optimum performance for aqraba electrical network
Optimum performance for aqraba electrical networkOptimum performance for aqraba electrical network
Optimum performance for aqraba electrical network
 
Multi tone test
Multi tone testMulti tone test
Multi tone test
 
Multi tone test
Multi tone testMulti tone test
Multi tone test
 
Mini scada system for monitoring pv and wind installation in meteorology stat...
Mini scada system for monitoring pv and wind installation in meteorology stat...Mini scada system for monitoring pv and wind installation in meteorology stat...
Mini scada system for monitoring pv and wind installation in meteorology stat...
 
Mini scada system for monitoring pv and wind installation in meteorology stat...
Mini scada system for monitoring pv and wind installation in meteorology stat...Mini scada system for monitoring pv and wind installation in meteorology stat...
Mini scada system for monitoring pv and wind installation in meteorology stat...
 

Recently uploaded

CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 

Recently uploaded (20)

CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 

Monitoring and controlling_system_in_a_chicken_farm(eee499.blogspot.com)

  • 1. 1 Al – Najah National University Factually Of Engineering Electrical Engineering Department Monitoring and Controlling System in a Chicken Farm Students: Eman Madi Maysoon Mohanna Supervisor : Dr. Jamal Kharousheh.
  • 2. 2 Contents Abstract…………………………………………….…4 Chapter one : Introduction 1.1 Introduction…………………………………………….5 1.2 Objectives……………………………………..................5 1.3 Where we can use this project?..........................................5 1.4 Project definitions…………………………….................6 1.4.1 Why we need SMS control system? …………….……...6 1.4.2 What is SMS ?...................................................................6 1.5 Introduction to AT commands…………...………….........8 Chapter two: Project Idea and Problem Statement 2.1 Project Idea………………………………………...…...10 2.2 Problem statement……………………………………..11 Chapter three: AT Command Test 3.1 AT Test…………………………………………….…12 3.1.1 To perform test………………………………..12 3.1.2 Sending SMS…………………………….……16 3.1.3 Receiving SMS………………………………..17 3.1.2 Reading a message…………………...……….18 Chapter four: Project Hardware and Software 4.1 Connecting mobile to PIC (16F877)…………………...20 4.2 Project Hardware…………………………….………...23
  • 3. 3 4.2.1 Hardware Elements……………………….…….22 4.3 Project software…………………………….…………27 4.3.1 project flow chart …..……….………….............27 4.3.2 Project Code ………………………………..….28 problems ………………………………………...…..38 Appendixes …………………………………………….. 39 References ……………………………………………….44
  • 4. 4 Abstract: In our project we aim to control such place and monitor it by making direct communication between the Mobile and Microcontroller (PIC 16F877) , in our case a chicken farm in order to help the owners to control the farm temperature degree with respect to weather conditions, and it can be use in security purposes such as monitor any unfamiliar movement in the farm by using modern technologies especially SMS technology. In order to detect the farm temperature we will use a temperature sensor, and for motion monitoring we will use an infra red sensor. After we will take the signal to the PIC it will send an SMS to the owner’s mobile who will send another SMS to determine the action that he want such as turn on a conditioner or a fan if it is hot or turn on a heater if it is cold . Or turn on an alarm if anyone cut the infrared sensor. Fig.: Project general view
  • 5. 5 Chapter One Introduction 1.1 Introduction: The mobile communication is now available every where the easy with which you can deal with mobile phone to make calls and to make SMS made the mobile phone very popular we can also see that the SMS price is very cheap and because of that we made our minds to co this project to add anew dimension to the mobile phone . Our project offers wide range of remote monitoring and controlling actions . Imagine you can monitor and control any place you want via SMS as turning on fans ,heaters ,alarms ……etc . 1.2 Objectives : 1-our project aims to allow owners to monitor and control their farms or houses devices from far places. 2-allow owners to control their farms or houses by cheap cost. 1.3 Where we canusethis project? We can use this project in any place need to be controlled and monitored , such as your home, company ,farms , ……. In our case we choose the chicken farm to control and monitor it.
  • 6. 6 1.4 Project definitions control system?SMSWhy we need1.4.1 SMS control system is very useful at the place we have the devices that we need to monitor & control them from any where , such that when we are in travel . Monitoring & controlling device from a far location is wonderful thing so , we enjoy in working on this project because of it is multi – application. This project application can be used in every home , school ,office , factory ,and any residential ,commercial ,educational and industrial building . ?SMSWhat is1.4.2 Short message service (SMS) is the ability to send & receive short alphanumeric messages to and from mobile telephones . the first short text message is believed to have been transferred in 1992 over signaling channels of a European GSM network . Since this successful trial SMS usage has been the subject of tremendous growth . Work on the standardization of SMS was initiated by ETSI –actually it was created as part of the GSM phase 1 standard , and it is now being carried out in the scope of 3GPP activities . since it is initial introduction in GSM networks, SMS has been ported to other network technologies such as GPRS and CDMA . The short messages service allows users to exchange messages containing a short amount of text –up to 160 characters .these messages can be sent from GSM /UMTS mobile devices & also from a wide range of other devices such as internet hosts , telex , and facsimile . the SMS is a very mature technology supported by 100% of GSM handsets and by most GSM networks worldwide.
  • 7. 7 1.4.3 Advantages and disadvantages of SMS :  Advantages of SMS: 1-SMS allows users to directly transmit messages To each other without operator 2- store and forward If the recipient is not available when the message arrives the message is stored 3- when the message is sent all the delivery details and processes are handled by the SMS center which is located at the mobile network operators site . 4- message delivery notification User is informed that his or her message has been delivered to the destination point .in a circuit –switched data transmission environment a dedicated line is formed between the two points and the user is kept apprised of the connection delivery situation.  Disadvantages of SMS 1-limited message length Because of the limitations associated with the MPA( mobile application part) signal layer ,an SMS message may contain maximum 160 characters in a GSM environment for latin characters & a max of 140 for non latin characters 2- inflexible structure The frame work of the SMS protocol data unit that was defined in GSM 03.40 standard is not flexible enough .data coding scheme , origination address ,protocol identifier , and other header fields . 3- slow signal channel Congestion in the SMS traffic may give rise to overuse .this inefficient use makes network operator anxious about the potential service bottlenecks.
  • 8. 8 4- always store & forward In current SMS architecture all messages must pass through the SMS center before pointing to the destination address. 1.5 Introduction to AT commands: AT commands are instructions used to control a modem. AT is the Abbreviation of Attention , every command line starts with "AT" for this reason modem commands are called AT commands . Many of the commands that are used to control wired dial-up modems ,such as:  ATD (dial)  ATA(answer)  ATH(hook control)  ATO (return to on line data state) Are also supported by GSM/GPRS modems and mobile phones. Besides this common AT command set , GSM/GPRS modems and mobile phones support an AT command set that is specific to the GSM technology ,which includes SMS -related commands . The following table lists the AT commands that are related to the writing and sending of SMS messages: AT command Meaning +CMGS Send message +CMSS Send message from storage +CMGW Write message to memory +CMGD Delete message +CMGC Send command +CMMS More messages to send +CMGR Read SMS messages +CMGL list SMS messages
  • 9. 9 One way to send AT commands to a mobile phone or GSM/GPRS modem is to use a terminal program. A terminal program's function is like this: It sends the characters you typed to the mobile phone or GSM/GPRS modem. It then displays the response it receives from the mobile phone or GSM/GPRS modem on the screen. The terminal program on Microsoft Windows is called HyperTerminal
  • 10. 10 Chapter two Project Idea and Problem Statement 2.1 Project Idea: The goal of this project is monitoring & controlling the temperature degree in a chicken farm by SMS from far place ,this achieved by using two part one is serial port with mobile & temperature sensor & infra red sensor that sense the change in degree in the farm & any unfamiliar movement , this part can send SMS to second part which is simply mobile tell the owner what happens to the degree if it is high or low & if there is any unfamiliar movement this part called (sensing part) . then the owner of the mobile decide the action to return the degree in the farm suitable by sending SMS to the first part to make specific action like turn on fan or heater ,& turn on alarm system this called the (controlling part ). The following block diagram illustrate the idea : SMS Fig. : Basic Over view Interfacing Circuit . Sensing& monitoring System
  • 11. 11 2.2 Problem statement : To get started doing our project several points are to be determined : 1- type of GSM network : In our project we select GSM 900 MHZ JAWWAL it is the available one in Palestine 2- Type of mobile useable : We decide to use Nokia 6070 mobile phone, it is support AT commands & easy to deal with it 3- SMS Coding System: We must know how the coding system of SMS in the network work . 4- Sensors behavior: a- Temperature sensor: We must learn how the sensor read the change in temperature degree & how we can read data from it & that will explain later . b- infrared sensor: We must learn how the sensor sense the unfamiliar movement in the farm & how we can read data from it & that will explain later .
  • 12. 12 Chapter Three AT CommandTest We find that the PIC support the AT commands , so we decide to use these command to program the PIC , to do so first we must test our mobile response for this commands by the following AT test. 3.1 AT Test After we succeed in finding the right mobile which supports the AT commands, we started looking for it's AT command. Fig: The mobile phone & it is serial we use To perform test:3.1.1 To use HyperTerminal to send SMS to your mobile phone using AT commands we follow the procedure below: 1. Connect your mobile phone to a computer by using a serial cable. 2. Run HyperTerminal by selecting Start -> Programs -> Accessories - > Communications -> HyperTerminal. 3. In the Connection Description dialog box, enter a name and choose an icon you like for the connection. Then click the OK button.
  • 13. 13 Fig.: HyperTerminal's Connection Description dialog box 4. In the Connect To dialog box, choose the COM port that your mobile phone is connecting to in the Connect using combo box. For example, choose COM1 if your mobile phone is connecting to the COM1 port. Then click the OK button. Fig. : HyperTerminal's Connect dialog box. 5. The Properties dialog box comes out. Enter the correct port settings for your mobile phone. Then click the OK button. In our case the baud rate to be 115200 bps ,the other parameters are : data bits 7,parity none ,stop bits 1,fiow control none
  • 14. 14 Fig.: The COM properties box 6. Then go to file > properties>setting >ASCII setup> echo typed characters locally then click the ok button. Fig. : properties
  • 15. 15 Fig. : Settings Fig. : ASCII Setup After that the first step to start your test Type " AT " on the Hyper Terminal , then the GSM phone " mobile" will respond with an " OK "
  • 16. 16 Fig. : AT Response SendingSMS:1.23. Fig . : Sending SMS 1- Line1:"AT" is sent to the GSM/GPRS modem to test the connection . the GSM/GPRS modem sends back the result code "ok" (line 2), which means the connection between the hyper terminal program & the GSM/GPRS modem works fine . 2- Line 3: the AT command +CMGF is used to instruct the GSM/GPRS
  • 17. 17 modem to operate in SMS text mode . the result code "ok" is returned (line 4) , which indicates the command line "AT +CMGF=1" has been executed successfully . 3- Line 5 and 6: the AT command +CMGS is used to send an SMS text message to GSM/GPRS modem "0599* * * * * * " is the recipient mobile phone number . after typing the recipient mobile phone number ,you should press the enter button of the keyboard . The GSM/GPRS modem will then return a prompt">" and you can start typing the SMS text message when finished ,press ctrl+z of the keyboard . 4- line 7: the result code "ok" indicates the execution of the AT command +CMGS is successful. Receiving SMS :1.33. Fig. : Receiving SMS 1- line 1:"AT" is sent to the GSM/GPRS modem to test the connection .the GSM/GPRS sends back the result code "ok"(line 2), which means the
  • 18. 18 connection between the hyper terminal program & GSM/GPRS modem works fine . 2- line 3 :the AT command +CMGF is used to instruct the GSM/GPRS modem to operate in SMS text mode . the result code "ok" is returned (line4), which indicates the command line "AT+CMGF=1" has been executed successfully 3- line 5: the AT command +CMGR is used to receive SMS text message of the GSM/GPRS modem ."0599 * * * * * *" is the sender mobile phone number 4- Line 6:the result code "ok" indicates the execution of the AT command +CMGR is successful . 3.1.2 Reading a message: The AT command responsible for this is : AT + CMGR Fig. :Reading Message
  • 19. 19 Chapter Four Project Hardware and Software 4.1 Connecting Mobileto PIC(16F877) A microcontroller , PIC 16F877, is connecting with a RS232 transceiver to provide a 9600 bps serial link to the Nokia 6070 mobile phone . Fig. : Mobile To Serial With this circuit we can monitor temperature degree and any un familiar movement , and controlling them by sending and receiving SMS message with any mobile phone. 4.2 Project Hardware To perform this project we need to perform hardware which consist of two parts . Part One : Part one is a monitor & sensing part that consist of First we build the basic cct of PIC & we add to it LCD to show & notice the commands when comes out from mobile to PIC & vise versa ,also we add (DB9) connector to interface the mobile phone with PIC & we need to add an interfacing to the element which we want to control like fans ,heaters …..etc .
  • 20. 20 Part Two : Simply mobile phone to receive the change in degree from first part. And to send orders to first part to control elements or machines or what we need to control. Fig. : Schematic Diagram
  • 21. 21 4.2.1 Hardware Elements: 1- Microcontroller (PIC16f877): A microcontroller is a miniature computer . it is an integrated chip (IC) that has a central processing unit (CPU) ,random access memory (RAM) ,read only memory (ROM) and other components that is present in a computer. the PIC microcontroller is manufactured by microchip technology Inc . We choose PIC 16f877 microcontroller for the following reason : 1-it is a flash programmable device (no need for UV eraser ). 2-it has a built –in EEPROM (non- volatile memory ). 3-it is in-circuit programmable (only a small circuit needs to be built for programming ). 4-it has support for various boot –loader . 5-it is cheap . We use the PIC to control some external devices ,a microcontroller executes a user program which is loaded in its program memory .in our project we received data from sensors located in farms, then data is sent to external output devices (mobile) in SMS form & then it received SMS from mobile that include orders to control devices as conditioners or heaters . 2-Voltage Regulation The voltage regulator circuit consisted of a MC7805ACT chip which would provide a step down from 12V to 5V , The 100 μF Capacitor provide circuit protection. Additionally, the module would need to provide protection against both incorrect setup and any possible voltage spikes.
  • 22. 22 Fig. : Voltage Ragulator 3- Max232: We can send and receiving data at the same time due to the lines of sending and receiving data (full-duplex mode). Fig. MAX 232 4- Lcd: A liquid crystal display (LCD) is an electronically-modulated optical device shaped into a thin, flat panel made up of any number of color or monochrome pixels filled with liquid crystals and arrayed in front of a light source (backlight) or reflector. It is often utilized in battery-powered electronic devices because it uses very small amounts of electric power.
  • 23. 23 Fig. :LCD 5- Precision temperature sensor The LM335 are precision temperature sensors which can be easily calibrated. They operate as a 2-terminal Zener and the breakdown voltage is directly proportional to the absolute temperature at 10mV/K. The circuit has a dynamic impedance of less than 1 Ω and operates within a range of current from 450μA to 5mA without alteration of its characteristics. Calibrated at +25oC, the LM335 have a typical error of less than 1oC over a 100oC temperature range. Unlike other sensors, LM335 have a linear output. Fig. : Temperature Sensor
  • 24. 24  Application Hints: There is an easy method of calibrating the device for higher accuracies . The single point calibration works because the output of the LM335 is proportional to the absolute temperature with the extrapolated output of sensor going to 0V at 0K ( –273.15oC).  Temperature sensor calibration: We make calibration for this sensor by building the following circuit , then measuring the output voltage while changing the temperature the sensor exposure to . Fig. : Temperature Sensor Diagram  The practical calibration: At 20 c° the output voltage = 2.5 V. At 30 c° the output voltage = 3.5 V.
  • 25. 25 6- Infrared Sensor: Infrared light lies between the visible and microwave portions of the electromagnetic spectrum. Infrared light has a range of wavelengths, just like visible light has wavelengths that range from red light to violet. IR circuits: This circuit has two stages: a transmitter unit and a receiver unit. The transmitter unit consists of an infrared LED and its associated circuitry. IR transmitter: The transmitter circuit consists of the following components:  IC 555  Resistors  Capacitors  IR LED  The IR LED emitting infrared light is put on in the transmitting unit. To generate IR signal, 555 IC based a stable multivibrator is used. Infrared LED is driven through transistor BC 548. IC 555 is used to construct an a stable multivibrator which has two quasi-stable states. It generates a square wave of frequency 38kHz and amplitude 5Volts. It is required to switch ‘ON’ the IR LED. Fig :infrared transmitter cct
  • 26. 26 :ReceiverIR The receiver circuit consists of the following components:  TSOP1738 (sensor)  IC 555  Resistors  Capacitors The receiver unit consists of a sensor and its associated circuitry. In receiver section, the first part is a sensor, which detects IR pulses transmitted by IR-LED. Whenever a train crosses the sensor, the output of IR sensor momentarily transits through a low state. As a result the monostable is triggered and a short pulse is applied to the port pin of the 8051 microcontroller. On receiving a pulse from the sensor circuit, the controller activates the circuitry required for closing and opening of the gates and for track switching. The IR receiver circuit is shown in the figure below. Fig : infrared receiver cct
  • 27. 27 4.3 Project software 4.3.1 Project flow chart: start
  • 28. 28 4.3.2 Project Code #include "ADC_on_new_picc.h" #include <LCD.C> #include <float.h> #include <math.h> void SendSms;)( void TestAdc;)( void readSms(int x;) void fan(int command;) void killEcho;)( void initRecSms;)( void delSms (int pos;) //////////////////////////////////////////////////////////////////////////////////////////////////////////////// int i,j; char c1,c2; int index = 0; char str[50;] int flag = 5; int pos = 0; char number[11;] void SendSms;)( void delSms (int pos;) void Fan(int command);//if command =0 turn the fan off if command =1 turn the on int fanst = 0;///off int x; ///////////// float power; float valv; float vali; //float Vmpp; float max; //float Isc; //float Impp; //////////// #int_AD AD_isr)( { if(x==0) { set_adc_channel(1;) x=1; } else { set_adc_channel(0;) x=0;
  • 29. 29 } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////// #int_RDA RDA_isr)( { index = 0; i = 0; c1= getc;)( if(c1)'+'== { disable_interrupts(INT_RDA;) disable_interrupts(global;) while(c1!='O)' { while (kbhit))( { c1=getc;)( if(c1!='n'&&c1!='r)' { str[index]= c1; } if(index==16) printf(LCD_PUTC, "n;)" index;++ } restart_wdt;)( } c1= getc;)( pos = str[10]-'0;' i=0; index =0; delay_ms(1000;) readSms(pos;) delay_ms(3000;) restart_wdt;)( while (kbhit))( { c1=getc;)( i;++ if(i==100) break; restart_wdt;)( } i=0; enable_interrupts(INT_RDA;) enable_interrupts(global;) //restart_wdt;)( delSms(pos;)
  • 31. 31 max= 0.0; power=0.0; i=j=0; j=15; x=0; set_adc_channel(0;) enable_interrupts(INT_AD;) enable_interrupts(global;) /////////////// //printf(LCD_PUTC,"fstartadc;)" while(i<15) { if(x==1)//ch1 { vali =read_adc;)( delay_ms(5;) vali=(vali/1023.0;) vali=vali*3; } if(x==0)//x=0 ch0 { valv= read_adc;)( delay_ms(5;) valv=(valv/1023.0;) valv=valv*5; } power=valv*vali; if(power>max) { max=power; sprintf(str,"MaxPower =%2.2f w ,volt%2.2f v,Cur%2.2f A",max,valv,vali;) } printf(LCD_PUTC, "fWorking..%d",j;) i;++ j--; delay_ms(1000;) } sprintf(number,"%s","0599748051;)" SendSms;)( //printf(LCD_PUTC,"fMAXPower=%2.1f wat",max;) //printf(LCD_PUTC,"n End Working;)"... } //////////////////////////////////////////////////////////////////////////////////////////////////////////////// void readSms(int x) {
  • 32. 32 i =0; flag = 5; printf("AT+CMGR=%d",x;) PRINTF("%c",0x0D;) PRINTF("%c",0x0B;) c1;'!' = c2;'!'= printf(LCD_PUTC,"f%d",x;) for(index = 0 ;index <50;index)++ { str[index]= 'c;' restart_wdt;)( } index =0; while(c1!='O)' { while (kbhit))( { c1=getc;)( if(i>61) { if(c1!='n'&&c1!='r)' { str[index]= c1; index;++ } restart_wdt;)( } i;++ restart_wdt;)( } restart_wdt;)( } c1=getc;)( index = 0; printf(LCD_PUTC, "f;)" */for(index = 0 ;index <50;index)++ { printf(LCD_PUTC, "%c",str[index;)] if(index==16)
  • 33. 33 printf(LCD_PUTC, "n;)" restart_wdt;)( /*} index=0; delay_ms(5000;) while((index <50 )&&( flag==5)) { //printf(LCD_PUTC, "floop%d",index;) restart_wdt;)( if((str[index] =='o')||(str[index] =='O))' { if((str[index+1] =='n')||(str[index+1] =='N))' { flag = 0; break; ///}on command else if((str[index+1] =='f')||(str[index+1] =='F))' if((str[index+2] =='f')||(str[index+2] =='F))' { flag = 1; break; ///}off command restart_wdt;)( } else if((str[index] =='s')||(str[index] =='S))' { if((str[index+1] =='t')||(str[index+1] =='T))' if((str[index+2] =='a')||(str[index+2] =='A))' if((str[index+3] =='t')||(str[index+3] =='T))' if((str[index+4] =='u')||(str[index+4] =='U))' if((str[index+5] =='s')||(str[index+5] =='S))' { flag = 2; break; ////}status command restart_wdt;)( } else if((str[index] =='t')||(str[index] =='T))' { if((str[index+1] =='e')||(str[index+1] =='E))' if((str[index+2] =='s')||(str[index+2] =='S))' if((str[index+3] =='t')||(str[index+3] =='T))' { flag =3; break;
  • 34. 34 ////}status command restart_wdt;)( } index;++ restart_wdt;)( } if(flag==0) { printf(LCD_PUTC, "f On Command;)" fanst =1;///fan on fan(1;) } else if(flag==1) { printf(LCD_PUTC, "f OFF Command;)" fanst =0;///fan off fan(0;) } else if(flag==2///////) { printf(LCD_PUTC, "f status Command;)" sprintf(number,"%s","0599748051;)" if(fanst==0) { sprintf(str,"%s","fan is off;)" } else if(fanst==1) { sprintf(str,"%s","fan is on;)" } SendSms;)( restart_wdt;)( } else if(flag==3) { printf(LCD_PUTC, "f test Command;)" //start testing //fan(0;) TestAdc;)( restart_wdt;)( }
  • 35. 35 else printf(LCD_PUTC, "f%d Error",flag;) restart_wdt;)( i=0; index = 0; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////// void SendSms)( { PRINTF("AT+CMGF=1;)" PRINTF("%c",0x0D;) PRINTF("%c",0x0B;) ///////// while( c1!='O)' { while ( !kbhit) )( { restart_wdt;)( } c1= getc;)( } c1= getc;)( ///////// delay_ms(200;) PRINTF("AT+CMGS="%s",129",number;) PRINTF("%c",0x0D;) PRINTF("%c",0x0B;) delay_ms(200;) PRINTF(str;) PRINTF("%c",0x1A;) PRINTF("%c",0x0D;) PRINTF("%c",0x0B;) delay_ms(200;) i=0; while (kbhit))( { c1=getc;)( i;++ if(i==100) break; restart_wdt;)( }
  • 36. 36 i=0; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////// void initRecSms)( { printf("AT+CMGF=1;)" PRINTF("%c",0x0D;) PRINTF("%c",0x0B;) while( c1!='O)' { while ( !kbhit) )( { restart_wdt;)( } c1= getc;)( } c1= getc;)( printf(LCD_PUTC, "f1;)" delay_ms(4000;) printf("AT+CNMI=2,1,0,1,0;)" PRINTF("%c",0x0D;) PRINTF("%c",0x0B;) while( c1!='O)' { while ( !kbhit) )( { restart_wdt;)( } c1= getc;)( } c1= getc;)( printf(LCD_PUTC, "f 2;)" delay_ms(1000;) restart_wdt;)( printf(LCD_PUTC, "f SMS init;)" } //////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  • 37. 37 void delSms (int pos) { printf("AT+CMGD=%d",pos;) PRINTF("%c",0x0D;) PRINTF("%c",0x0B;) while( c1!='O)' { while ( !kbhit) )( { restart_wdt;)( } c1= getc;)( restart_wdt;)( } c1= getc;)( printf(LCD_PUTC, "f SMS deleted;)" } //////////////////////////////////////////////////////////////////////////////////////////////////////////////// void fan(int command) { if(command == 1)//turn the fan on { output_bit( PIN_B0, 1;) } else if (command ==0) //turn the fan off { output_bit( PIN_B0, 0;) } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  • 38. 38 Problems 1. It is difficult to choose the kind of temperature sensor & to find it is correct cct that we will use it to calibrate it . 2. The connection between microcontroller (PIC) and mobile phone. 3. Programming the microcontroller (PIC).
  • 40. 40 CD:L PROPRTIESPIN # DATA (D7)1 DATA(D6)2 DATA (D5)3 DATA (D4)4 DATA (D3)5 DATA (D2)6 DATA (D1)7 DATA (D0)8 ENABLE9 RS10 RB11 GROUND12,13 VCC14
  • 44. 44 References 1. Cellular Online, “Extended ETSI Hayes AT command parameters for SMS” [Online Document], Available HTTP: http://www.cellular.co.za/at_etsi.htm. 2. Pettersson, Lars, “SMS and the PDU Format” [Online Document], Available HTTP: http://www.dreamfabric.com/sms/ 3. www.developershome.com/sms/howToUseHyperTerminal.asp 4. http://www.embedtronics.com/nokia/fbus.htm 5. ww1.microchip.com/downloads/en/AppNotes/21895d.pdf 6. www.circuits-lab.com 7. cognoscis.wordpress.com/.../modulated-ir-sensor/ elka.brawijaya.ac.id/.../RS232_adapter.PNG