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