arduino mega 2560 and gsm sim 900

Hi..

How can i get the "OK" response by passing AT commands to GSM...

I am using arduino atmega 2560 and an external GSM SIM 900

Hi

You should be specific about each device you are using. I have a Freetronics Ethermega running well with NZ$30 SIM800 GSM module. To achieve my result I had to:

  1. Provide a separate 4.2 volt power supply able to deliver 2 amps - you cannot get that voltage and current normally off an Arduino board.

  2. Connect the SIM800 (2.8V) and Arduino (5V) serial interfaces together using a bi-directional logic level converter. I had to provide a 2.8V power source for that on the SIM800 side.

  3. And then develop a significant serial interface protocol so I could drive the SIM800 (including to send SMS messages) using AT commands generated dynamically by my Arduino Ethermega application.

  4. The application also receives SMS messages containing a range of commands and then responds to the commands including sending return SMS messages.

My application is an advanced prototype - I expect to develop it further to monitor refrigeration equipment using temperature sensors and possibly to switch equipment on and off - either automatically based on clock cycles, temperature readings or manually using SMS messages.

This is an activity log for the application cut from the serial monitor. All the >> prefixed lines are commands sent by my application to the SIM800 module - the first four are part of the setup() launch and are 100% application generated (hard coded) - the rest I entered into the serial monitor and the application extracted, parsed and/or translated them before sending them to the SIM800 module. You will see three SMS message receipts (commands TEMP, NETWORK and CSQ) and the responses in the log. I am using raw AT commands between my Arduino application and the GSM module - no GSM library is used.

Setup
Start Datetime: 15/09/12,18:18:30+48
OK
Initialise
>>ATE0
OK
>>AT+CMGF=1
OK
>>AT+CPMS?
+CPMS: "SM",0,20,"SM",0,20,"SM",0,20

OK
>> CLOCK
+CCLK: "15/09/12,18:18:33+48"

OK
>> SMS
SMS To: "0555666777"
Message: Test SMS Message from SIM800
OK
>
SMS Sent OK
>> TEMP
Temperature: 26.00
SMS Receipt
SMS From: "+645556667775"
Request: TEMP
SMS To: "+64555666777"
Message: Temperature: 22.00
OK
>
SMS Sent OK
SMS Delete
AT+CMGD=1,0
OK
SMS Receipt
SMS From: "+64555666777"
Request: NETWORK
SMS To: "+64555666777"
Message: +COPS: 0,0,"VODAFONE"
OK
>
SMS Sent OK
SMS Delete
AT+CMGD=1,0
OK
>> CLOCK
+CCLK: "15/09/12,18:30:25+48"

OK
>> VOLTS
+CBC: 0,84,4073

OK
>> NETWORK
+COPS: 0,0,"VODAFONE"

OK
SMS Receipt
SMS From: "+64555666777"
Request: CSQ
SMS To: "+64555666777"
Message: +CSQ: 22,0
OK
>
SMS Sent OK
SMS Delete
AT+CMGD=1,0
OK
>> SRAM
Min SRAM = 6449 (1743 Used)
SMS To: "0555666777"
Message: HOURLY MESSAGE: +CCLK: "15/09/12,19:18:30+48"
OK
>
SMS Sent OK

Regards

Catweazle NZ

interfacing gsm sim 900a with arduino mega 2560