Introduction: How to Send an SMS Text From a GSM Chip Using Putty

Picture of How to Send an SMS Text From a GSM Chip Using Putty

I want to be able to program the AI-Thinker A6 GSM module for one of my projects. As part of the learning curve, I set out to send a simple sms text message from the GSm module to my cell phone from a terminal emulator on MS Windows. I was aware that they ran on a 2G network which some may consider redundant, but it will be around in the UK for some time to come.

Step 1: Required Components

Picture of Required Components

Here is what you need:

1. A6 - GSM/GPRS module - circa 4 dollars from Aliexpress. https://www.aliexpress.com/snapshot/0.html?spm=a2...

2. FTDI basic from Sparkfun or equivalent.

3. Registered sim

4. Male- female Connectors

5. MS Windows Laptop or PC running Putty

Step 2: Connecting the Hardware

Picture of Connecting the Hardware

Firstly, fit the micro sim into the device. To do this lift the small hinged sim gate and slide in the sim and then lock. Note that the sim gate has two positions - open and locked and be careful, the sim gate can easily break. I also ensured, by using my smart phone, that the sim was registered and had sufficient credit. My UK Vodafone sim met these requirements.

Connect the following

FTDI TX <------> A6 UART_RXd

FTDI RX <------> A6 UART_TXd

FTDI GND <------> A6 GND

=========================

A6 PWR <-----------> A6 VCC 5.0

A6 RST <-------------> A6 GND (Do not connect to ground yet!!!!!)


Step 3: Power the FTDI Unit and the A6 GSM Unit

Picture of Power the FTDI Unit and the A6 GSM Unit

Firstly, connect the FTDI unit into a usb port on the laptop and then connect the GSM unit to the mains with a micro-usb charger (The official documentation states that 5V / 2A is required to power the GSM unit but I was able to power it with other micro-usb chargers). Next, open Windows Device Manager and find out which comms port the FTDI unit has been assigned.

Next, open up Putty and select the serial option and then type commX where X is the comms port that was shown in the Windows Device Manager. Change the speed to 115200. Click open keep this Putty window.

Step 4: Operation

Picture of Operation

Now you have the Putty window open, you shoudl see a blank screen. next, connect the cable connected to the RST pin on the A6 GSM unit and touch the GND pin beside the VCC pin. After a few seconds, you should see the following lines appear-

^CINIT: 2, 32, 41891

^STN: 37

^CINIT: 4, 8192, 37

^CINIT: 8, 2048, 1

^CINIT: 16, 0, 1638450

^CINIT: 32, 0, 0

+CREG: 0

After another 5-10 seconds, you should see the following lines appear,

^CINIT: 1, 0, 0

^CINIT: 2, 32, 41891

^STN: 37

^CINIT: 4, 8192, 37

^CINIT: 8, 2048, 1

^CINIT: 16, 0, 1638450

^CINIT: 32, 0, 0

+CREG: 0

+CIEV: service, 1 +CIEV: roam, 0

+CREG: 1

The last command is very important as +CREG: 1 means that the sim/ GSM unit has been registered on your Telecom carrier's network (e.g. Vodafone), and you are able to communicate with other devices.

You need two simple command sets to send your first sms text.

TYPE AT+CMGF=1

YOU SHOULD SEE OK

NEXT TYPE AT+CMGS="+XXXXXXXXXXXX" replacing the number enclosed in quotes with your number

You will be presented with a ">" prompt

Starting typing your message and then hit return. The cursor will move to the left of the line. Now type the "Ctrl" and "Z" keys and then wait.

You should then receive a successful message +CMGS: XX - where XX is a unique code

============================================

Good luck, you have sent your first sms message and are ready to start programming ur GMS/GPRS solution.

Comments

mmuetze (author)2017-09-24

I'm not able to type something after "+CREG: 1".

Any idea why?

scanos (author)mmuetze2017-09-24

Hi, if you see "+CREG: 1" that is positive because it means you are connected on your mobile network. There are a number of things which could go wrong after that. Firstly, I have found that the FTDI basic from Sparkfun has very poor connections and quite often one of the cables slips out or comes loose.The other is that, in my experience, the GSm unit has lost power which is less unlikely. How are you powering the Sparkfun and GSM unit.

scanos made it! (author)2017-08-12

Please note that a lower cost (circa 2 dollars) USB 2.0 to TTL UART 6PIN Module Serial Converter may be used instead of the Sparkfun FTDI convertor.

jwzumwalt (author)scanos2017-08-16

Yes I keep 4 or 5 on hand, $0.75 cents and free shipping. It takes about a month to receive it from China.

https://www.aliexpress.com/item/Free-Shipping-CH340G-CH340-Serial-Converter-USB-2-0-To-TTL-6PIN-Module-for-PRO/1901973988.html?spm=2114.search0104.3.2.w5rkK5&ws_ab_test=searchweb0_0,searchweb201602_1_10152_10065_10151_10068_10130_10084_10083_10080_10307_10082_10081_10110_10178_10137_10111_10060_10112_10113_10155_10114_10154_10056_10055_10054_10312_10313_10059_10314_10315_10316_100031_10099_10078_10079_10103_10073_10102_10052_10053_10142_10107_10050_10051-10152,searchweb201603_15,ppcSwitch_7&btsid=afd6d23f-3c1c-4344-97b5-f36fe422fa19&algo_expid=405a6173-d753-4b92-9eec-bbf3c95ccb2c-0&algo_pvid=405a6173-d753-4b92-9eec-bbf3c95ccb2c&transAbTest=ae803_3

About This Instructable

2,563views

58favorites

License:

More by scanos:1.5 Dollar Attiny85 - HOW TO PROGRAM ITHow to Send an SMS Text From a GSM Chip Using Putty How to transfer files by Bluetooth from a Raspberry Pi to a Windows Laptop
Add instructable to: