GPRS communication with Arduino and SIM300 DZ

Friday, 05 July 2013 03:54 Mada Jimmy
PDF
User Rating: / 3
PoorBest 
Article Index
GPRS communication with Arduino and SIM300 DZ
Connecting to Time Server using NTP
All Pages

Today I would like to share my experience about Arduino which communicates with GSM/GPRS module, SIM300 DZ from SIMCOM.   Before I start, let me explain the goal of this project.  I want to bring some values or conditions from sensor to the internet, particularly social media like Twitter, Facebook or other website.

 

Sensors and some LEDs are connected to digital input/output in Arduino board.  For GPRS communication, SIM300 module is connected to RX, TX, and Ground.  Note that SIM300 works with 3.3 Volt DC and Arduino Mega 2560 works in voltage 5V.  Thus, transmit (TX) pin from SIM300 cannot be sufficient to deliver the logic to receive (RX) pin at Mega 2560, so we have to raise the voltage.  I use a pull-up resistor and it works successfully.

In addition, we must pay attention to the power supply.  Because of some conditions, GSM/GPRS module needs a lot of energy to communicate to the Base Transceiver Station (BTS).  In the first place, I used 5VDC from Arduino board to supply SIM300.  I got a lot of error responses when I try to send SMS or bring the wireless up, for example CMS ERROR 517. This indicates that the SIM card is not ready.  But, in my opinion, the voltage is drop during communication with the BTS.  So, it is better to separate the power supply between Arduino and SIM300.  Now, I use 5VDC 2A to supply GSM board.  Note that GSM board has already 3.3V regulator and they work perfectly.

AT-Command

For detail information regarding how to communicate between host and SIM300, please google "AT Commands Set SIM300".   In this article, I want to show a brief description what commands have to send to the module.  BLUE TEXT indicates the commands are sent from Arduino to SIM300 module, and RED TEXT indicates the response from SIM300 to Arduino.

 

AT+CFUN=1

OK

(wait.....)

Call Ready

AT+CGDCONT=1,"IP","telkomsel"

OK

AT+CDNSCFG="208.67.222.222","208.67.220.220"

OK

AT+CSTT="telkomsel","wap","wap123"

OK

AT+CGATT=1

OK

AT+CIICR

(wait.....)

OK

AT+CIFSR

182.2.188.16

AT+CIPSTATUS

OK

STATE: IP STATUS

AT+CIPHEAD=1

OK

AT+CDNSORIP=1

OK

AT+CIPSTART="TCP","www.madajimmy.com","80"

OK

(wait.....)

CONNECT OK

AT+CIPSEND

>

GET /arduino/index.php?sinyal=75 HTTP/1.1 <send ASCII #13, #10>

Host: www.madajimmy.com <send ASCII #13, #10>

<send ASCII #13, #10, #26>

SEND OK

<responses>

CLOSED

 

Here are some important things:

 

  • It is recommended to set baudrate in the microcontroller to 115200.  SIM300 has autodetect baudrate, so you don't need to worry.
  • Be sure that the APN, username and password are correct, depend on your mobile operator.
  • Before sending AT+CGDCONT you must be sure that Call Ready is shown.  The response of commands must be OK (not ERROR) , otherwise you sould retry form the beginning.  Please try to send AT+CFUN=0 first then AT+CFUN=1. After that, wait for Call Ready.
  • When you send AT+CIPSTATUS, the response from SIM300 should be STATE: IP STATUS, otherwise send AT+CSHUT (Deactivate GPRS PDP context) then retry to send from AT+CGDCONT.
  • After sending AT+CIPSEND , the response must be > . Then you can type hypertext protocol command (GET, PUT etc..).  Be sure to add ASCII character #13 and #10 in the end of each line, and before finishing it, send again character #13, #10  and finished by char #26 (EOF).

 



Last Updated on Sunday, 04 May 2014 07:39

Dreamstime

Stock Images