Localizer with SIM908 module

The device is based on a GSM/GPRS module with included GPS. Its main function is to detect and communicate its own geographical position using, on the choice, the cellular phone reference system or the GPS. Its small dimensions are due to the use, for the first time, of a GSM/GPRS module integrating the GPS receiver. That is the SIM908 a recent product by SIMCOM.

Circuit schematic of the localizer

The circuit of the localizer is build around two boards, one with the SIM908 on board and the second one including the microcontroller and the battery charger for the lithium battery. To get the GPS working will be necessary to complete the localizer circuit with an appropriate antenna.

The circuit includes the mother board, mounting the microcontroller and its circuitry, and the daughter board mounting the communication module, the block named GSM in the schema. The reference numbers associated to the contacts on the GSM block correspond to the pins of the connector linking the daughterboard to the motherboard.

The program running in the microcontroller U1, one PIC18LF6722, waits for an incoming event or for the button P1 being pushed. While the button is pressed the line RB1, provided with internal pull-up resistor, switches from logical level 1 to the logical level 0,

In case of incoming of an SMS message, the program reacts depending on the content of the message that could be a configuration message or a geographical position request.

Let focus on the process aimed to retrieve the geographical position, that is quite the same in both cases of manual request and P1 pushing (alarm or S.O.S.). After the request has been detected, the program in the PIC microcontroller sends commands to the cellular module in order to have it connected to Internet in GPRS mode. Then connects to the Google Maps server and sends a request of position based on the identification of the cell the SIMCom module is connected to; then again loop waiting for data on the RX channel of the UART. While got data back with the position (Latitude and Longitude) and accuracy, it is a composed string with the appropriate link to Google Maps and sent to the requesting phone, or to the phone number stored in memory coupled to the alarm function.

If the cellular phone is an Android Smartphone or an iPhone, the link received in the SMS can open Google Maps directly on the area where the localizer is present. In the other cases the message contains the coordinates and other data.

The GSM module is managed by the microcontroller using the lines: RF1 (pin 8 on connector) through which it detects the incoming calls through the Ring Indicator (RI), RC7/RX1 (pin 14 on the cellular board); these last two are the lines, respectively, of reception and transmission of the UART used for receiving and sending SMS messages. The same two lines are used for managing the SIM908, unless the reset and power supply lines. Power supply is controlled by line RC2 that affects pin 1 of the cellular module in order to turn ON and OFF the SIM908 and to enable the phone after initialization. Lines cited before are common to the GSM and GPS section of SIM908.

Both the boards are powered by the switch SW1 from the 3.6 volt Li-ion battery connected to the + and – poles of the PWR connector.

Many capacitors inserted along the positive power line filter noises coming from the cellular during transmission, that could lock the microcontroller.

To save power, there is the features to “hibernate” the localizer for a maximum period of 240 seconds. This limits the power consumption of the micro and enables the possibility to put also the cellular in standby mode and reduce the system clock speed. In standby mode the cellular soaks only 6 mA of power. On SIM900 the Slow Clock can be enabled using the AT extended command AT+CSCLK=2. This command enables the Slow Clock mode automatically when there is no traffic on serial port and disabled it while new data comes in.

The microcontroller exits the “hibernate” mode when a new call come in or at the end of the period (240 seconds), in this case the microcontroller checks for possible SMS received. In the case, it executes and delivers the requests and, at the end, turn back in “hibernate” mode. While in “hibernate” mode the microcontroller can’t detect incoming SMS, this way a possible urgent request will be delayed until the microcontroller will wake up. To overcome this situation could be suitable to anticipate a phone call, may be of just one ring, and then send the SMS. The call will awake the microcontroller and the SMS will be detected immediately.

One specific application of the locator is its use as a motion detection sensor. In this mode the detection is based on the change of the cells the cellular is connected to, the microcontroller stores in memory the current cell and the neighbour cells; if the cellular commutes within these cells it means that it is almost standing still; if it commutes on cells outside the range in memory it means it is moving and, for instance, an alarm can be activated.

This approach can be little sensitive in case of scarcely inhabited lands with a little number of cells: in this case the motion, to be detected, requires a movement quite long.

The power supply comes from a 3.6 volt battery that can be charged by a miniUSB plug that allows recharge from any PC. The power regulator is the chip MCP73831T in SMD version (package SOT-23), it can supply up to 550 mA at 3.6 – 3.7 volt to fully charge a lithium or Li-Po battery with an input supply of 3.75 – 6 volt.

The chip charges the battery with a constant current. The charging current (Ireg) is set by the value of the resistor connected to pin 2, whose value is calculate as:

Ireg = 1.000/R

where the value of R is in ohm and Ireg in Ampere.

As an example with R of 4.7 kohm the current will be 212 mA, while with an R of 2.2 kohm the current will be 454 mA. While pin 5 is opened the chip goes into sleep mode and soaks only 2 µA (therefore the pin 5 can be used as enable).

