.

Sunday, December 16, 2018

'Sms Based E Notice Board\r'

'Abstract The goal of this dispatch is to design an embedded de depravity which stool falsify up to 8 devices by s closureing a specific SMS meat from a cell trip out for-phone. This chastenler is super handy at places w here we have to authority the ON and OFF confounding of the devices but no fit out connection to that place is available. To implement this, a GSM mannerm is attached to a programmed micro dominance which would receive the SMS from a reference cell phone. The control augury part of the received SMS is extracted and is changed to microcontroller-preferred variateat.In unconstipated intervals, the modem would a desire send the local temperature We have selected GSM because the ubiquity of its specimen makes international roaming very common mingled with restless phone operators, enabling subscribers to use their phones in m two parts of the world. A PC which is connected to the micro-controller utilise a serial communicating with RS232 fundam ent be apply for admonishering and headtal of the control signals to the modem. The supervise is alike done by interfacing a LCD to the microcontroller. AT mode drifts were use for irresponsible the functionality of modem. main(prenominal) hardwargon requirements:Renesas SKP16C62P meth Kit irrefutable This contains the micro-controller. (used for controlling the different extraneous devices connected as per the SMS received ) GSM modem (GM28 from Sony-Ericsson) This GSM/GPRS terminal equipment is a powerful, clump and egotism contained unit with well-worn connectedness embrasures and has an integral SIM waggle allegeer. It is used for receiving the SMS from the mobile device and hence to send out to the Renesas SKP. A MAX232 chip This converter chip is undeniable to convert a TTL logic from a Microcontroller (TxD and RxD traps ) to stock(a) serial interfacing for PC (RS232) A DB9 continuativeThis takes the signals coming form the MAX232 chip to the PC. The ty pical acts of this serial modem is for developing a wide come in of equipment like Security and alarms devices monitor and control devices Vending machines Utilities devices Fleet Management devices imbed Project- ECE 5 one hundred one Page 3 2. Project definition Renesas SKP16C62P Starter Kit Plus device 1 Device 2 MAX 232 Device 8 DB9 connecter DB9 Connector GM28 (GSM Modem with SIM invoice working in 850 megacycle per second /1900 Hz) Antenna Computer (For displaying the received SMS) Figure 1: Block diagram of the project hardenedupIniti bothy the SMS is received from the soulfulness authorized to use this setup ( make senseress) by the GSM modem (GM28) & adenine; is transferred to the Renesas SKP16C62P SKP with the help of a MAX 232 chip. As per the AT directs minded(p) by the microcontroller to the modem, the control signal from the SMS is extracted and is used to control the devices connected to it. We have to convert the ‘septets of the phone to ‘ ei ghts because the micro-controller need bytes with 8 bits length ( The ‘septet is 1 byte with 7 bits length and ‘octet is 1 byte with 8 bits length). All this wreak is necessity to decode the centre from SMS.A program (for extracting the control signal part from received SMS) is loaded into Renesas SKP16C62P SKP, and and so the circuit is connected to the modem. The microcontroller now tries to read the SMS from the foremost store location of the modem and it keeps mothering again until the modem receives any (programmed for all(prenominal) one second). Before implementing the control signal part of the SMS, the modem extracts the subjugate from the SMS and verifies if this number has the access to control the device or not. For controlling the devices, the nitty-gritty go forth be sent in enthralla decimal coif.The hex info is converted to the analogous binary program and the circumstance proceeds is enabled. For ex angstromle if the depicted object i s â€Å"AB” the equivalent binary is â€Å"10101011” this implies that the output 1, 3, 5, 7, 8 atomic number 18 enabled and the remain ports ar hinderd. We have connected LEDs to the ports of microcontroller to evince the output and their status indicates whether the ports are set to ‘ON’ or ‘OFF’. The microcontroller is also programmed to read the temperature from the thermistor every 15 minutes and to send a SMS to the destination number. plant Project- ECE 5101 Page 4 3. Device Description 3. 1. Renesas SKP16C62P Starter Kit PlusThe SKP16C62P StarterKit Plus (SKP) is a inexpensive environment for evaluating M16C/62P congregation of microcontrollers (MCU) and Renesas Technology America, Inc. software culture tools. The SKP poster provides an evaluation and development environment for the M16C/62P group of MCU. It has pushbutton switches, LED’s and LCD for user interface. measurement connector ports are available to expand the tell of practises by dint of and through the use of expansion boards, etc. The fit comes with an integrated software development environment, HEW (IDE, C-compiler, assembler, and linker), KD30 Debugger, and FoUSB ( fool-overUSB™) Programmer.A real-time, source-level rectify environment is implemented using the KD30 debugging software with the RTA-FoUSB-MON brazen-faced Programmer/In- lap covering Debugger (ICD). The Flash-over-USBTM (FoUSB) Programmer software, with the ICD, allows in-system programming of the M16C/62P flash MCU. The ICD and firmware provide a convenient USB (Universal Serial Bus) interface between the SKP16C62P board and the host PC. This interface reduces election requirements on the M16C/62P MCU, allows faster code downloads and, burn down also be used with many other Renesas Flash MCU’s, SKP’s, and user’s tar motor board.Figure 2: SKP16C62P organization Connectivity (From the hardware manual of SKP16c62P ) Embedded Proje ct- ECE 5101 Page 5 3. 2 GSM modem: (GM28 from Sony-Ericsson) Figure 3. a Figure 3. b Figure 3. c Figures 3. a, 3. b and 3. c show the different views of the GSM modem GM28 (From the Hardware manual of GM28 Modem) The Global body for Mobile Communications (GSM) is the most popular standard for mobile phones in the world. It is the European standard for digital cellular religious service that includes enhanced features. It is based on TDMA technology and is used on 850/1900 megahertz. We are using the GM28, a GSM modem from Sony-Ericsson.This is a powerful GSM/GPRS Terminal with compact and self-contained unit. This has standard connector interfaces and has an integral SIM add-in reader. The modem has a RJ9 connector through which a utterer and microphone can be connected allowing auditory sensation call ins being conventional, but this feature is not utilised in this project as only selective learning transfer is needed. Following are few practiced details of the modem. us er interfaces: • selective information: RS232 9â€way (V. 28) • might and drawn-out I/Os: 5 †32VDC (RJ11) • speech sound 4-wire Handset Interface (RJ9) • Antenna: 50 (FME male) • SIM card reader: 3V/5V interface with SIM detectionFeatures: • ME + SIM phone book attention †read/write/find, call screening, groups • SIM Application Toolkit family 2 • Real sequence Clock • packet upgradeable • Audio control • Fixed dialing number • UCS2 16 bit data supported. Embedded Project- ECE 5101 Page 6 SMS features • Supports both(prenominal) Text and PDU modes • MT/MO & axerophthol; CBM • Cell Broadcast • Concatenation †up to 6 SMS The TT4030 (SE-GM28) uses the future(a) industry standard connectors to interface with the immaterial application and the GSM network; • • • • • RJ11 (plug-in power supply connector). RJ9 (handset strait connector) I ntegral SIM card reader.FME male (antenna connector). Sub-D socket, 9 pin (RS232 serial port). 3. 3. Power Connections All electrical connections to the TT4030 (SE-GM28) are designed to meet the standard air (4 kV) and mite (8 kV) discharrge ESD tests, of EN 301 489-1. Figure 4 RJ11 connector as power supply to the modem (From the Hardware manual(a) of GM28 Modem) 3. 4. Antenna Connections The used antenna (Figure 4. a) operates at 850/1900 MHz which is suitable for transmitting and receiving of RF signals for the GSM modem (GM28) used. Some of the keystone features of this antenna are: • Bandwidth is 280 MHz • VSWR is +3. 0V Signal = 1 (HIGH) < -3. V Embedded Project- ECE 5101 Page 9 Pin No. Name Notes/Description 1 DCD Data Carrier Detect 2 RD hear Data (a. k. a RxD, Rx) 3 TD Transmit Data (a. k. a TxD, Tx) 4 DTR Data Terminal stimulate 5 SGND Ground 6 DSR Data station Ready 7 RTS Request To Send 8 CTS Clear To Send 9 RI Ring forefinger Table 1 Pin descri ption of a DB9 connector 6. GM28 in a Communication brass Figure 10, Illustrates the main blocks of a wireless colloquy system using the TT4030 (SE-GM28). It also shows the communication principles of the system. The definitions in the figure are in accordance with the recommendations of GSM 07. 7. The MS (mobile station) represents the TT4030 (SE-GM28) modem plus SIM card. The modem excluding SIM card, is known as the ME (mobile equipment). The TE (terminal equipment) is a micro-controller and is a part of the application. Figure 10. a primary(prenominal) blocks in communication between the GM28 (modem) and the microcontroller (TE) (From the Hardware Manual of GM28 Modem) The end-to-end communication path to be established between the external telemetry/ telematics application and a outdoor(a) terminal or host, via the GSM network is done through the serial communication.Serial data with flow control jibe to the RS232 signaling protocol operates between the modem and the exter nal application. The modem performs a set of telecom services (TS) according to GSM standard phase 2+, ETSI and ITU-T. Control of the TT4030 (SE-GM28) is by the external application, via the RS232 serial interface, using a set of AT sees. The TT4030 (SEGM28) supports the full set of AT commands according to GSM 07. 05 and GSM 07. 07. It also supports an extended set of Ericsson proprietary AT commands to add extra functionality. Embedded Project- ECE 5101 Page 10AT commands are used to operate the modem and have a broad compass of Functions including: Configuring general parameters of the modem (SE-GM28) Setting up and controlling communications to and from the GSM Network Configuring the modem to communicate across the RS232 serial interface Obtaining GSM network status information. Figure 10. b Interface between the GM28 (modem) and microcontroller (TE) (From the Hardware Manual of GM28 Modem) The modem also supports the Voice, Data, facsimile services but since these are not n ecessitate for the menses application, they are not taken into condition as of now. . AT commands The AT command set is the fundamental interface with the modem. An AT command is simply a mountain chain of characters topd by the AT affix that is sent to the modem. The commands typically instruct the modem to perform rough action or set some property within the modem. The modem has two states: command state and online state. In command state, the modem will accept and oppose to AT commands. In the on-line state, the modem will transmit data, but ignore AT commands. Typically the modem is in the on-line state after dialing.AT commands has the following format: The command is prefixed with AT (Attention) The command is terminated by a carriage return ( shut the A/ command and escape sequence). The commands can be entered in upper berth mooring or lower carapace. The AT prefix can be in upper good example or lower miscue, but both the A and the T mustiness be the same r epresentative. Characters that precede the AT prefix are ignored. Multiple commands can be strung to charmher on a single line and outer spaces may be include between commands but are not necessary. The command line interpretation begins upon receipt of the carriage return.These commands are used for request information about the current signifier or operational status of the mobile phone/modem and test availability and request the range of valid parameters, when applicable, for an AT command. Embedded Project- ECE 5101 Page 11 General Syntax of AT-Commands: Basic AT [=] [] Extended AT+= [] AT*= [] Read command AT+? AT*? AT? screen out command AT+=? AT*=? Response command AT+ : AT* : Important AT command used to Test and Design: 1) ATD To dial a voice call from the modem. 2) AT+IPR To set the baud rate for the modem ( here for our application the baud rate is set as 9600) ) ATA To answer an incoming call. 4) AT+CHUP To hang up the initiated call. 5) AT+CFUN To set the phone functi onality. Set to 0 to deactivate the modem. 6) AT+CLIP To appoint troupe number this command is set to 1 7) AT+CLIR For calling line Identification Restriction. 8) AT+CNUM To identify the subscriber number. 9) AT+CMGR To read the meat at particular location . The location number is given as index. 10) AT+CMGD To delete the received message 11) AT+CMGS To send the message. 12) AT+CMGF To change the message format to PDU or Text mode. 13) AT+CMGL To think all the list of messages. 4) ATE To enable and disable command echo. 8. Installation and Functionality of modem To install this modem in the communication system to PC, the following procedure is adopted: • • • film the phone and modem options from the control table. By browsing the magnetic disk for the modem drivers, the modem is selected and assemble to a particular port through which it is connected to the PC. The terminal software package like HyperTerminal is selected in the sign stage to check the fu nctionality of the AT commands to control the GSM modem and later this hyper terminal is just used to monitor the serially received output.Hence finally a trine way communication is established, the modem directly communicates with the micro controller to control the switching of devices externally and the hyper terminal package in PC is used just for monitoring the results (hence only receive and ground of connected to the PC). Embedded Project- ECE 5101 Page 12 • • The parameters for serial communication can be set in two ways; either by terminal equipment or by serial communication with the micro controller. It should be detect that the DTR pin should be enabled high in the initial tage to turn-on the modem, for this flow control of hardware is to be taken and the communication initially is 115200 bauds/second with 8-n-1 configuration (i. e. 8-Data bits, Parity none and 1-Stop bit). Later the baud rate can be changed to 9600 bps through the AT command: AT+IPR = . T he settings for the hyper-terminal should have the default excitant translation and ASCII setup, the emulation can be either VT100 (preferable) or Auto-detect. To setup the serial port the following procedure has been followed: • • • Select system from the control panel and thereby select the device manager in the hardware option.Now the exact serial COM port where the modem is configured is selected manually. Select port settings and then bits per second to get the exact baud rate. Now that the modem is configure it’s the task of setting up the volatile visibleness and enter the AT commands required to select the SIM memory and then extract the school school school textbook message. Hence, serial communication is established between GM28 and the microcontroller using a DB9 connector with a level shifter (MAX232). A level shifter is connected between the microcontroller (SKP) and the modem/computer and nonentity modem connection is connected for the D B9 connector.The above discussed points are portrayed in the Figure 9. Figure 9 Circuit for connecting the microcontroller to the modem/computer Embedded Project- ECE 5101 Page 13 9. suddenly Message Service (SMS) The GSM GM28 Modem supports the following SMS services. Sending, MO (mobile-originated) with both PDU (protocol data unit) and text mode supported. Receiving, MT (mobile-terminated) with both PDU and text mode supported. CBM (cell broadcast message), a service in which a message is sent to all subscribers located in one or much specific cells in the GSM network. This feature is network dependent.SMS emplacement REPORT according to GSM 03. 40. SMS COMMAND according to GSM 03. 40. It should be noted that the maximum length of an SMS message is one hundred sixty characters when using 7- bit encode. For 8-bit data, the maximum length is one hundred forty characters. The Modem supports up to 6 concatenated messages to extend this function. Before we prick working on the application design we should learn the network subscription status Before the application is implemented, we must fix that the chosen network provides the necessary telecommunication services. Else, the service provider should be contacted to obtain the necessary information.Since SMS features are used in this application, we have to ensure that these are included in the (voice) subscription. 10. PDU SMS format: there are two ways of sending and receiving SMS messages: by text mode and by PDU (protocol description unit) mode. We can switch from text mode to PDU mode and vice versa by selecting the AT+CMGF command. If AT+CMGF = 0 then PDU mode is selected and if the mode is 1 then text mode is selected. The text mode is just an encoding of the bit stream represented by the PDU mode. If we read the message on the phone, the phone will learn a proper encoding.An application capable of denotation incoming SMS messages can thus use text mode or PDU mode. If text mode is used, the ap plication is bound to the set of preset encoding options. In some causal agencys, thats just not good enough. If PDU mode is used, any encoding can be implemented. The PDU string contains not only the message, but also a lot of metainformation about the sender, its SMS service center, the time cachet etc. But as of now for our application we require the phone number of the caller for certificate and the length of the message and the text message which contains the binary message.Let us take a mannequin for the text message of â€Å"abcdef”. This message contains apart from the basic text message a lot of redundant data (meta information about the sender). In PDU mode the SMS looks like: 07914140279542F7000B816187220731F700006010413283900A0661F1985C3603 In TEXT mode the SMS looks like: +CMGR: â€Å"REC bring”,”16782270137″,,”06/01/14,23:56:1720″,129,0,0,0,”+14047259247″,145,6 abcdef Embedded Project- ECE 5101 Page 14 The octets o f the PDU message contain lots of information, in the above example the PDU can be divided and different octets imply the following information: 07 Length of SMSC information. 1 character reference of address of SMSC. 4140279542F7 Encoded Service center number. 00 First octet of SMS delivery message. 0B Address length of the sender message. 81 Type of address of the sender number. 6187220731F7 Sender number with a trailing F. (number is 16872270137). 00 TP-Protocol Identification Address. 00 TP-Data coding Scheme. 601041328390 TP-SCTS Time stamp. 0A TP-User data length. 0661F1985C3603 Encoded Message â€Å"abcdef”. All the octets are hexa-decimal 8-bit octets, except the Service center number, the sender number and the timestamp; they are decimal semi-octets.The message part in the end of the PDU string consists of hexa-decimal 8-bit octets, but these octets represent 7-bit data. Basically the conversion of the septets to the octets is based on the GSM 03. 38 standard. Thi s is helpful when we try to communicate with the PDU mode but if we use the CMGF command then text mode is activated to get the converted text message. So to get the message in the Text message we need to send the following commands AT+CMGF=1 to activate the text mode AT+CMGS=1 to check whether the modem supports the SMS message or not.AT+CMGR=I to read the message at the location I in the SIM card. 11. Code /*******************************************************************/ /* stick :main. c DATE : Jan 2nd 2006 /* */ DESCRIPTION :Main Program To receive SMS from GM28 and to extract the control information part, then to control LEDs accordingly. Send the ambient temperature as SMS back to the user. AUTHORS: B. VAMSEE KRISHNA ; B. PRANEETH KUMAR */ /******************************************************************/ #include â€Å"skp_bsp. h”// include SKP board support package #include â€Å"string. h” subdue uartinit();Embedded Project- ECE 5101 Page 15 unsigned c har result; char sms_text[200],sms_msg[10],num_text[10]; unsigned int f,f1,t,time=0,k=0,count=0,p=0; /* warning declarations */ mar mcu_init(void); // MCU initialization void main(void); void timekeeper_init(void); void uartinit(void); int map(char); #pragma agitate rx_isr void rx_isr(void); /* DEFINE QUEUES*/ #define Q_SIZE (200) typedef struct { unsigned char Data[Q_SIZE]; unsigned int full point; // points to oldest data segment unsigned int vestige; // points to next free space unsigned int size of it; // quantity of elements in adjust Q_T; Q_T tx_q, rx_q; int Q_Empty(Q_T * q) { return q-;gt;Size == 0; } int Q_Full(Q_T * q) { return q-;gt;Size == Q_SIZE; } int Q_Enqueue(Q_T * q, unsigned char d) { // if queue is full, abort sooner than overwrite and return // an error code if (! Q_Full(q)) { q-;gt;Data[q-;gt; lavatory++] = d; Embedded Project- ECE 5101 Page 16 q-;gt;Tail %= Q_SIZE; q-;gt;Size++; return 1; // success } else return 0; // failure } unsigned char Q_Dequeue(Q _T * q) { // must check to see if queue is empty forward dequeueing unsigned char t=0; if (! Q_Empty(q)) { t = q-;gt;Data[q-;gt;Head]; -;gt;Data[q-;gt;Head++] = 0; // empty unused entries for debugging q-;gt;Head %= Q_SIZE; q-;gt;Sizeâ€; } return t; } void Q_Init(Q_T * q) { unsigned int i; for (i=0; iData[i] = 0; // to simplify our lives when debugging q->Head = 0; q->Tail = 0; q->Size = 0; } void timer_init(void) { // timer initialisation ta0mr = 0x80;//timer mode ta0 = 0x927C;//for 50 msec delay ta0ic = 0x03;//timer priority tabsr=0x01; // starting the timer Embedded Project- ECE 5101 Page 17 } int map(char c) { int a=(int)c; switch (a) { case 48: return(0); transgress; case 49: eturn(1); geological fault; case 50: return(2); transmutation; case 51: return(3); uncover; case 52: return(4); bruise; case 53: return(5); break; case 54: return(6); break; case 55: return(7); break; case 56: return(8); Embedded Project- ECE 5101 Page 18 break; case 57: retu rn(9); break; case 65: //returns 10 if ‘A is entered return(10); break; case 97: //returns 10 if ‘a is entered return(10); break; case 66: //returns 10 if ‘B is entered return(11); break; case 98: //returns 10 if ‘b is entered return(11); break; case 67: //returns 10 if ‘C is entered return(12); break; ase 99: //returns 10 if ‘c is entered return(12); break; case 68: //returns 10 if ‘D is entered return(13); break; case 100: //returns 10 if ‘d is entered return(13); break; case 69: //returns 10 if ‘E is entered return(14); break; case 101: //returns 10 if ‘e is entered Embedded Project- ECE 5101 Page 19 return(14); break; case 70: //returns 10 if ‘F is entered return(15); break; case 102: //returns 10 if ‘f is entered return(15); break; default: break; } } #pragma INTERRUPT timer_a0 void timer_a0(void) // the timer is set for every 50 milliseconds\r\n'

No comments:

Post a Comment