nguyn.minhkhue

New Member

Download miễn phí Remote control and monitoring system via sms and internet





However, this software not only be used to send/ receive data, but it is also
improved to process command and connect to the board. The synchronous speed is
115200 bps. In addition, we only setup this programon remote PC, then we can use
Yahoo Messenger program on some PC to connect to remote PC and send device
control command. To do that, we open a chat window from YM and send a message
which contains standard control commands (ex: D01: ON#, Reload#.) to Yahoo id
signed in to program put in remote PC.



Để tải bản Đầy Đủ của tài liệu, xin Trả lời bài viết này, Mods sẽ gửi Link download cho bạn sớm nhất qua hòm tin nhắn.
Ai cần download tài liệu gì mà không tìm thấy ở đây, thì đăng yêu cầu down tại đây nhé:
Nhận download tài liệu miễn phí

Tóm tắt nội dung tài liệu:

1
HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY
FACULTY OF ELECTICAL – ELECTRONICS ENGINEERING
DEPARTMENT OF TELECOMMUNICATION
PFIEV PROGRAM
---------------o0o---------------
GRADUATION THESIS
REMOTE CONTROL AND
MONITORING SYSTEM VIA SMS AND
INTERNET
Instructor: PhD. Hoang Dinh Chien
Student: Le Phuc Hoang
Student: Phan Tuan Duong
HCM, July 2009
2
Abstract
This thesis consists of five parts. In the first part, we present block diagram of control
circuits and models connection to connect these circuits with computer at the
processing center through infrastructure mobile network or internet network.
Programming algorithms for the microcontrollers in these circuits will be presented in
Part II. The most important part, communicating with the phone (PC vs. Phone,
Microcontroller vs. Phone), to access reality through infrastructure
telecommunications network is presented in part III. Part IV will present more details
about connection in the system as in UART connection, RF connection, internet
connection (using Yahoo server or TCP socket). Chapter five will present results and
discussion.
I .Circuit block and model connection
1.1 Main circuit block diagram
[1]Microcontroller
PIC16F877A
[7]
RS232
[2] LCD
Display
[8] Power
[5] Relay block
[3] Receive
RF block
[4]Sensors block
(thermal, pH..)
[6] Switch
block
[9] PC
[10] Extension circuit
Main circuit
[11]
Phone
3
- The most important block in this circuit is [1] Microcontroller PIC16F877A (PIC),
coordinating activities of the remaining (control display ASCII characters on the LCD
display [1], the control switch (relay) [5], control serial communication via RS232[7],
process signals from the sensor block [4], and encode and decode for the RF link [3]
This block is similarly to the block of the main circuit, but there is no switch block
circuit. We can use this circuit independently with the main circuit, and the structure
of the sensor block (*) may be changed to connect with different sensors
1.2 The most simple connection model
Microcontroller
PIC16F877
RS23
2
LCD display
Power
Relay block
[3] Receive RF block
PC/
Main
circuit
(*) Sensor block
(thermal, pH…)
Extension
circuit
Phone
4
Center PC connects with a cell phone (Home Mobile). Home Mobile will send
message containing commands (SMS) to Remote Mobile. Remote Mobile is a cell
phone connected with the board having sensors. This board collects parameters from
sensor, then transfers to Remote Mobile and Remote Mobile sends SMS containing
these parameters to Home Mobile. At home, Center PC reads SMS from Home
Mobile and processes data.
Center PC Home
Mobile
Remote
Mobile
Sensor
Cell phone network
5
1.3 The model connection with extended circuit using transmitter and receiver RF
modules or RS232
The blocks “Extended Remote Sensor1” and “Extended Remote Sensor2” are
extended blocks to enlarge the system. The details of RF link and RS232 link (UART
link) will be presented in Part IV.
Data from sensors in the block [1], [2], [3] will be send to center by remote mobile.
The SMS message received at Home Mobile will be processed by PC (storage and
graph)
Remote Center
Sensor [1]
Extended
Remote
Sensor1 [3]
PC
Remote mobile
Home Mobile
Extended Remote
sensor2 [2]
RF
RS232
6
1.4 Model connection for collecting data from remote sensor using internet
Target of this model: Saving cost for region which have internet
1.5 Replaced model for remote region while don’t have internet, but covered by
mobile network
Home
PC
Internet
Remote PC
Remote
Center
Sensor
Extended
Remote
Sensor1
Extended
Remote
Sensor2
Mobile
GPRS
Home
PC
Internet
Remote PC Remote
Center
Sensor
Extended
Remote
Sensor1
Extended
Remote
Sensor2
RS232
RS232
RS232
7
This model using GPRS (2G) network for connection sensors from remote area to
center
II. Algorithms for programming microcontroller in the board (center
board and extension board)
2.1 Center Board
We use model connection in section 1.4 for programming microcontroller in center
board (Because this is the most complicated model connection)
Start
Have RF
signal?
Save received
characters to
RF buffer
Process UART
buffer [a], and
delete it
RF frame is
completed?
-Process RF
buffer
And delete it
No
No
Yes
Yes
8
Processing data in buffer RF (block ), buffer UART (block [a]).It means detach
data bytes in them, and save to third Buffer. After that waiting for certain time, or
trigger event caused by center (such as calling signal or arrival message signal from
center), to transmit data in that buffer to center by SMS
2.2 Extended circuit for main circuit
III. Protocols for connecting cell phone to PC or microcontroller
We use two types of protocol in this thesis, AT command and FBUS
protocol
Collecting data
from sensors and
save to buffer
Have
trigger
event?
Send data in buffer to
Board center (center circuit)
Start
Yes
No
9
3.1 AT command
3.1.1 Some single AT commands used in communication with the cell phone
at+cbc? Get information about the pin status, to know when to cover the pin
at+gmm? Get information about your phone model, to select the appropriate AT
command set
at+cgmi? Get information about device‘s manufacturer
at+csq? Get information about the strength interference
at+cusd=1,"*101#" Get information about the amount in the account of SIM, for
the should recharge the SIM
at+csca? Retrieved number message center, used to sending message process
at+cpbr=1,25 Used to read the telephone directory from 1 to position 25
3.1.2 The combination of AT commands
- Combination of AT commands to read the last message in the device
at+cpms=”me” After this command we know the number of messages (X) have in the
phone
at+cmgf=1 Specify the message read in text format ( at+cmgf=0, PDU format)
at+cmgr=X After this command we have the last message in the device
Sample
at+cpms="me"
+CPMS: 18,70,7,30,18,70
OK
at+cmgf=1
OK
at+cmgr=18
+CMGR: "REC READ","+84936975464","MrChick","09/05/01,10:13:13+28"
Test doc noi dung tin nhan
OK
- Combination of commands to Giúp read all messages
at+cpms="me” show out memory to read data is the device memory
(at+cpms="sm” show out memory to read data is the SIM memory)
at+cmgf=1 Specify the message read in text format
at+cmgl="all” Read all messages in the memory
- Combination of command to Giúp read the message received from device
10
at+cnmi=2,1,0,0,0 Setting up the report when the message send to device
When a message come to device, the phone will output to COM port the following
text string
+CMTI: "ME",60
This string show that the message is saved in the position 60 in the phone (ME)
Similarly, if messages stored in SIM in position 60, the string returns form
+CMTI: "SM",60
Then we need to output the combination of the following to read the message in
text format
at+cpms=”me”
at+cmgf=1
at+cmgr=60
- Combination of command to delete message in the phone
Command delete messages in the position X in the device memory or SIM
memory
at+cpms=”me” (SIM memory: at+cpms=”sm”)
at+cmgd=X
3.2 FBUS protocol
3.2.1 General about FBUS protocol
The FBUS protocol is used in communication between phone and PC. We can also
use FBUS for communication between phone and microcontroller. FBUS bases in
packets for error control and management.
FBUS parameters
Speed: 115,200 bps
Bits: 8
Parity: None
Stop Bits: 1
3.2.2 General structure of a command in FBUS
1e: cable
11
S: source address
D: destination address
00: pc/ microcontroller address
0c: phone address
type: command type
len: number of octet from len to sq
body: content of command
sq: sequence packet number
0? Padding, if len is odd, octet 00 is added to frame
chk: checksum,, for checking error, 2 byte
3.2.3 Command from PC to phone, request send an SMS message to
3.2.4 Structure of ACK command from phone to PC
Type: type command of command needed to ack
IV. Details of the links in the system
4.1 UART connection
Circuit of conversion voltage level for connecting PC & Microcontroller
12
Programming to establish communication between the controller and the computer is
important. The purpose is to transmit and receive command strings from PC to
microcontroller or from microcontroller to microcontroller
We use the following diagram for establish protocol communication
Detail of UART communication
Text string is transmitted to ASCII characters. Start a chain of characters ‘#‘, and
end...
 

Các chủ đề có liên quan khác

Top