Get Adobe Flash player
English Arabic French German Italian Portuguese Russian Spanish

Did you know?

According to Moore's Law, microchips double in power every 18 to 24 months.

Help us stay online:

small donate

gprs modem serial view clean-300In this article we will make introduction on how to add SMS/GPRS connectivity to your hardware design, advice on how to choose adequate modem as well as how to use it.

Almost every new hardware has some kind of connectivity available. Wireless connectivity has many advantages such as easy connection, no wires attached, no additional connectors and there for robustness (you would be surprised that for example micro USB connectors are declared to have only few thousand cable release cycles before subject to wear out).

If you have need for remote control or data transfer or you design mobile logging device GPRS connection is opposed as logical choice. For adding GPRS connection to your hardware you need GPRS/GSM modem. There are many producers and types of these modems on the market. Cinterion, Telit, Siemens.. are only some of them that I have been working with in the past.

First thing you need to decide is whether you will use GPRS or SMS only communication. Advantage of using GPRS is that you can transfer much more data and much faster for same costs as SMS and that you can make real time remote system control which is not the case when using SMS. In this example we will use both GPRS and SMS. SMS is better for urgent notification directly to your phone when something critical has happened while GPRS is far better to use for regular system control and data acquisition.

How to choose modem?

When choosing GPRS modem check first does it have TCP/IP stack built in! Most of new modems have it, but some old and cheaper modems do not have it. For example SIEMENS MC39i modem does not have integrated TCP/IP stack.

Modems are available to get as modules which need additional power supply and optionally voltage level shifters for communication lines (3.3V <-> +-12V). They usually look line ones on pictures below.

GPRS module only 1GPRS module only mc39i

Or you can buy module inside casing with DC input and USB or DB9 connector on it. This is easier to use since you do not have to make its power supply but they are not so miniature if this is your priority. Inside these casings are actually placed same modem modules mentioned above just with additional circuits needed for its proper work. Few such modems are shown on pictures below. For these modems you need to see which module is placed inside and actually search for module datasheet to check if it has integrated TCP/IP stack and other information. For example HCP HIT55 modem has inside CINTERION MC55i wireless module.

Telit GG863-SRES75 modemhit55 modem gprs

What does this means for user?

Let's say you choose modem without integrated TCP/IP ctack. When it is connected to for example server computer via GPRS you would have to take care of all TCP/IP stack meaning you have to read all packet headers, answer properly for this connection to work. This is hard work even for experienced engineers and I would recommend you to choose such modem for SMS communication ONLY!

If you need GPRS data transfer choose modem with TCP/IP stack built in. Such modems are



With these modems everything is much much easier. In this case when you open socket connection to PC for example you basically have direct connection. Everything you send over UART from microcontroller to modem PC receives and everything PC sends via internet, microcontroller receives via UART. Almost as you connected them directly via COM port and serial cable.

How to communicate with modem?

Each GPRS modem communicates via AT commands using UART. AT commands are instructions used to control a modem. AT is the abbreviation of ATtention. Every command line starts with "AT" or "at". That's why modem commands are called AT commands. Many of the commands that are used to control wired dial-up modems, such as ATD (Dial), ATA (Answer), ATH (Hook control) and ATO (Return to online data state), are also supported by GSM/GPRS modems and mobile phones. Besides this common AT command set, GSM/GPRS modems and mobile phones support an AT command set that is specific to the GSM technology, which includes SMS-related commands like AT+CMGS (Send SMS message), AT+CMSS (Send SMS message from storage), AT+CMGL (List SMS messages) and AT+CMGR (Read SMS messages).

How to start?

Different modems have different AT commands for its configuration but they are all very similar. For details on modem you are using see its datasheet. First make sure your hardware is configured correctly. Make sure you have correct power supply, your microcontroller or PC COM port is correctly connected to modem. If you use finished GPRS modules in casing with female DB9 connector you will need to use RS232 voltage levels for communication with modem. If you have signal directly from modem module (not DB9 connector) you need to use voltage levels of its power supply (usually 3,3V). When hardware is connected try to send AT<ENTER> to it. If everything is working modem will answer with OK

Send: AT \n

Receive: OK \n

When using UART you need baud rate to be same as modems. Some of the modems have auto baud rate option meaning it will detect your baud rate and answer in same standard baud rate (600,1200,2400,4800,9600,19200,38400,57600,115200). Others have default predefined baud rate speed which can be later changed via AT commands. Try with 9600 for start since it is often used.

In this article you got basic idea of what do you need to add GPRS connection you microcontroller and how to choose right modem for you. More details on how to use these modems and examples with complete codes and projects available for download will be written in next articles.