Mini GSM localizer without GPS

By on June 13, 2011

Mini GSM localizer without GPSIt’s no the first time that we present a localizer without GPS. We remake the old device with the cheaper SimCom module SIM900. In the previous post we present the GSM section and now we can present the complete localizator.

How it works

Introduction

This system allows for localization without directly using GPS technology; we are able to locate the desired object fairly precisely by using database availability together with the geographic position of the cells themselves. In some country the cell coordinates are not publicly known (i.e. in Italy). If so, where do we find such data? Through Google Maps… Google has been able to store billions of data regarding the location of its clients’ cell phones. But how does GSM localization work? The radio mobile network is made up of a number of adjacent radio cells, each of which is characterized by an identifier consisting of four data: a progressive number (Cell ID), a code related to the area in which that given cell is (LAC, or Local Area Code), the code of national network to which the cell belongs (MCC, an acronym for  Mobile Country Code), and finally the company code (MNC, or Mobile Network Code), which obviously identifies the phone company itself. For this reason, once a cell name and coordinates are known, and considering the maximum distance allowed between this cell and a phone  before the phone connects to a new cell, it is possible to find out, approximately, the most distant position of the phone itself. For example, if the maximum distance has been determined to be one mile, the cell phone can be within a one-mile radius. It can be deduced that the more cells are found in a given area, the more precisely one can determine where the phone is located (up to 200-350 feet). The idea of employing only a GSM device to build a remote localization system occurred to us when we realized that Google Maps Mobile, which had been conceived to allow smartphones equipped with a GPS receiver to use Google for satellite navigation, was extended to all cell phones, as long as they were able to support GPRS or UMTS data.  Naturally, this method allows but for a rough estimate: determining the precise position of the cell phone hinges on data regarding the coverage of a given cell which can only be provided by the Google server.

GSM localizer - The GSM moduleGSM localizer - the core

The circuit

Compared to traditional localizers based on GPS, this device presents many advantages, primarily because it is lighter and less bulky, has a cost lesser and greater autonomy to exercise. This means that about one battery lithium ion, such as 1 Ah, our tracker can be in operation for several days (it all depends on the number of SMS that have to do). A locator based on cellular network may answare more immediately: the GPS receiver may take several minutes to determine its position. Our tracker works battery and thus can be brought on by people who may have the need to ask help or be tracked, but also placed on board motor vehicles (without installation) or simply introduced in goods in transit. To avoid unnecessarily draining the battery, the localizator provides its position via SMS, on requesto with a simple phone call. Among the functions implemented there is the SOS: By pressing the button the localizator sends a text message asking for help, containing the coordinates of position, the sending can be done to a maximum of eight thelephone numbers. When queried or with the autoreport function, sends an SMS with the localization.To know the location of remote device must send an SMS request cell is connected and sends a request (via GPRS) to Google’s site, the latter responds with the coordinates and the figure for the precision. Everything happens in seconds.

Schematic
The circuit consists of a module GSM / GPRS SIM900 produced by SIMCom controlled by a microcontroller Microchip. The set is divided into two PCB, one containing the SIM900 and the other the micro and charger for the lithium battery. The motherboard mounts the micro and charger, the microcontroller is a PIC18LF6722(U1), it runs in loop waiting for an event that can be the arrival of an SMS (or a telephone call) or the pressure of the Button P1. In the case of receiving an SMS, it acts differently depending on whether a message of configuration or location request. At the request, the PIC controls the GSM module until it is connect in data mode (via GPRS, then on the Internet) to the server Google Maps and send the request position together with the identifier of the network cell which SIMCom is connected, then receive the incoming data from the web. Received data with assumed the position (latitude and approximate longitude) and the accuracy, prepare a text message and forward it to the number made the request by SMS or a combined with the stored alarm function. After receiving these information, the remote unit sends a text message.
The circuit is powered by 3.6 volts obtainable from a battery Li-Ion. To save battery power. the microcontroller firmware provides the possibility, by a specific command, to place the locator in a state of “hibernation” for a period of maximum 240 seconds, and this to limit the consumption micro and put on standby also the GSM module, which remains ON but only in receiving and operating with a reduced clock. The absorption of localizer in standby is only 6 mA. The reducing clock frequency (Slow Clock) is obtained using the command AT+CSCLK= 2. To exit from hibernation, the microcontroller waits for a call, or the expiration of set period (which, as said, can get to 4 minutes): verify if the interval expired or a SMS arrived with a coordinate request or configuration. We conclude the description of functionality of the tracking, saying it detects the motion and trigger actions programmed in such cases, although it has no receiver GPS or accelerometer or other motion sensor: the detection is based on changing cells in the SIM900.

Part list

 

[code]
R1: 10 kohm (0805)
R2: 330 ohm (0805)
R3: 330 ohm (0805)
R4: 330 ohm (0805)
R5: 10 kohm (0805)
C1: 100 nF (0805)
C2: 100 nF (0805)
C3: 100 nF (0805)
C4: 15 pF (0805)
C5: 15 pF (0805)
C6: 470 µF 6,3 VL (CASE-X)
C7: 4,7 µF 6,3 VL (CASE-P)
U1: PIC18LF6722
U2: MCP73831T-2ACI/OT
LD1: led red (0805)
LD2: led green (0805)
LD3: led green  (0805)
Q1: quartz 20 MHz (12SMX)
SW1: switch
P1: Microswitch 90° SMD
Mini-USB
molex 2 via 90°
connector 8 via
connector 2x10 via 2 mm female
[/code]

The commands


All configurations can be set remotely using any cell phone. Let us start with the list of numbers that can be used to request location data: there can be up to eight numbers: the same numbers to which the localizer sends SMS messages containing location data. The default password is 12345; the default password can be replaced with a private one (provided it is not more than five digits) by sending a command with an SMS containing “PWD newpwd;pwd,” where “newpwd” is the password to be stored and “pwd” the current one. To store a given number, one must send an SMS containing “numxnnnnnnnnnnn;pwd,” where x indicates the position (1÷8) in which to save the number represented by “nnnnnnnnnnn” and “pwd” is the current password. Each number can contain up to 19 digits and must include the country code (+39 for Italian cell phones). To erase a number from a position in the list, one must use the command “NUMx;pwd,” where x is the position (1÷8). As was mentioned above, when a call is made, the localizer responds to the number the call came from, whereas in auto-report or SOS mode (that is, when the alarm button P1 is pressed), the localizer can be programmed to respond to all eight numbers. The command, in this case, would be “SMSxxxxxxxx;ON,” where “xxxxxxxx” stands for the positions where the numbers are. For example, “SMS1346;ON” means that those numbers in positions 1, 3, 4 e 6 will be receiving the sent SMS messages. In order to disable sending SMS’s to one or more numbers, it is necessary to send the command “SMSxxxxxxxx;OFF,” which tells the localizer to disabled the positions specified. For instance, “SMS2,3,4,6;OFF” disables sending SMS’s to those numbers stored in positions 2, 3, 4, 6. Regarding requests through a mere ring, it is possible to program the localizer’s response through the command “ARI:x,” where x should be replaced with M if you want the device to respond only to the number the call came from; on the other hand, if you would like all the numbers enabled with the command  “SMSxxxxxxxx:ON” to receive the SMS, then x should be replaced with S. Now let’s take a look at those commands that define the localizer’s IDs: an SMS containing the text “IMEI?” sends the number the call came from the phone’s IMIEI code. The command “NAME:xxxx” allows a user to name the device, which comes in handy when dealing with more than one localizer.  “NAME?” is what one should ask the device if he or she wants to find out its name. “FORS:x” determines how SMS messages are displayed. The two configurable formats (1 or 2) yield the following results:
1:Probable position:
LOCALIZATOR
LAC 271B
CID 39DFLAT: 45.2441
LON: 8.1228
Range: 1148 m
via Adige 21
21013 Gallarate VA,
Italy
SOS

2:http://maps.google.it/maps?f=q&hl=it&q=45.643830,+8.814598
Gallarate VA,
Italy
SOS


Through the command “REV:1,” one can also view the information regarding the conjectured address, whereas REV:0 doesn’t allow for that. In the examples you see SOS because the SOS button was pressed remotely when the message was sent; if the request is made by calling or by means of an SMS, the following is displayed: POLLING or AUTO_CONT
when in auto-report mode. The system can be queried at any time using the commands “FORS?” in order to find out which format is currently configured.  Regarding the auto-report mode, there is a specific set of commands: “AUTO?” allows a user to remotely check auto-report settings. “AUTOC:xx” enables or disables the periodic sending of coordinates to the list of numbers stored or enabled to receive SMS’s.  In order to enable auto-report, write ON in the place of xx; to disable it, write OFF. The command “AUTOC:hh/mm” allows one to determine how often periodic sending is to occur; to this end, you need to “ hh/mm” with the number of hours and minutes the localizer is supposed to send messages with its position to the numbers in the list with the usual command “SMSxxxxxxxx:ON.” For instance, if a message must be sent every 15 minutes, you need the following command: “AUTOC:00/15.” Let’s now turn to the set of commands regarding Internet settings, indispensable when accessing the Google server during location requests:  APN is set with “GPRSAPN xxxxxxxxxx,” where the x’s must be replaced with the parameter associated with the company providing cellular Internet service; for Vodafone, it would be “web.omnitel.it.” When needed, “GPRSAPN” erases the existing setting.  “GPRSUSR xxxxxxx” can be used to set the username (which needs to be written in place of the x’s), while “GPRSUSR” erases the current setting. “GPRSPWD xxxxxxxxxx” sets the password needed to access Internet, while “GPRSPWD erases the current password. Finally, those who wish to check their Internet settings can use the command “GPRS?,” which will respond by sending an SMS containing the relevant data to the number that requested them.  Recall that our localizer responds to commands that come from one of the numbers in the list or from any other phone as long as the SMS contains the correct password. The command “COO” allows users to request the coordinates of the current position at any time; this command causes an SMS to be sent to the phone the command itself came from. Total reset, which restores default settings and erases the phone number list, is achieved through the command “RES;pwd,” where “pwd” is the current password. The system can handle multiple messages, that is, SMS’s containing each more than one command, as long as such commands are separated by commas. In the event one wishes to save money, he or she can disable answering some of the commands by inserting in the SMS the command “RISP,” which blocks commands that need an SMS confirmation from receiving answers. Our localizer can automatically store the first number in the list (Easy Setup): once it has been turned on and for about three minutes, it waits for a call; when the call arrives, the localizer saves the number of the phone the call is coming from and then starts functioning normally wherever it is, even if no one else calls. To go back to Easy Setup, it is necessary to switch the power off and then on again.

Design files

Gerber File

Firmware


About Boris Landoni

Boris Landoni is the technical manager of Open-Electronics.org. Skilled in the GSM field, embraces the Open Source philosophy and its projects are available to the community.
  • Moura

    Dear friend, you can buy these equipment ready for use?

    You can also provide a step by step how to perform the assembly and especially how to integrate with google?

  • Moura

    One more question. You can send me the BOM – Build Of Material List (resistors, capacitors, etc.).?

    • http://www.open-electronics.org Boris Landoni

      Hi Moura, I add the part list in the post.
      The localizer will be ready next month. :-)

  • Ashwani Sihag

    Hi Boris,

    Greate work! I have also made the same you made but with Atmega328 in c++

    Can i get your code in english version? Its in your language now and I am not able to understande this.

    Very good work done! Will save lot of people and money here.

    Regards,
    Ashwani Sihag

  • http://www.open-electronics.org Boris Landoni

    Hi Ashwani,
    the SMS are in english. There are some variable in italian language but this isn’t important.

  • Mauro

    Nice Job Boris!

    I am planing on buying a SIM900 ship and control it with a HCS12 Dragon board.

    Ashwani, Boris, what development KIT did u guys have to connect to the SIM900 ship and SIM card?

    Much appreciated,

    Thanks,

  • http://www.open-electronics.org Boris Landoni

    Hi Mauro,
    I don’t have a development KIT. I made the circuit like the localizer without GSM and I worked on this device. You can use the GSM SHIELD http://www.open-electronics.org/arduino-gsm-shield/

  • Ashwani Sihag

    Hi Mauro!

    I will be using arduino duemilanove to test sim900 module but not tested yet, I am waiting for components to arrive for sim900 module.

    Regards,
    Ashwani Sihag

  • Ashwani Sihag

    Hi Mauro!

    I have my own shield but have problem sometims.So I will be using Arduino GSM and GPRS shield from this site only.

    regards,
    Ashwani Sihag

  • vasilis

    How long can it operate if i connect it with 8 AAA batteries?how can i connect it with these batteries?thanx

  • http://www.open-electronics.org Boris Landoni

    Please remember that the device requires a 3.6V.

  • vasilis

    I want to use on a bike so if its stolen i can find an approximate location so the usage of it will be rare(i hope 1 sms per 6 months) .the area that it will operate is a city so it will most of the time have signal. Having these factors in mind can you tell me aproximately the duration of the batteries?

  • http://www.open-electronics.org Boris Landoni

    The localizer use a litio battery 3,6V (not incl.). You must charge the battery with a USB (5V). I suggest you to use a Cigar Lighter Usb Adapter connected to your moto’s battery and a usb cable connected to this localizer. So the circuit recharges the battery.

  • Ashwani Sihag

    Hi Boris,

    I have assembled your board in India and have doubt if I can use any tantalum 470 ( Brownish color instead of black) 16v instead of 6.3 volt.

    My GSM stopped working after sending 3 sms in 1 minute while I was testing with arduino duemilanove rx tx, power supply was from same source but regulated 4.2v with LM317.
    4.2V–>GSM RX| GSM TX|
    12V Battery– | |
    5V–>arduino duemilanove

    Will be very kind of you if you can tell me any other crystal I can use because the crystal you described is not available here

    Regards,
    Ashwani Sihag

  • vasilis

    Sorry i meant i bicycle ,so recharging is not an option.

  • http://www.open-electronics.org Boris Landoni

    @Ashwani Capacitor: 16V is better don’t worry.
    But you are speaking about the GSM Shield?

    @Vasilis You can use a 12V battery but with a Step Down converter to obtain the 3,6V. I will post a post :-) to explain the circuit.

  • http://ionnor.com Ashwani Sihag

    Hi Boris,

    Yes i was talking about GSm shield.
    Thank you so so much :-)
    Regards,
    Ashwani Sihag

  • http://ionnor.com Ashwani Sihag

    Hi Boris!

    How to upgrade firmwire?

    Regards,
    Ashwani Sihag

  • http://www.open-electronics.org Boris Landoni

    To program the Localizer you have to use a PicKIT2 connected to the white connector.

  • Ashwani

    Hi Boris!

    Thanks for prompt answer :-)

    Regards,
    Ashwani Sihag

  • freddy

    Hi, i need help, i work with this sim900, my big question is what is the proced for give coordinates from google maps, what is the http, or what?

    Regards

  • http://www.open-electronics.org Boris Landoni

    Hi freddy, this is the code. It’s written in Basic. I don’t know if Google is happy for this. But you don’t say him that I wrote this code… :-P

    
    INVIOCELLTOCOO:
        CELLTOCOOOK=0
    
        HSEROUT ["POST /glm/mmap HTTP/1.1",13,10]
    	HSEROUT ["HOST: google.com",13,10]  
        HSEROUT ["Content-Type: application/binary",13,10]
        HSEROUT ["Content-Length: 82",13,10]   
        HSEROUT ["Connection: close",13,10,13,10]          
    	
        FOR TMP=0 TO 100
            STRING[TMP]=0
        NEXT TMP
        STRING[0] =0 :STRING[1] =21   
        'STRING[2] =0 :STRING[9] =0
        STRING[10]=0 :STRING[11]=2 
        STRING[12]="i":STRING[13]="t"
        STRING[14]=0 :STRING[15]=13:
        STRING[16]="B":STRING[17]="o":STRING[18]="r":
        STRING[19]="i":STRING[20]="s":STRING[21]=" ":
        STRING[22]="L":STRING[23]="a":STRING[24]="n":
        STRING[25]="d":STRING[26]="o":STRING[27]="n":
        STRING[28]="i"
        STRING[29]=0 :STRING[30]=7 
        STRING[31]="3":STRING[32]=".":STRING[33]="0":
        STRING[34]=".":STRING[35]="1":STRING[36]=".":
        STRING[37]="6"
        STRING[38]=0 :STRING[39]=3 
        STRING[40]="W":STRING[41]="e":STRING[42]="b"
        STRING[43]=27
        STRING[44]=0 :STRING[45]=0 :STRING[46]=0 :
        STRING[47]=0 :    STRING[48]=0 :STRING[49]=0 :
        STRING[50]=0 :STRING[51]=0 :   STRING[52]=0 :
        STRING[53]=0 :STRING[54]=0 :STRING[55]=3
        STRING[56]=0 :STRING[57]=0
        STRING[58]=CID3
        STRING[59]=CID2
        STRING[60]=cid1
        STRING[61]=cid0
        
        STRING[62]=LAC3
        STRING[63]=LAC2
        STRING[64]=LAC1
        STRING[65]=LAC0
        
        STRING[66]=MNC3
        STRING[67]=MNC2
        STRING[68]=MNC1
        STRING[69]=MNC0
        
        STRING[70]=MCC3
        STRING[71]=MCC2
        STRING[72]=MCC1
        STRING[73]=MCC0
        
       STRING[74]=0 :STRING[75]=0 :STRING[76]=0 :
       STRING[77]=0 :    STRING[78]=0 :STRING[79]=0 :
       STRING[80]=0 :STRING[81]=0
       for tmp=0 TO 81
             SEROUT2 TXPC,6, [#TMP,32,STRING[TMP],32,
             #STRING[TMP],32,HEX STRING[TMP],13,10]
             HSEROUT [STRING[TMP]]
        NEXT TMP
        HSERIN 20000,INVIOCELLTOCOOEXIT,
        [skip 230,wait (21),STR BUFF\22] 
        LATddddd.byte3=buff[5]
        LATddddd.byte2=buff[6]
        LATddddd.byte1=buff[7]
        LATddddd.byte0=buff[8]
        
        LONddddd.byte3=buff[9]
        LONddddd.byte2=buff[10]
        LONddddd.byte1=buff[11]
        LONddddd.byte0=buff[12]
            
        RAGGIO.byte3=buff[13]
        RAGGIO.byte2=buff[14]
        RAGGIO.byte1=buff[15]
        RAGGIO.byte0=buff[16]
    
    
  • freddy

    THANK YOU BORIS, BUT I DON’T UNDERSTAND SOMEONE THINGS ABOUT THE QUERY IN THE GOOGLE.COM, I READ ABOUT OF YOU: GPS RECEIVER?… NO LONGER NEEDED! GSM LOCALIZER, AND I’M TRIYING TO UNDERSTAND THIS PART, (OF THE HTTP CODE AND MORE, OF GOOGLE, API)
    MY BEST REGARDS

  • http://www.open-electronics.org Boris Landoni

    I ask to google maps the coordinates of the GSM cell. To do this I use the POST method (POST /glm/mmap HTTP/1.1) and I send the cell data. Then google gives me the coordinates of the main cell.
    ASAP I’ll publish a PHP page to understand this.
    Stay connected. ;-)

  • http://ahmetalpat.com Ahmet Alpat

    Hi Boris,

    Why are the 17,19 pins of module are connected to Vcc? They seem GND and MIC_P, and why 20 to GND?

  • http://www.open-electronics.org Boris Landoni

    Please pay attention. :-) The pin out in this schematics isn’t for the SIM900 but for the small GSM breakout http://www.open-electronics.org/small-breakout-for-sim900-gsm-module/

  • http://ahmetalpat.com Ahmet Alpat

    :D OK, sorry, i got it :)

    • Haim Rodrik

      they have two types which seem very similar , in the beginning its confused me. If you need more that that write me, i can help

  • skadd4life

    Hi Boris,
    So, do you actually do the triangulation, or does Google? I read the above code, but I figured I would ask since it is probably quicker than reverse engineering myself :)

    I ask this because based on the method of “triangulation”, the location accuracy can change. I read on the wikipedia page that the Cell ID method is the least accurate.

    However, if Google is doing the locating, then we are at an advantage because they are always improving their methods.

    Thanks!
    Crystal

  • http://www.open-electronics.org Boris Landoni

    Hi
    I’m using Google.
    I heard that Google has a system to locate with more that one cells http://code.google.com/intl/it-IT/apis/gears/geolocation_network_protocol.html
    but this system is deprecated…
    Now I ask directly to goole the coordinate.
    If you find a new system we can built a new localizer.

  • Bhavin

    Hi Boris,
    I am working on an application where sim900 based localizer fits perfectly.
    The difference is the location sms needs to be send to one of the pre stored number when a local interrupt occurs (logic transistion on the pic pic) and not when an sms is received.
    How big changes will be required in the software?
    Do you know anyone who may be willing to do this probably for a fee?

  • http://www.open-electronics.org Boris Landoni

    Hi, this localizer has got also a switch. When you press the button a SMS alarm (with coordinates and SOS text) is sent.

  • Mat

    Hi!

    Could you give more information about switches? I want to buy but I don’t know which model is correct ;)

  • Pranav

    Hi Boris,

    i made a similar board as yours and observed a strange issue. When sim module is connected to gprs and at the same time sms is received it crashes.
    can you advice what could be the fault? i also tried increasing the electrolyte capacitors from 1 to 5 470uF capacitors but it didn’t helped

    Thanks
    Pranav

  • http://www.open-electronics.org Boris Landoni

    Hi, I didn’t find problem with GPRS connection and SMS, I don’t know what could be happened.
    Doyou have other information?

  • jackjr

    Hi Boris,

    There is something I don’t understand in your circuit.
    The SIM900 UART works at 2.8V levels. But you are using a 3.6V power supply.

    How can this be?

  • RandomWireMan

    Hi Boris,

    I am working on a similar project also with a SIM900 module.
    If I read ‘AT+CREG?’ i get ‘ +CREG: 2,1,”2775″,”A225″‘ which translates to me as 41509(dec) for cellid and 10101 for lac.
    This gives me wrong coordinates though. If I use my mobile(CellIDCollector),it tells me 7401133(dec) for cellid and 11528(dec) for lac. This gives me the correct coordinates.
    Can you tell me what I am missing here?

    Thanks a lot

    RandomWireMan

  • RandomWireMan

    Hi Boris,

    I was firing away too quickly. Googles and sonys location api work with both versions of the cell-id. Only OpenCellIDs api doesn’t work on the version I get with my sim900 module. Looks like a database problem.
    Do you think it is possible that different modules spit out different cell-ids?

    Cheers,

    RandomWireMan

  • http://www.open-electronics.org Boris Landoni

    @jackjr
    Yes you are right, but is also 3.6 volt tollerant.

    VBAT:
    Vmax= 4.5V
    Vmin=3.4V
    Vnorm=4.0V

    Serial Port
    VILmax=0.15 *VDD_EXT
    VIHmin=0.85*VDD_EXT
    VILmin= 0V
    VIHmax= VDD_EXT
    VOHmin= VDD_EXT-0.1V
    VOLmax=0.1V
    VOHmax= VDD_EXT
    VOLmin= 0V

  • http://www.open-electronics.org Boris Landoni

    @RandomWireMan
    I tried also OpenCellID, but Google has a more detailed database….
    You can do some test with my page:
    http://www.open-electronics.org/how-to-find-the-location-with-gsm-cells/

  • Mrunal

    Good work! and thanks for sharing!!! but If I could get to know the code then its better than good…!

  • Ping

    I am interested with this Mini GSM localizer without GPS. However, I would like to integrate it with my own GPS tracker. Is that possible? Can I modify the programming to suit my requirement? The USB port in this circuit is for programming purpose or other purpose? This circuit requires external antenna?

  • aniruth

    i am in need of this gsm localizer…. send me the detail of your store and about your process to rar_ani@rediffmail.com

  • samustafa

    my project is to detect a threat when someone passes the IR, or when someone disable the camera, is it work on my project??

    • BorisLandoni

      This is a localizer with GPS/GSM system

  • Crystal

    Hi Boris,

    You say you are are using Google to the triangulation, but at what point? The localizer isn’t necessarily connected to the internet, so at what point does the connection to Google happen? The receiver, who may have a smart phone, may have the internet connection but it looks like the receiver gets a text of coordinates that already have been Google-processed. Can you please clarify?

    Thanks!
    Crystal

    • BorisLandoni

      this localizer hasn’t the GPS so the GSM cells date are sent to google tu convert them into coordinates

  • Opeolu Sawyerr

    Can this be used anywhere on the planet?

    • BorisLandoni

      The SIM900 and SIM908 are quad band ;-)