The LED LD3, while ON means the battery is in charge, and when turns OFF, it means the battery has been fully charged.

The battery charger circuit is completed by the capacitors C1 and C2, while C1 filters high frequency noises and C2 filters alternate noises and stabilize the power to 5 volt.

The SIM908 is mounted on the board by a male connector of 20 pins, (two rows of 10 pins each) step 2 mm.

The active contacts of the connectors are:

the power supply, VCC on pins 17 and 19;

the power on control line (ON/OFF);

the serial communication lines to and from the GSM module (TXD and RXD);

the ground (GND) on pins 18 and 20;

the Ring Indicator.

In the electrical schema can be seen that the line ON/OFF is used by the microcontroller to manage the switching on and shutting down of the GSM1 module, that it is always under power, delivered by Vcc line on pins 55, 56 and 57 62 and 63; the line includes an internal pull-up resistor and goes ON at logical 0. Therefore, to switch ON the cellular module, the microcontroller have to put high the line ON/OFF (pin 1 on connector). This saturates the T2 transistor, that drive to low the line PWR of GSM1.

The control of reset is at switch-on time, therefore there is no reset line and the jumper J2 must be left open.

Now take a look at the lines reserved to communication. The SIM908 module has two different serial ports on board, one for the cellular section of the module and one for the GPS section. The first UART uses the pins 12, 14 and 10 of the connector; the serial port of GPS communicates on GPSTXD and GPSRXD lines (contacts 4 and 5). Actually the serial port on cellular allows the full management of SIM908 module, therefore it can be used to configure and communicate with the GPS receiver, in order to call for data about satellite status and geographical positioning, and to transfer them to the microcontroller. This is the approach followed in the design of this project.

From the GPSTXD/GPSRXD serial port flows a continuous stream of data in NMEA format, if the microcontroller would have used this source of data for the GPS, it would have been overloaded by data, loosing the possibility to perform the other functions.

Apart from serial communication lines, the IR line (pin 18) of SIM908 module it is used to keep the microcontroller informed about incoming calls.

There are also four audio lines on the module, two for the microphone, MIC1P and MIC1N, (pin 19 and 20) and two for the loudspeaker SPK1N and SPK1P (pin 21 and 22) that are not used in this project.

The antenna for the GSM module is connected directly to its own connector on SIM908 module. The module has a second antenna connector for the GPS antenna. Both active and passive antennas can be connected to the SIM908 module, in the first case the antenna can be powered directly by the module, by closing the jumper J1.

The transistor T1 it is used to drive the signal power LED, its base gets polarized by the logical level on the pin 52 (NETLIGHT) of GSM1 module. The collector of the transistor is connected to the pin 3 of the connector through which the microcontroller gets informed on the presence of the GSM network and on the quality of the connection.

At last the description of the SIM of the cellular phone, named SIM1 and positioned in the classical housing; the contacts on the card are SIM_CLK (clock), SIM_RST (reset) and SIM_DATA (data channel) while the line SIM_VDD (filtered by the capacitor C1) is used to switch on and off the SIM by the SIM908 module. The first three lines have resistors in series to protect the SIM908 module in case the SIM would be inserted incorrectly, short-circuiting the contacts.

Once completed and programmed, the localizer must be appropriately configured, using a common cellular phone. Some commands are password protected while other commands will be executed if coming from one out of the eighth qualified phone numbers stored in memory.

The same eighth phone numbers are the only qualified to ask for geographical positioning.

The predefined password (automatically set at every system reset) is 12345; it is possible to change the password with one of choice (five digit long) sending the command by SMS containing the text PWDnewpwd;pwd, where pwd is the current password and newpwd is the new one.

SIM908 seems to be a very powerful module, and it’s not expensive at all.

Vote Up0Vote Down Reply

6 years ago

Guest

inno

Dear Sir or Madam,
I would like to use the “Localizer with SIM908 module”http://www.open-electronics.org/localizer-with-sim908-module/
with arduino uno.
My main intention is to be able to retract the gps location and use the receive and transmit data to/from the arduino via the 3G modem.
1)Can I use this module?
2)Do I need an arduino shield ? (My main constrain is weight so if not needed it’s better)
3)What is each component weight?
Regards,
Inno

good news, we can work together to this projects.
Who know a platform to sharing projects?
I would like to create a very open source localizer, and I want the contribution of all people.
In facebook we have about 20000 fans.
I’m sure that a lot of people can help us.

I can provide the material. This is not a problem.

Vote Up0Vote Down Reply

6 years ago

Guest

Ankit Gupta

Hi Boris

Will you be adding downloadable gerber files & schematics for localizer with sim908 as you did for sim900 breakout.

The Firmware uploaded is of great help. It would be great if you could upload Gerber files if the designs are open source too.

Vote Up0Vote Down Reply

6 years ago

Guest

Ashwani

Hi Boris,

How I can share the eagle schematics with you? Please suggest or send me your email address.

Regards,
Ashwani Sihag

Vote Up0Vote Down Reply

6 years ago

Guest

sourient

Hi Boris,

Congratulations once again for its innovative design. Especially for the greatness to share their ideas and creations with us apprentices. Boris, tell me if your firmware is treating the southern hemisphere, since I had problems with previous versions of your browser. Big hug!

So at last i got the boards yesterday and assembled in night.
Sim908 with atmega328 working!!!! and sending AGPS location for now but adding some code for real gps coordinates.

A bit problem with power regulater(mic29302bu) … voltage jumping between 3 and 5 volt…fixing…works fine if I power the module directly with power 3.9v.

Regards,
Ashwani Sihag

Vote Up0Vote Down Reply

6 years ago

Guest

Ashwani

Hi Boris,

Files sent! Please check. Hope will help you in something.

Regards,
Ashwani Sihag

Vote Up0Vote Down Reply

6 years ago

Guest

Ashwani

Hi Boris,

Just for information that I was missing following lines and may be this is the reason I am not getting gps location. I will test this tomorrow and will see if it works or still I am missing something more.

@Ashwani
Thank you,
You do a good work. I’m studing a system to help you.

Vote Up0Vote Down Reply

6 years ago

Guest

Ashwani

Welcome Boris:-)

Hope you got answers for your all questions also.

Regards,
Ashwani Sihag

Vote Up0Vote Down Reply

6 years ago

Guest

Ashwani

Hi Boris,

I need a bit help. I have connected “antina out” to “antina in” and using a 3.3volt patch active GPS antina. Still I am getting “Location unknown”. Any hint whats wrong? The GPS pwr at command is also having status “1”.

Hi Puma,
please write in english ;-)
Do you solder the J1?
You need to power on the GPS and reset it.

Vote Up0Vote Down Reply

6 years ago

Guest

domnic

Hi Boris,
I found your post very usefull. I am currently using a PIC24F with the SIM908. I am having a small problem with the UART. The GPS TxD and RXD communicate with 57600 8N1. I was not able to get the PIC connected at this range and hence I reduced the baud rate to 19200 – works fine in my hyper terminal. But when I interfaced with my pic I do not get any response at all. what baud rate did you use in your project ?. did you have any frequency drifting on your adurino ?
thanks
Domnic

Hi,
I use a 20Mhz oscillator and so I’m able to reach 115200 Baud.
What the value of your crystal?

Vote Up0Vote Down Reply

6 years ago

Guest

Domnic

Thanks for your tip. I am using the internal Osc with the PLL.. it is generating 16 MHz. But I can scale up. The problem is – I am not sure what is the difference between the input value to the PLL and the generated Osc. Frequency. I am not having an Scope to measure this.

hi
i am live in iran & language is farsi
sorry for bad english
question: antena use in project is passive or active type
ask: please got bcb & schemaqtic in protel type (dxp or altium) for other pepole on other counties can make it werry well
thank you verrrrrrrrrrrrry much

Vote Up0Vote Down Reply

6 years ago

Guest

nima

hi
ask : in my country , mcu most haeve uses is avr type & pic is not use
plese learn how change it with avr mcu if maybe
thank you

Hello Boris Sorry this blog-post is going to be a bit long at first but I think you need to hear the full story: We are involved in a “Protect the Rhino” project here in South Africa. As you well know these animals are being poached (hunted) for their horns. The horns in turn are being ground to a powder, smuggled out of the country and mainly used as a traditional Asian medicine. Their numbers are dwindling on a monthly basis, so much so that by 2025 there will be none left! One of the problems experienced is that the… Read more »

Vote Up0Vote Down Reply

6 years ago

Guest

vipintruder

ave two questions: 1- Could be possible to do a personal web site to view the location in a google maps? Do you have any example for us? 2- I can see in the firmware code two lines say: — EEPROM 401,[“www.gpstracer.net/FT710/codifica.asp>80″]’/coordinate.asp?v1=Ciao&v2=Stefano&v3=Murru&v4=pippo>80”] ‘URL 401÷499 EEPROM 590,[“www.gpstracer.net/FT710/email.asp>80”] ‘SMTP 590÷680 — Could you explain us what is the function of this lines?, because I like not depend to this website in my project. I would like only depend from google maps. If you have an example to solve this will be excelent. Thank you very much for all your job. Best regards,… Read more »

Vote Up0Vote Down Reply

6 years ago

Guest

Ashwani

Hi Harald, I am also working on similar solution which will send locations twice a day and working fine except that my modules stops working sometimes when I use interrupt to weak up. I am using atmega328 with sim908. It weaks up, wait for satellite fix, send the location and sleeps again. All seems ok but will be nice if I get answer for my module failure on RX TX communication with sim908. It works fine if I am not using interrupt for atmega328. I am sure atmega328 is fine and something goes wrong with sim908. I have 20 modules… Read more »