29 January 2010

The Tellit GM862 Cellular Module

    There are many challenges in the communications design for a high altitude balloon. With small standard antennas cellular service stops working anywhere between 20k - 40k feet. There are several arguments as to why, but the most accepted reason is that at altitude multiple cell towers begin to receive the cellular signal and the network becomes confused. Many balloon designs avoid the cellular problem by using amateur radio devices or HAM radio. There is certainly no problem receiving a HAM signal from high altitudes, but as the balloon descends to the ground the line-of-sight becomes obstructed and the communications link can be lost. In my opinion it is better to know where the balloon lands than to keep constant communication with it in the air. Of course both HAM and cellular could be used on the same balloon, but weight is also an issue. With all that in mind I decided to go with a cellular only solution and conduct some experiments with cantennas and waveguide antennas to combat the multi-tower problem.
    I chose to use the GM862 cellular module from Tellit because they are readily available, they include the SIM card connector on-module, and they use a built-in antenna connector. It's quite difficult to do impedance matching on a PCB when you don't have all of the professional tools for layout. The module can be bought with built-in GPS, but the SiRF III chipset is limited to operation below 60k feet. Since I'm heading to almost twice that altitude I won't be able to use that chipset. The cellular part of the module connects to a "data terminal" through a TTL level serial connection. That makes it very easy to experiment with the module using a computer and a TTL to RS-232 level sifter. The commands are in the standard Hayes AT modem commands with a few specialty ones. All of this is well documented in the Software User's Guide and the AT Reference Guide.
    When using the GM862 with a microcontroller things can get a bit tricky. A micro doesn't have a built-in serial buffer like a data terminal has, so there is lots of overhead in the code to capture all the data coming from the GM862 and deal with the data terminal style formatting. It can be a pain to parse the buffer for a status and I usually end up counting the number of characters I expect the module to return for a particular command. If I don't see the status I expected I dig deeper into error cases. It helps a lot if you turn off the GM862's echo feature. That way the commands you send aren't echoed back to you as you send them and there are less characters to confuse the returned data. The echo is enabled by default and can be turned off by sending the ATE0 command. Echo can be re-enabled by sending ATE1. Below is a list of commands you need to get a cellular call and SMS message going, quick and dirty!

Quick Start Cellular Call:
  • AT#AUTOBND=2    Sets the module to automatically scan all 4 cellular bands for a network
  • AT+CREG?    Checks if the module is registered on a network. You'll get "AT+CREG 1,0\r\nOK\r\n" if it's registered
  • AT+FCLASS=8    Tells the module that you are only making phone calls, if you don't use this you have to place a semicolon after your phone call command. Don't use this command if you are going to send SMS messages also.
  • AT#CAP=2    Tells the module to use the MT microphone input as the source audio
  • ATD {phone number} [; if you didn't use AT+FCLASS=8]   This starts the phone call. Sometimes the network requires the full 10 digit phone number with area code, so it's best to just put it all in there.
  • ATH   This will end the voice call.
Quick Start SMS:
  • AT+CMGF=1    This command sets the SMS editing mode to TEXT mode. If you understand PDU mode you can use that also, but I prefer to read and write in english.
  • AT+CPMS="SM"    This sets the module to store SMS messages on the SIM card
  • AT+CNMI=0,0,0,0,0    This command sets the notifications that the module sends out about SMS messages. The first zero disables notifications about incoming messages. The second zero disables notifications about messages being sent. The last three zeros deal with low-level network stuff and will probably always be zero for your project.
  • AT+CMGS="{phone number} This command tells the module to start a new SMS message. After the command is sent the module will return a command prompt (>) and then you enter the text you want to send. To actually send the message you must send CTRL-Z (0x1A in hex) to the module. 

No comments:

Post a Comment