element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Arduino Mega + GPRS shield serial communication
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 3 replies
  • Subscribers 392 subscribers
  • Views 1379 views
  • Users 0 members are here
  • mega
  • v1.1
  • sim900
  • icomsat
  • gprs
  • serial
  • 2560
  • arduino
  • communication
Related

Arduino Mega + GPRS shield serial communication

ivars88
ivars88 over 11 years ago

Hello!

Im having difficulties reading data from SIM900 module.

I am using IComSat v1.1 - SIM900 GSM/GPRS shield for Arduino modul and connecting it to Arduino MEGA. 19 pin(RX1) of Arduino i connect with moduls TX7 and Arduino 18 pin(TX1) with RX7. Below is the picture showing it.

http://www.bildites.lv/images/0jjlmdpljb2o79p0c3d2.jpg

 

 

 

Dont worry about power, i also used 72VA power supply, it didnt worked also. Modem doesnt need such current as recomennded for serial communication.

Tx from Arduino works because i can make call and send sms, but in serial port monitor i cant see no data coming from SIM900.

 

 

As im not sure there's a problem in programm or hardware i added my sketch below. Basically there is 4 cases - 2nd case calls and hangs up, in 3rd im asking is there any sms and in 4th case im asking signal quality. In 3rd and 4th case atleast something needs to be showing in serial port monitor but nothing..

 

 

I also used lines like this for data reading from SIM900, but none of them worked.

if (mySerial.available())

{

   Serial.write(mySerial.read());

}

 

 

if (mySerial.available() > 0)

{

  Serial.println(mySerial.read());

}

 

 

if(mySerial.available() >0)

  {

    incoming_char=mySerial.read(); //Get the character from the cellular serial port.

    Serial.print(incoming_char); //Print the incoming character to the terminal.

  }

}

 

 

Complete code:

 

#include <SoftwareSerial.h>

 

 

SoftwareSerial mySerial(19, 18);  //Arduino 18 pin(TX1) and 19 pin(RX1)

 

 

int LED = 13;

 

 

void setup()

{

pinMode(LED, OUTPUT);

Serial.begin(19200);

mySerial.begin(19200);  // the GPRS baud rate

powerUp();

 

}

 

void powerUp()

{

pinMode(9, OUTPUT);

digitalWrite(9,LOW);

delay(1000);

digitalWrite(9,HIGH);

delay(2000);

digitalWrite(9,LOW);

delay(9000);

Serial.println("Modem powered");

}

 

void loop()

{

  if (Serial.available())

  {

    char inSer = Serial.read();

    switch (inSer)

    {

      case '1':      //Just for confirmation that incoming characters from serial port is reading

      digitalWrite(LED, HIGH);

      delay(3000);

      digitalWrite(LED, LOW);

      break;

 

      case '2':

      mySerial.println("ATD + +371200....;"); //Calling to my cell. I just deleted part of my phone number cus i dont want to shove it

      delay(100);

      mySerial.println();

      delay(7000);       

      mySerial.println("ATH");  //Hangup

      break;

 

      case '3':

      mySerial.println("AT+CNMI=?\r");  //asking for new sms message indication

      delay(100);

      break;

 

      case '4':

      mySerial.println("AT+CSQ=?\r");  //asking for signal quality report

      delay(100);

      break;

    }

  }

if (mySerial.available())

{

   Serial.write(mySerial.read());

}

}

 

 

 

I would be appreciated for help how to read data from SIM900 image

  • Sign in to reply
  • Cancel

Top Replies

  • theenggprojects
    theenggprojects over 10 years ago in reply to Former Member +1
    I think you should check this one out http://www.theengineeringprojects.com/2014/06/send-sms-with-arduino-uno-and-sim900d-using-at-commands.html They have explained in detail how to send sms with sim900D…
  • Former Member
    0 Former Member over 10 years ago

    Hi.

     

    I've been struggling with this one too. Even resorted to using Hardware serial, instead of sofware serial, using serial1, 18 &19 of the mega, from 1 & 2 of the Gsm/GPRS shield. switching the jumpers to Xduino on the shield. but I seem to be reading random data, although it shows that it has received an sms when I send it an sms on the serial monitor. I fail to output the sms on the serial monnitor.

     

    Maybe together we can strike some success.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • amgalbu
    0 amgalbu over 10 years ago

    I can think to two thinks

    1. Control signals: is the modem configured to ignore control signals RTS/CTS and DTR/DSR or it will start sending data only when DTR and CTS are asserted?

    2. Autobaud: is it possible that modem requires an "AT\r" command to detect host baudrate?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • theenggprojects
    0 theenggprojects over 10 years ago in reply to Former Member

    I think you should check this one out http://www.theengineeringprojects.com/2014/06/send-sms-with-arduino-uno-and-sim900d-using-at-commands.html

     

    They have explained in detail how to send sms with sim900D using arduino via AT commands, plus also have alook on this link http://www.theengineeringprojects.com/2015/02/receive-sms-commands-using-sim900-arduino.html ..... In the firsst link its given in detail how to send sms while in the second link it shown how to receive sms so I think combining both will solve the problem.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube