- How to Adjust X and Y Axis Scale in Arduino Serial Plotter (No Extra Software Needed)Posted 2 months ago
- Elettronici Entusiasti: Inspiring Makers at Maker Faire Rome 2024Posted 2 months ago
- makeITcircular 2024 content launched – Part of Maker Faire Rome 2024Posted 5 months ago
- Application For Maker Faire Rome 2024: Deadline June 20thPosted 6 months ago
- Building a 3D Digital Clock with ArduinoPosted 11 months ago
- Creating a controller for Minecraft with realistic body movements using ArduinoPosted 12 months ago
- Snowflake with ArduinoPosted 12 months ago
- Holographic Christmas TreePosted 1 year ago
- Segstick: Build Your Own Self-Balancing Vehicle in Just 2 Days with ArduinoPosted 1 year ago
- ZSWatch: An Open-Source Smartwatch Project Based on the Zephyr Operating SystemPosted 1 year ago
Mini GSM localizer without GPS
It’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.
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.
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.
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 2×10 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.
68 Comments