Interfacing an AVR controller to a GPS Mobile Phone

Posted by on Jul 13, 2007 in avr, gps, gsm | 107 Comments

Update: Part II Using Google Maps with a Mobile GPS Tracker is online.

My goal is to build a kind of a mobile tracker. There are many different use cases you can think of but one of the obvious is a device, that is able to report where it is. This device can be put in your car and it could trigger an alarm, if the car got stolen. Actually it could tell you where it is.

There are already mobile tracking devices out there, but they seemed to be too expensive and too closed for my needs. Another option is one of these new Nokia N95 which have built-in GPS. They are really nice, but about 600€, which is not a bargain. So I decided to do my own.

IMGP1475

Materials

So my first idea was to combine a microcontroller with a GSM and a GPS modul. There are a lot of these modules over at Sparkfun, for example. Looking through their shop I found the Telit GM862, which is a GSM modul with an built in GPS receiver. That is what I wanted. And they sell great break out boards to make it easier for hobbyist to access these modules.

Here are some of the features of this GSM-GPS module:

  • Quad band GSM
  • 17mA average stand-by, 3.5mA in low-power mode
  • 250mA average operating current
  • SiRF III GPS Receiver Built In
  • Data, Voice, SMS, and Fax
  • Data speeds up to 57.6kbps
  • Supply voltage : 3.4-4.2V
  • CMOS Camera Capable
  • Python Interpreter built-in

Voice means you are not limited to mobile tracker applications. You could attach a speaker and a microphone to build a complete mobile phone!

So here is a list of what I purchased to get the first integration done.

  • Telit GM862-GPS modul, roundsolutions: 126€, or Sparkfun: CEL-07917, $183.95
  • GM862 Evaluation Board, Sparkfun: CEL-00277, $29.95
  • Quad band antenna, Sparkfun: CEL-00675, $7.95
  • GPS antenna 3V, Sparkfun: GPS-00464, $14.95
  • 2 interface cables for antenna, Sparkfun: GPS-00285, $8.95
  • optional: PolymerLithium Ion Batteries, Sparkfun: PRT-00341, $7.95
  • optional: LiPoly Charger, Sparkfun: PRT-00726, $16.95
  • ATmega8 microcontroller, ca. 2€
  • Resistors: 100, 10k, 22k, 27k, 2 x 47k, 2 x 100k, ca. 1€
  • Capacitors: 2 x 22p, 100n, 10u, ca. 2€
  • LED, 0.10€
  • Transistor, BC337, 0.10€
  • Prototyping board, 3€
  • optional: bread board

Summing up you get all parts at about 220€ or $286. Ouch! Who said, that tinkering with electronics is a cheap passion? But again, if you go this way, you can implement anything you can think of.

Circuit

Looking at the specs for the GM862, you realize, that it is more complex as you might have thought. A problem for me, still a beginner in electronics, were the different voltages used for the module. The power supply has to be 3.4-4.2V. Thats ok as an AVR can run on that voltage. But the serial port requires lower levels, 2.8V (CMOS). That means, you can not connect the UART of the controller directly to the module. You have to do some level translation. Fortunately this has already been solved over at Trackbox2.

Another point to mention is the power supply itself. It requires at least 2A for peaks. I used a LiPoly rechargable battery, which perfectly fits my needs. If you have to use 5V supply, you will have to use a capable voltage regulator and you have to deal with the CMOS voltage level issue as well.

GM862_circuit

As you can see, there are very few connections really required to the GM862. You have to connect the following on the breakout board:

  • RX, seriell modem communication
  • TX, seriell modem communication
  • RTS to ground, no handshake is used.
  • Status LED
  • On/off to power on the module
  • VCC and GND

Please keep in mind, that this is not an enterprise grade and production like circuit, so read any spec and guide before you assemble your components. You have been warned.

Operation

For now I am able to switch the module on and off, send text SMS through the module and fetch GPS positions from it. Here is an example GPS response:

Request GPS
AT$GPSACP got: AT$GPSACP
GPSACP: 131924.999,5333.9291N,00954.8841E,2.6,34.0,3,29.78,0.32,0.17,130707,07
OK

So now you know where I am living ;)

Conclusion
That’s it so far. It cost me quite some energy and money but was worth it. Next time more on software and how to talk to the GSM module.

IMGP1490

Links

Downloads

107 Comments

  1. Ian
    17. November 2008

    According the datasheet the GM862 runs on 3.8V (3.4V – 4.2V), but on the schematic it is shown connected to 3.3V. Is there a typo on the schematic, or are you running it outside of spec?

  2. Alex
    18. November 2008

    Good catch. It’s a typo. I used a 3.7V LiPoly battery to power it.

  3. AVRで作ったGPSモバイルフォンインターフェース基板 - cosacool
    26. June 2009

    [...] 持ち運べる携帯型のトラッカーは様々なところで大変便利なツールになります。愛車に取り付けて万が一盗難に遭ったらすばやく場所を教えてくれます。GPS内蔵の携帯電話を使う方法がありますが、あまりにも経済的な方法ではありませんのでGSMモジュールTelit GM862(GPS内蔵)とAVRマイコンを使って自作しちゃいます。>>tinkerlog.comより [...]

  4. 自制GPS追踪手机
    10. November 2009

    [...] 相关页面:http://tinkerlog.com/2007/07/13/interfacing-an-avr-controller-to-a-gps-mobile-phone/ This entry was posted in 嵌入式项目 and tagged AVR, GPS, GSM. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL. « FreeRTOS AVR GCC移植 [...]

  5. How to build a GPS receiver? | Cellphone Tracking Devices
    16. February 2010

    [...] Sounds like what you want is a GPS that you can get SMS messages from. There are several commercial out there but if you’re looking for a DIY solution, this might get you started: http://tinkerlog.com/2007/07/13/interfacing-an-avr-controller-to-a-gps-mobile-phone/ [...]

  6. Interfacing Arduino with a Telit GM862 « Meteo
    21. February 2011

    [...] Bluetooth, Wifi, XBEE and GPRS to name the most known. I had a Telit GM862-GPS module laying around, unused for some time already. It has GPRS and GPS capabilities, both accessible with AT commands. [...]

  7. Designing Gps devices
    13. August 2011

    [...] Clock GPS to SD-Card Data Logger GPS Repeater GPS-based universal clock generator GPS-logger Interfacing an AVR controller to a GPS Mobile Phone They should give you some ideas. I've seen GPS Modules for as little as $30 here, but depending on [...]