Introduction: Arduino & Sony Ericsson: Gsm Shield Hack2

Hi! A while back i wrote an instructable on how to use an old sony ericsson with arduino to read an incomming sms and perform an action depending on the content of the message (link). Or as simply shown in the video in the instructable: let the arduino turn the light on by sending an sms to an old phone! In this instructable i'll explain how to send an sms using arduino with an old sony ericsson.

Note: I consider this instructable to be an expension of my first instructable on this subject so in won't go through the setup (step 2 to 5 of my previous instrubtable). I strongly recommend reading it first if you're interested (it feels useless to just repeat the setup and al the other stuff over here).

Step 1: Setup a Connection!

just read my previous instructable from step 2 to 5. If you're interested in reading an incomming sms using an old sony ericsson phone i suggest reading the full instructable.

Step 2: Simply Use an Online PDU Encoder!

Just like in my previous instructable we'll be using:

http://www.twit88.com/home/utility/sms-pdu-encode-...

The encoder allows you to make a PDU coded string with the phone number of the person you want to send a message to and the message itself. Once we have that PDU coded string we just simply send it to the sony ericsson using the arduino. This way you can by example let the sony ericsson send you a message to you when the arduino detects something; rising water, temperature, movement,.. You name it! Just follow these steps to create a correct PDU coded string:

  1. Fill in 0 in the SMSC area (we don't need this)
  2. Fill in the number of the cellphone you want the arduino to send a message to (don't forget country node)
  3. .Set the Alphabet Size on 7 if it isn't already
  4. Lets start with filling in Hello world
  5. Press convert
  6. Copy the AT+CMGW=XX (XX can be any number)
  7. Copy the PDU coded string
  8. Fill the data in the right place in the program (see next step)

Step 3: The Program!

It's even hardly a program, it's just a few lines of codes, it's really easy!

insert in the setup of the program:

Serial.begin(9600);

Serial.println("AT+CMGF=0"); //sets the phone in PDU mode

delay(3000); //processing time

insert anywhere in the program: (not in the loop!!! you'll keep sending texts!)

Serial.println("AT+CMGW=24"); //copy from previous step

delay(3000); //processing time

Serial.print("0011000B912321436587F90000AA0BC8329BFD065DDF723619"); //copy from previous step

delay(3000); //processing time

Serial.write(26); // I don't know why this has to be here

delay(3000); //processing time

AND DONE! You now have send a sms to someone using arduino!

You can insert these lines of code in your program wherever you want to send an sms. I suggest not using the loop for obvious reasons. Note: unlike my previous instructable you'll be able to use the SoftwareSerial! But be aware that by using the Software serial you'll only be able to send a message but not read an incomming one due the small buffersize.

Step 4: You're Done!

Yep it's that simple..

If you do have some problems i recommend going over step 2 to 5 of my previous instructable, if you succeed in the test dial of step 5 you have successfully established a working connection between the arduino and sony ericcson. Make sure you put the needed lines of code (see step 2) into the setup of your program. If you have a working connection but still have problems it can only be a software error (as far as i know).

Good luck, feel free to contact me if you have a problem.

Support me by voting!