Interfacing Arduino to USB GPRS modem

Cheap GPRS modem from Dealextreme

Cheap GPRS modem from Dealextreme

Some time ago I started writing about connecting Arduino to cellular network. Using standard GSM AT commands, a program running on Arduino can place and take calls, send and receive SMS, shoot pictures, access the Internet while monitoring phone’s battery level, signal strength and connection status. For many of these tasks any old phone works quite well, however, there are times when a specialized piece of hardware is desired. Today I’m going to talk about one such piece of hardware which can be connected to Arduino board using USB Host Shield.

USB Tri-band GPRS Modem from DealExtreme is just an ordinary GSM cell phone minus keyboard, display, battery, and built-in microphone/speaker. What is left makes inexpensive (~$25), lightweight (25 grams) and compact (see title picture) GSM/GPRS module to use in DIY projects. It supports a standard subset of GSM commands as well as some proprietary ones. The modem is built around BenQ M23 GSM/GPRS Wireless module and uses Prolific PL-2303 USB-to-serial converter. As explained on this page, the PL-2303 in the modem uses non-default USB PID; make sure to grab the latest version of my library, which transparently supports both PIDs.

To explore the functionality of this device I wrote a simple program which is based on Xbee terminal. The program initializes the PL-2303 and waits for user input passing keystrokes to the modem and displaying replies to the screen. Let’s run it and see what this little modem is capable of.

Continue reading Interfacing Arduino to USB GPRS modem

Interfacing Arduino to a Cellular Phone

Motorola RAZR talks to Arduino

Motorola RAZR talks to Arduino

One of the main motivations for adding asynchronous CDC support code to rev.2.0 of USB Host Library was to be able to use cell phones in Arduino projects – establish simple data exchange via SMS, take pictures or connect to the Internet. Second hand phones are inexpensive yet quite capable. Also, m2m (machine to machine) SIM cards start at $4-$6/mo, some even allow for free incoming SMS. All that makes a cell phone an attractive communication option for hobby projects. In this post, I will be talking about basics of cell phone control using data port and AT commands. I will also present simple terminal emulator sketch – to use the code you will need an Arduino board, USB Host Shield, as well as USB Host Shield 2.0 library.

Modern (<10 year old) phones have standard GSM chip interface implemented and accessible via so-called “data port”. The oldest phones implement TTL level asynchronous serial interface by means of “custom” USB data cable, which is just proprietary connector on one end, standard USB connector on the other end, and USB-to-serial converter chip (almost always Prolific PL2303) between them. Newer cell phones have USB-to-serial converter built-in. Motorola phones usually terminate data port on standard mini-USB connector, others, like Samsung and Sony Ericsson, use proprietary cable. The USB-to-serial converter in these phones is almost always standard CDC ACM type.

Many functions of the phone can be accessed by AT commands, similar to commands used to control Hayes phone modems. Standard GSM commands are defined in 3GPP TS 07.07 (look for the latest version, which is 7.8.0). Cell phone manufacturers also define their own AT commands. In documentation AT commands are usually presented in uppercase, however, most phones accept lowercase just as well. A command shall be followed by CR,LF (usually Enter key). If a command is accepted, OK is returned, along with response. If command is not recognized, ERROR is returned. Some commands will be accepted in certain phone states and rejected in others.

Continue reading Interfacing Arduino to a Cellular Phone