GSM,GPS _ Alselectro

Embed Size (px)

Citation preview

  • 7/24/2019 GSM,GPS _ Alselectro

    1/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/

    alselectro

    All about Microcontrollers,Tips on Pc,Android phone,Electronics

    GSMHandling Received SMS

    Filed under: GSM,GPS Leave a commentSeptember 19, 2013

    This post is intended to illustrate the received SMS by a GSM module like SIM900.AT commands

    to handle the received SMS are explained in detail.

    We shall use a SIM900 module on RS232 breakout board & an USBUART converter board toconnect it to the PC.

    Following is the setup to test received SMS using SIM900.

    A terminal software like PUTTY is used to read out the COM port where GSM is connected to PCthrough USBUART board.

    https://alselectro.wordpress.com/2013/09/19/gsmhandling-received-sms/#respondhttps://alselectro.wordpress.com/category/gsmgps/https://alselectro.wordpress.com/https://alselectro.wordpress.com/2013/09/19/gsmhandling-received-sms/https://alselectro.files.wordpress.com/2013/09/image-9.png
  • 7/24/2019 GSM,GPS _ Alselectro

    2/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 2

    As you connect the USBUART board to PC ,the PC allots a COM port which can be seen underDevice manager.Open the PUTTY terminal & set this to read the serial port.

    Open the Putty terminal & type in AT .If your modem settings & connections are fine you get anOK response from the modem.

    Preferred Storage Area

    To select the Storage area for SMS type in

    AT+CPMS command .This sets the Preferred Message Storagearea.

    To know the Message areas supported by our GSM ,enter the AT command

    AT+CPMS=?

    https://alselectro.files.wordpress.com/2013/09/image-11.pnghttps://alselectro.files.wordpress.com/2013/09/image-10.png
  • 7/24/2019 GSM,GPS _ Alselectro

    3/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 3

    As seen above ,our modem returns all 3 message storage areas as SM ,which refers to theMessage storage area on the SIM card.

    The first SM specifies the message storage area that will be used while Reading or Deleting SMS.

    The second SM specifies the area that will be used when sending SMS from message storage orwriting SMS to storage.

    The third SM specifies the preferred message storage area for storing newly received SMS.

    In our case ,SM is the preferredstorage area for all SMS functions , Read , Send & Receive.

    The other storage areas are ME(storage area on GSM Modem/Mobile phone) , MT (read from astorage area associated with GSM), BM(incoming Broadcast message storage area) , SR (statureport) & TA(Terminal adapter )

    To know the SMS Service center address (SMSC)

    AT+CSCA?

    The mobile network operators service center number will be displayed.

    The number 145 in +CSCA is the address type .145 refers to International number starting with +.

    SMS Modes

    The next AT command

    AT+CSMS=?

    reports the SMS modes supported by the GSM. 0 is for Text mode & 1 is for Protocol Data Unit(PDU) mode.Our modem reports (0,1) supporting both SMS modes.

    https://alselectro.files.wordpress.com/2013/09/image-21.png
  • 7/24/2019 GSM,GPS _ Alselectro

    4/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 4

    To check if your modem supports the text mode, you can try the following command:

    AT+CMGF=1

    If the modem responds with OK this text mode is supported. It is possible to send only simpletext messages in this mode.

    To know the current message format use the command

    AT+CMGF?

    Reading Messages from Storage Area

    To read messages from SIM storage type in

    AT+CPMS=SM

    The Modem responds with + CPMS: followed by Used space & Maximum space.

    In our modem there are currently 2 messages in memory (used space ) & maximum storagecapacity is for 30 messages.

    To list out all messages in the SM storage type in

    AT+CMGL=ALL

    The modem responds with a list of all messages in the storage area.

    https://alselectro.files.wordpress.com/2013/09/image-31.png
  • 7/24/2019 GSM,GPS _ Alselectro

    5/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 5

    +CMGL: 1 is the Memory Index number used to read or delete message

    REC READ is the status message.If the message is not Read it shows REC UNREAD

    +91xxx is the phone number from where the message originated.

    , Next column is the reference number of the message.Generally this field is empty.

    13/09/19 is the Date & time of received SMS in yy/mm/dd,hh:mm : ss format

    Finally the actual message in text format is displayed.

    To list out a particular message , use the CMGR command with the index number of the messagto be read.

    AT+CMGR=2 to list the message at index 2

    AT+CMGR=4 to list the message at index 4

    https://alselectro.files.wordpress.com/2013/09/image-41.png
  • 7/24/2019 GSM,GPS _ Alselectro

    6/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 6

    Deleting Messages

    To delete a message use CMGD command with the index number of message to be deleted.

    AT+CMGD=1 to delete the message at index 1.

    You can issue the command AT+CMGL=ALL to see that the message at index 1 is deleted.

    To delete all the messages in the storage area there is no such command like AT+CMGD=ALL.

    Use the following notation to delete all messages.

    AT+CMGD=1,4

    1 is theIndexvalue & 4 is theflagvalue

    To know the index & flag values allowed

    AT+CMGD=?

    https://alselectro.files.wordpress.com/2013/09/image-5.pnghttps://alselectro.files.wordpress.com/2013/09/image-6.png
  • 7/24/2019 GSM,GPS _ Alselectro

    7/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 7

    1 to 30 can be assigned to index parameter & all five flag values from 0 to 4 are supported.

    By default flag value is 0 which means Delete message at location

    Flag value 1 Delete all READ messages ,ignoring value of index.

    Flag value 2 Delete all READ & SEND messages.

    Flag value 3 Delete all Read,Sent & Unsent messages.

    Flag value 4 Delete all messages.

    You can see from above screen shot that all messages are deleted after issuing AT+CMGD=1,4.

    AT+CNMI New message indication to Terminal Equipment TE.

    Selects procedure how receiving of new messages from the network is indicated to the TE.

    The following command sets the indicators for receiving an SMS message.

    AT+CNMI=1,1,0,0,0 Set the new message indicators.

    AT+CNMI=,,,,

    =1 discard unsolicited result codes indication when TA TE link is reserved.

    https://alselectro.files.wordpress.com/2013/09/image-7.pnghttps://alselectro.files.wordpress.com/2013/09/image-8.png
  • 7/24/2019 GSM,GPS _ Alselectro

    8/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 8

    =2 controls processing of unsolicited result codes & forward them directly to Terminal EquipmenTE

    =1 SMSDELIVERs are delivered to the SIM and routed using unsolicited code.

    =0 no cell broadcast message indications are routed to the TE.

    =0 no SMSSTATUSREPORTs are routed.

    =0 Terminal Adapter ( TA) buffer of unsolicited result codes defined within this command iflushed to the TE (Terminal equipment).

    The following command saves the SMS settings. Once the SMS commands have been saved, theinitialization commands do not need to be sent again until they are changed.

    AT+CSAS

    toSave SMS settings. This may take up to 10 seconds.

    Watch this support video :

  • 7/24/2019 GSM,GPS _ Alselectro

    9/38

    Handling Received SMS with SIM900 GSMTags: GSM Receiving SMS

    Commen

    GPS Receiver ModulePart 2

    Filed under: GSM,GPS Leave a comment

    https://alselectro.wordpress.com/2013/09/19/gsmhandling-received-sms/#commentshttps://alselectro.wordpress.com/tag/gsm-receiving-sms/https://alselectro.wordpress.com/2013/03/14/gps-receiver-modulepart-2/https://alselectro.wordpress.com/2013/03/14/gps-receiver-modulepart-2/#respondhttps://alselectro.wordpress.com/category/gsmgps/
  • 7/24/2019 GSM,GPS _ Alselectro

    10/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 10

    March 14, 2013

    Part 1 GPS theory here

    SKYTRAQ GPS634 Module

    There are numerous GPS modules available in the market.

    In this post, I am going to use GPS634R module manufactured by SKYTRAQ, a Taiwan basedleading GPS Chipset manufacturer.

    GPS634R is a highly integrated smart GPS module with a ceramic GPS patch antenna. Theantenna is connected to the module via an LNA Low Noise Amplifier.

    The module is with 51 channel acquisition engine and 14 channel track engine, which be capableof receiving signals from up to 65 GPS satellites and transferring them into the precise positionand timing information that can be read over either UART port or RS232 serial port.

    Both of the LVTTLlevel and RS232 signal interface are provided on the interface connector,supply volt is 3.6 to 6v DC.The module can be used with your Desktop PC, Laptop, or amicrocontroller. It supports the NMEA 0183 protocol, as do many GPS modules.

    We are going to start by connecting the module to our PC using an Evaluation Board shownbelow:

    This board will allow you to use a standard 12v AC adapter and a 9 pin Serial cable to connect thGPS module to your PC or Laptop.In Laptops you dont have a Serial port.Make use of an USB toUART board to connect to USB port.

    https://alselectro.files.wordpress.com/2013/03/gps-634r1.pnghttps://alselectro.files.wordpress.com/2013/03/image-12.pnghttps://alselectro.wordpress.com/2013/03/13/gps-receiver-modulepart-1/
  • 7/24/2019 GSM,GPS _ Alselectro

    11/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 1

    We shall use a board made by NSK Electronics ,which uses a CP2102 Siicon Labs USB UART IC,a reliable one.

    Connect the GPS module to the breakout board.Only we need 3 wires Vcc (pin 1),GND (pin 2) &the TX (Serial Data out). The TX wire should be connected to Rx pin on the board.

    The 9 pin D connector of the breakout board is connected to the USBUART converter using aSerial cable (straight one not cross).The USB connector of USBUART board is then connected tothe Laptop using a AB USB cable.

    Provide a 12v DC adapter to the break out board.The power LED will glow.

    At the bottom of the GPS Module a status LED glows.This LED glows still (always On) in NonFimode & starts blinking once the GPS module is outdoor and has started tracking.

    We shall make use of a Terminal Software COOLTERM to read out the COM port where GPS isconnected.

    Open up the Device Manager & note down the port number allotted to the USBUART board.

    https://alselectro.files.wordpress.com/2013/03/image-22.png
  • 7/24/2019 GSM,GPS _ Alselectro

    12/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 12

    Now open the Terminal software COOTERM . You can download it here

    Click on Options & then under Serial port select the port allotted to your USBUART board asseen in the Device Manager.The other settings are Baud Rate 9600, Data Bits 8 , Parity None& Stop Bits 1 (9600 8 N 1) .

    https://alselectro.files.wordpress.com/2013/03/image3.pnghttp://freeware.the-meiers.org/CoolTermWin.zip
  • 7/24/2019 GSM,GPS _ Alselectro

    13/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 13

    If you click CONNECT button you can see your GPS in action & NMEA Sentences flying out.

    https://alselectro.files.wordpress.com/2013/03/image4.png
  • 7/24/2019 GSM,GPS _ Alselectro

    14/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 14

    https://alselectro.files.wordpress.com/2013/03/image-451.png
  • 7/24/2019 GSM,GPS _ Alselectro

    15/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 15

    The $GPRMC Sentence is the most useful one and contains the position fix.

    $GPRMC,054006.999,A,1059.8519,N,07657.4794,E,000.0,166.0,120313,,,A*66

    GP is the Prefix for GPS followed byRMCwhich is Recommended Minimum Sentence.

    All data are separated by Commas.

    054006.999is the current timein Greenwich Mean Time (not your local time). In this example it i05 Hours 40 Minutes 06 Seconds & .999 MilliSeconds.

    Next is the STATUS CODE : A means Active & GPS HAS GOT A fix. V means Void or DataInvalid

    Next 4 pieces of Data are Geo Location Data.

    1059.8519,N >Latitude 10 Degrees , 59.8519 decimal minutes NORTH

    07657.4794,E > Longitude 76 Degrees ,57.4794 decimal minutes EAST.

    https://alselectro.files.wordpress.com/2013/03/gps1.png
  • 7/24/2019 GSM,GPS _ Alselectro

    16/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 16

    Next Data is Ground Speed in Knots.In this example Im indoor & not moving.So it is 000.0

    Next Data is Tracking Angle 166.0

    Next Data is theDATE of FIX120313 means 12th of March ,2013

    Next 2 commas indicate Empty field.One is for Time in secs since last DGPS updated & the otheris DGPS station ID number.In this example both fields are empty.

    Finally a checksum data is presented which starts with an * symbol followed by 2 Hex digits.

    Now we shall use a GPS STUDIO Software called TRIMBLE to view the MAP.

    Download TRIMBLE GPS STUDIO from here

    http://trl.trimble.com/dscgi/ds.py/Get/File484972/TrimbleStudio.exe

    Click Disconnect in the COOLTERM window to close the port.

    Start up TRIMBLE STUDIO

    If Windows Firewall blocks Trimble , click Allow Access to start TRIMBLE.

    Under New Connection Select the port COM6 (allotted to USBUART).

    https://alselectro.files.wordpress.com/2013/03/image6.pnghttp://trl.trimble.com/dscgi/ds.py/Get/File-484972/TrimbleStudio.exehttp://trl.trimble.com/dscgi/ds.py/Get/File-484972/TrimbleStudio.exe
  • 7/24/2019 GSM,GPS _ Alselectro

    17/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 17

    In the next window select the Baud Rate as 9600 ,Parity None , Data Bits 8 ,& Stop Bits 1

    Click OK.

    Now you can see the individual data like Latitude,Longitude,Date ,Time , etc.. are extracted fromthe NMEA sentences & displayed in their respective boxes.

    To see the NMEA sentences click Monitor > View RAW Data.

    To view the MAP click on Map button at the right top of the Monitor screen.

    The position of the GPS is seen as a Red Dot .To see Satellite or Terrain Views you can click on therespective buttons.

    If the GPS is fixed in a Car , the Red dot will move on the map following the movement of the Ca

    https://alselectro.files.wordpress.com/2013/03/image7.png
  • 7/24/2019 GSM,GPS _ Alselectro

    18/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 18

    Now let us take the GPS setup into a Car.

    This is the whole setup we are taking into a car.

    A 9V battery is enough to power up the GPS module.The GPS module is connected to Laptopusing an USBUART board.Trimble Studio is started and the COM port of USBUART board isentered into the port settings of Trimble Studio.

    https://alselectro.files.wordpress.com/2013/03/dsc00521.jpghttps://alselectro.files.wordpress.com/2013/03/dsc00528.jpghttps://alselectro.files.wordpress.com/2013/03/trimble11.png
  • 7/24/2019 GSM,GPS _ Alselectro

    19/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 19

    The GPS Module is placed at the front of Dash Board to get a clear sky view. A Reliance Data cardis used for providing Internet connectivity.

    Below is the screen shot of the Map plotted according to the movement of the Car.

    Watch this video :

    https://alselectro.files.wordpress.com/2013/03/dsc00534.jpghttps://alselectro.files.wordpress.com/2013/03/cargps.pnghttps://alselectro.files.wordpress.com/2013/03/dsc00524.jpg
  • 7/24/2019 GSM,GPS _ Alselectro

    20/38

    GPS MODULE SKYTRAQ 634Testing & plotting MAP

    For availability of this GPS module & break out board contact :

  • 7/24/2019 GSM,GPS _ Alselectro

    21/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 2

    Tags: GPS MODULECommen

    GPS Receiver ModulePart 1

    Filed under: GSM,GPS, Uncategorized Leave a commentMarch 13, 2013

    In this series of posts I shall demonstrate the usage of GPS Receiver module .I shall make it in 3parts.

    1. First part explains the theory of GPS & make you understand the Jargons / Specifications usedin GPS technology.

    2. In Second part I shall show you how to interface a GPS module to your PC & read the NMEASentences using a Terminal Software COOLTERM & a GPS TRIMBLE STUDIO software.Asupport Video gives you a better understanding.

    3. Third part explains how to interface a GPS with Arduino

    Let us start with first part of GPS theory :

    https://alselectro.wordpress.com/category/uncategorized/https://alselectro.files.wordpress.com/2013/03/gps3.jpghttps://alselectro.files.wordpress.com/2013/03/cooltext7537933152.pnghttps://alselectro.wordpress.com/tag/gps-module/https://alselectro.wordpress.com/2013/03/13/gps-receiver-modulepart-1/#respondhttps://alselectro.files.wordpress.com/2013/03/cooltext7537906962.pnghttps://alselectro.wordpress.com/2013/03/13/gps-receiver-modulepart-1/https://alselectro.wordpress.com/category/gsmgps/https://alselectro.wordpress.com/2013/03/14/gps-receiver-modulepart-2/#comments
  • 7/24/2019 GSM,GPS _ Alselectro

    22/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 22

    The Global Positioning System (GPS), is a satellite based radio navigation system owned by theUnited States Government and operated by the United States Air Force. GPS is funded andcontrolled by the U. S. Department of Defense (DOD).

    The outstanding performance of GPS over decades has earned the confidence of millions of civiland military users worldwide.

    Global Positioning System (GPS) module is used to get Position,Altitude,as well as Speed,Date &Time on UTC.

    It uses the standard NMEA protocol (National Marine Electronics Association) to transmit theposition data via serial port.

    GPS provides specially coded satellite signals that can be processed in a GPS receiver, enablingthe receiver to compute position, velocity and time.For anyone with a GPS receiver, the systemwill provide location and time. GPS provides accurate location and time information for an

    unlimited number of people in all weather, day and night, anywhere in the world.

    GPS system comprises of 3 segments : SPACE , CONTROL & USER SEGMENTS.

    SPACE Segment (SS) CONTROL (CS) USER SEGMENT (US)

    The Space Segmentof the system consists of the GPS satellites. These Space Vehicles(SVs) sendradio signals from space.The nominal GPS Operational Constellation consists of 24 satellites thaorbit the earth in 12 hours.

    GPS satellites transmit two low power radio signals, designated L1 and L2. Civilian GPS uses theL1 frequency of 1575.42 MHzin the UHF band. L2 ( 1.2276 GHz ) is used in Military.The L1

    carrier is modulated with the Coarse/Acquisition (C/A) code and Navigation Message, used forPPS and SPS, and the military Pcode, used for PPS only. The L2 carrier is modulated only withthe military Pcode.

    The GPS system provides two navigational services, the military Precise Positioning Service (PPSand the civilian Standard Positioning Service (SPS).

    The 24 satellites that make up the GPS space segment are orbiting the earth about 12,000 milesabove us. They are constantly moving, making two complete orbits in less than 24 hours. Thesesatellites are travelling at speeds of roughly 7,000 miles an hour.

    https://alselectro.files.wordpress.com/2013/03/usersegment.jpghttps://alselectro.files.wordpress.com/2013/03/controlsegment.jpghttps://alselectro.files.wordpress.com/2013/03/space-segment.jpg
  • 7/24/2019 GSM,GPS _ Alselectro

    23/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 23

    GPS satellites are powered by solar energy & they have backup batteries onboard .

    The Control Segmentconsists of a system of tracking stations located around the world.TheMaster Control facility is located at SCHRIEVER AFB ( Air Force Base ) in Colorado.

    The Master Control station uploads ephemeris and clock data to the SVs. The SVs then sendsubsets of the orbital ephemeris data to GPS receivers over radio signals.

    The GPS User Segmentconsists of the GPS receivers and the user community. GPS receiversconvert SV signals into position, velocity, and time estimates. Four satellites are required tocompute the four dimensions of X, Y, Z (position) and Time.

    Each satellite continually transmits messages that include

    The time the message was transmitted

    Precise orbital information (the ephemeris)

    The general system health and rough orbits of all GPS satellites (the almanac).

    A GPS receiver must be locked on to the signal of at least three of the 24 satellites to calculate a 2Dposition (latitude and longitude) and track movement.

    With four or more satellites in view, the receiver can determine the users 3D position (latitude,

    longitude and altitude). Once the users position has been determined, the GPS unit can calculateother information, such as speed, bearing, track, trip distance, distance to destination, sunrise andsunset time and more

    GPS Receivers give output data as standard ASCII text at either 4800 baud or 9600 baud and canbe easily read by the serial port on any microcontroller.

    Developments

    https://alselectro.files.wordpress.com/2013/03/afb.jpg
  • 7/24/2019 GSM,GPS _ Alselectro

    24/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 24

    GPS satellites now on orbit are aging quickly and users are demanding more capability. Tosustain and modernize the constellation, the U.S. Air Force is building the next generation satellitsystem, known as GPS III.

    Indian Regional Navigational Satellite System(IRNSS1) is under development autonomouslyby ISRO & will launch seven satellites for navigation.Full constellation is planned to be realizedaround 2014.

    The Chinese have already launched The BeiDou Navigation Satellite System(BDS).

    Specification Terms Explained :

    An important specification is the UPDATE RATE, which indicates How often the GPS recalculate& reports its position.The standard is 1HZ,i.e., only once per second. 5 & even 10HZ update rateare available.Faster Update Rate means there will be more NMEA sentence flying out of themodule.

    Next specification is the Number Of Channels.

    The number of channels that your module runs will affect your time to first Fix.Since the moduledoesnt know which satellites are in view,the more channels you have,the faster youll find a fix.

    12 or 14 channels track engine will work just fine for tracking.

    The satellites (SVs) broadcast two types of data,Almanac and Ephemeris. Almanac data is coursorbital parameters for all SVs. Each SV broadcasts Almanac data for all SVs. This Almanac data isnot very precise and is considered valid for up to several months.

    Ephemeris data is very precise orbital and clock correction for each SV and is necessary for precispositioning. Each SV broadcasts ONLY its own Ephemeris data. The validity of this data isdictated by the particular satellite and may be valid up to 4 to 6 hours. Each set of ephemeris datagives a fit indication which tells how long the particular Ephemeris data is valid. The Ephemeridata is broadcast by each SV every 30 seconds so GPS receivers have frequent opportunities toreceive and log this essential information.

    If you look up the specification of any GPS module ,you come across terms like Cold Start,HotStart & Warm Start.

    Cold Start is performed every time when the GPS module is turned off without backup powersupply connected. It is the longest starting time out of the three and usually takes 35 seconds inaverage under open sky environment. During Cold Start, almanac and ephemeris data has to bedownloaded first from the GPS satellites to GPS module before a position fix can be acquired.

    Assuming that a proper backup power source is provided, GPS module will perform Hot Start ifthe GPS module is powered on any time within the 2hour time frame after GPS was previouslyturned off, as the ephemeris and almanac data is still stored inside the its flash memory.

  • 7/24/2019 GSM,GPS _ Alselectro

    25/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 25

    Warm Start is performed if the above module is started after the 2hour time frame, as part of itssatellite data has to be refreshed.

    NMEA

    The GPS receiver outputs data in National Marine Electronics Association (NMEA) format .The

    idea of NMEA is to send a line of data called a SENTENCE.

    The standard sentences have a two letter prefix that defines the device that uses that sentencetype. For GPS receivers the prefix is GP , which is followed by a three letter sequence that definesthe sentence contents.

    In addition NMEA permits hardware manufactures to define their own proprietary sentences forwhatever purpose they see fit. All proprietary sentences begin with the letter P and are followedwith 3 letters that identifies the manufacturer controlling that sentence. For example a Garminsentence would start with PGRM and Magellan would begin with PMGN.

    Each sentence begins with a $ and ends with a carriage return/line feed sequence and can be nolonger than 80 characters of visible text (plus the line terminators). The data is contained withinthis single line with data items separated by commas.

    The data itself is just ASCII text and may extend over multiple sentences in certain specializedinstances but is normally fully contained in one variable length sentence. The data may vary in thamount of precision contained in the message. For example time might be indicated to decimalparts of a second or location may be show with 3 or even 4 digits after the decimal point.

    Programs that read the data should only use the commas to determine the field boundaries andnot depend on column positions. There is a provision for a checksum at the end of each sentencewhich may or may not be checked by the unit that reads the data. The checksum field consists of * and two hex digits representing an 8 bit exclusive OR of all characters between, the $ and *.

    $GPRMC NMEA Sentence

    The $GPRMC Sentence is the most useful one and contains the position fix. An example is

    $GPRMC,054006.999,A,1059.8519,N,07657.4794,E,000.0,166.0,120313,,,A*66

    GP is the Prefix for GPS followed byRMCwhich is Recommended Minimum Sentence.

    All data are separated by Commas.

    054006.999is the current timein Greenwich Mean Time (not your local time). In this example it i05 Hours 40 Minutes 06 Seconds & .999 MilliSeconds.

  • 7/24/2019 GSM,GPS _ Alselectro

    26/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 26

    Next is the STATUS CODE : A means Active & GPS HAS GOT A fix. V means Void or DataInvalid

    Next 4 pieces of Data are Geo Location Data.

    1059.8519,N >Latitude 10 Degrees , 59.8519 decimal minutes NORTH

    07657.4794,E > Longitude 76 Degrees ,57.4794 decimal minutes EAST.

    Next Data is Ground Speed in Knots.In this example Im indoor & not moving.So it is 000.0

    Next Data is Tracking Angle 166.0

    Next Data is theDATE of FIX 120313 means 12th of March ,2013

    Next 2 commas indicate Empty field.One is for Time in secs since last DGPS updated & the otheris DGPS station ID number.In this example both fields are empty.

    Finally a checksum data is presented which starts with an * symbol followed by 2 Hex digits.

    Other important sentences are

    GPGGA ,which provides the current FIX data

    GPGSA Overall Satellite status Data , 3D,2D Fix details & PRN ( satellites are identified by thereceiver by means of Pseudo Random Numbers.)

    GPGSV Detailed Satellite Data

    GPVTG Vector Track on speed over the Ground.

    GPRTE Route Message

    For more details of NMEA Sentences visit

    http://www.gpsinformation.org/dale/nmea.htm

    Commen

    ARDUINO with GSM

    Filed under: ARDUINO, GSM,GPS 24 CommentsFebruary 7, 2013

    In this workshop we shall see how to control a GSM board with ARDUINO

    https://alselectro.wordpress.com/category/arduino/http://www.gpsinformation.org/dale/nmea.htmhttps://alselectro.wordpress.com/2013/02/07/arduino-with-gsm/#commentshttps://alselectro.wordpress.com/2013/02/07/arduino-with-gsm/https://alselectro.wordpress.com/2013/03/13/gps-receiver-modulepart-1/#commentshttps://alselectro.wordpress.com/category/gsmgps/
  • 7/24/2019 GSM,GPS _ Alselectro

    27/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 27

    Hardware required :

    ARDUINO UNO board GSM 300 or 900 board

    12v DC adapter for GSM board Connecting wires

    The connection is simple.We shall use the Hardware Serial port of ARDUINO (pin 0 & pin 1).

    Pin 0 (RX) of Arduino is connected to RX pin of GSM

    Pin 1 (TX) of Arduino is connected to TX pin of GSM

    General Rule is always TX to Rx & Rx to Tx.But the GSM board Im using has a MAX232 levelconverter IC & the Tx ,Rx printed on board is that of MAX232s T1 IN & R1 OUT.

    Do not get confused .Always ensure that

    Rx of Arduino (pin 0) goes to pin 11 (T1 IN) of Max232

    Tx of Arduino (pin 1) goes to pin 12 (R1 OUT) of Max 232.

    As we use TTL level logic we need not bother about the presence of 232 IC.

    Do not power the GSM from Arduino.Use a separate adapter of minimum 1Amp rating.

    Make GND pins of both GSM & Arduino common.

    https://alselectro.files.wordpress.com/2013/02/gsm1.png
  • 7/24/2019 GSM,GPS _ Alselectro

    28/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 28

    To start with place a valid SIM to the holder on the GSM board.Connect the power adapter toGSM.

    Now dial a call from another phone to the SIM number & ensure that you get a Ring back tone .

    This is the initial test to confirm that your GSM is ready to accept commands from Arduino.

    Making a Call from GSM

    First we shall see how to Dial a number.

    We make use of AT commands to control a GSM.

    Here are the Steps you do for making a call

    1.Wake up GSM by giving AT command .

    2.Dial a number using command ATDphone_no; ATD followed by phone number & aSemicolon.

    3.Now the call is made.To hang the call feed ATH command.

    The above steps are converted to code as below:

    //Code for Dialling a number

    char phone_no[]=9443303461;

    void setup()

    {

    Serial.begin(9600); //Open Serial Connection at baudrate 9600

    delay(2000);

    Serial.println(AT); //Wake up GSM

    Serial.print(ATD); //Dial the phone number using ATD command

    Serial.print(phone_no);

    Serial.println(;); //Semicolon is a must at the end

  • 7/24/2019 GSM,GPS _ Alselectro

    29/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 29

    delay(10000);

    Serial.println(ATH); //After a delay of 5 secs Hang the call

    }

    void loop()

    {

    // empty loop.If you enter the above code here,the call will be made FOR EVER repeatedly.

    //Take Caution while coding under loop.At some condition youve to terminate the Call

    }

    Please note that youve to disconnect GSM from Arduino while Uploading the code to Arduin.

    While issuing ATH command use Serial.println& not Serial.print.This println is to send Carriag

    Return after the ATH command.Note the reasonable amount of Delay (10secs) used after issuingthe ATD command.

    This delay is mandatory for GSM to respond.

    Sending SMS from GSM

    Now we shall see the procedure to send SMS through GSM.

    1.Wake up GSM by sending AT command

    2.The GSM should be put on Text mode by feeding command AT+CMGF=1

    3.Now give command AT+CMGS=Mobile_number

  • 7/24/2019 GSM,GPS _ Alselectro

    30/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 30

    4.Verify whether the Modem responds with a > character

    5.After getting > symbol ,feed your Message to SMS.

    6.Press CTRL+Z to send the SMS.

    The above steps are coded for Arduino to handle automatically

    //Code to send SMS from Arduino

    int timesTosend=1;int count=0;char phone_no[]=9443303461; //phone number

    void setup(){

    Serial.begin(9600); //Open Serial connection at baud 9600delay(2000);Serial.println(AT+CMGF=1); //set GSM to text modedelay(200);}

    void loop(){while(count);{Serial.print(Test Message from Arduino GSM.HELLO..!!!); //SMS bodydelay(500);Serial.write(0x1A); // sends ctrl+z end of message Serial.write(0x0D); // Carriage Return in HexSerial.write(0x0A); // Line feed in Hex

    //The 0D0A pair of characters is the signal for the end of a line and beginning of another.delay(5000);}count++;}

    }

  • 7/24/2019 GSM,GPS _ Alselectro

    31/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 3

    Feed the above code in Arduino IDE & upload it.Do not forget to Disconnect GSM from Arduino

    while uploading the code.

    If you copy & paste the above code,you may get compile error.Type in the code wherever error isindicated.

    Note the usage of Hex codes 0x1Afor sending ctrl+z

    0x0D for Carriage Return & 0x0Afor LineFeed.

    Watch this Video on making a Call &Sending SMS using Arduino & GSM :

  • 7/24/2019 GSM,GPS _ Alselectro

    32/38

    Sending SMS through Arduino & GSM

    The GSM & ARDUINOboards are available at :

    Tags: Arduino with GSM, Control GSM with ARDUINOCommen

    GSM Tutorial

    Filed under: GSM,GPS, MicroControllers 1 CommentJanuary 16, 2012

    In this tutorial I shall demonstrate the usage of GSM board to send SMS.

    https://alselectro.files.wordpress.com/2013/02/cooltext753790696.pnghttps://alselectro.wordpress.com/tag/control-gsm-with-arduino/https://alselectro.files.wordpress.com/2013/02/cooltext753793315.pnghttps://alselectro.wordpress.com/category/gsmgps/https://alselectro.wordpress.com/2012/01/16/gsm-tutorial/https://alselectro.wordpress.com/category/microcontrollers/https://alselectro.wordpress.com/2012/01/16/gsm-tutorial/#commentshttps://alselectro.wordpress.com/tag/arduino-with-gsm/https://alselectro.wordpress.com/2013/02/07/arduino-with-gsm/#comments
  • 7/24/2019 GSM,GPS _ Alselectro

    33/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 33

    Materials required for this workshop are :

    Hardware:

    1.GSM Module Board with an active SIM card.

    2.12V DC 1A adapter for GSM power supply.

    3.USB UART converter with RS232 straight cable and USB cable.

    Software:

    1.Serial Communication softwarePuTTY. Download it from

    http://putty.en.softonic.com/

    or you can use the inbuilt Hyper Terminalsoftware in case your PCs OS is XP.It is located inPrograms>Accessories>Communication.

    While using Hyper terminal remember the following settings:

    Under File > Properties > Settings click ASCII setup and check mark Echo typed characterslocally.Otherwise you cant see what you type.

    Another software is Terminal from http://realterm.sourceforge.net/ .Terminal is a simpleserial port terminal emulation program.

    I prefer to use PuTTY as it is trouble free standalone program and response is faster than others.

    To start with insert the SIM card into the holder at the back of the board.

    Connect the 12v DC supply to the board.Connect the board to your PCs serial port using a RS232cable.In case you use the USB port , then a USB UART board is required.

    https://alselectro.files.wordpress.com/2012/01/gsm2.jpghttps://alselectro.files.wordpress.com/2012/01/gsm.pnghttp://realterm.sourceforge.net/http://putty.en.softonic.com/
  • 7/24/2019 GSM,GPS _ Alselectro

    34/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 34

    USB to UART board

    As soon as you connect the DC power to the board ,the green Power LED glows and then the redSignal LED flashes intermittently.Now make a call to the SIM number inserted in the board.Youcan hear the ring back tone in the caller phone and the Ring green LED flashes according to theRing.Now your GSM board is ready to communicate.

    Now open the Control panel >Device Managerof your PC and expand the Ports(COM&LPT) tverify the port connection.If you are using a RS232 cable directly to PC ,it will be COM1. Else itwill be different (in our case it is COM6).

    Double click the downloaded PuTTY .

    Enter COM6 under serial line and baud rate 9600 under Speed.

    Select connection type as Serial. Provide a name and save the session.

    https://alselectro.files.wordpress.com/2012/01/dmanager.jpghttps://alselectro.files.wordpress.com/2012/01/usb1.jpg
  • 7/24/2019 GSM,GPS _ Alselectro

    35/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 35

    Now select the saved session and click Open to fire up the TERMINAL.

    For the terminal to communicate with the GSM board AT commands are used.

    AT is abbreviation of ATtention.There are Basic and Extended AT commands.Basic AT commands donot start with a + like ATD, ATA,ATH,

    Extended AT commands start with + . All GSM AT commands are extended commands. e.gAT+CMGS , AT+CMGR , AT+CMGF ,

    To start with type AT (uppercase preferred) and hit Enter.

    GSM board will respond with OK.

    TypeAT+CPIN? and hit enter to know whether SIM is inserted.

    To dial a number type ATD9001234567;

    ATD followed by the mobile number & then a SEMICOLON .Hit enter to make a Call.To disconnecttypeATH.

    To send SMS typeAT+CMGF=1

    Modem confirms with OK that it changes to Text mode.

    Then type AT+CMGS=mobile.no

    After the > symbol type your message and press ctrl+z to send the SMS.

    https://alselectro.files.wordpress.com/2012/01/putty31.jpg
  • 7/24/2019 GSM,GPS _ Alselectro

    36/38

    2/26/2015 GSM,GPS | alselectro

    https://alselectro.wordpress.com/category/gsmgps/ 36

    For a more detailed tutorial of SMS and AT commands visit

    http://www.developershome.com/sms

    Following are some of the most frequently used AT commands :

    AT+CGMI To get the manufacturers ID

    AT+CMGF=1 Switch to text mode before sending SMS

    AT+CMGS=mobile.no Send SMS after typing the message & pressing ctrl+z

    ATD999xxx1234; Dial to the mobile number provided

    ATH Disconnect the call

    AT+CMSS Send SMS from storage

    http://www.developershome.com/smshttps://alselectro.files.wordpress.com/2012/01/at.jpg
  • 7/24/2019 GSM,GPS _ Alselectro

    37/38

    GSM Tutorial from Saravana ElectronicsTags: GSM300 tutorial

    Commen

    https://alselectro.wordpress.com/tag/gsm300-tutorial/https://alselectro.wordpress.com/2012/01/16/gsm-tutorial/#comments
  • 7/24/2019 GSM,GPS _ Alselectro

    38/38

    2/26/2015 GSM,GPS | alselectro

    Create a free website or blog at WordPress.com. | The Motion Theme. Follow

    Follow alselectro

    Build a website with WordPress.com

    http://void%280%29/https://wordpress.com/?ref=lofhttps://wordpress.com/?ref=footer_websitehttps://wordpress.com/themes/motion/