0

I am trying to use SIM800 GSM Module with Arduino Uno.

ARDUINO DIGITAL PIN 9 is connected to TX of GSM Module
ARDUINO DIGITAL PIN 10 is connected to RX of GSM Module

ARDUINO is powered by PC USB GSM MODULE is powered by 12v DC Adapter.

I have tried the following code for making outgoing call: -

    #include <SoftwareSerial.h>
SoftwareSerial mySerial(9, 10); // RX, TX of Arduino Uno
void setup()
{
  mySerial.begin(9600);   // Setting the baud rate of GSM Module  
  Serial.begin(9600);    // Setting the baud rate of Serial Monitor (Arduino)
  delay(10000); //wait for 10 seconds
  mySerial.println("ATD9464XXXXXX;" ); //dialing my mobile number
  Serial.println("Calling"); // printing message on serial monitor
  delay(10000); // wait for 10 seconds
  mySerial.println("ATH" ); // hang up the call
  Serial.println("END"); // printing message on serial monitor
}
void loop(){}
//code ends here


This code is not working.

But if I directly connect GSM Module TX, RX to RX, TX of ARDUINO and the use the following code, it makes outgoing call and hangs up simply : -

    void setup()
{
  Serial.begin(9600); //setting baud rate of serial communication with GSM Modem
  delay(10000); //wait for 10 seconds
  Serial.println("ATD9464XXXXXX;" );  // dialing mobile number
  delay(10000); // wait for 10 seconds
  Serial.println("ATH" );  // hang up the call
}
void loop() {}
 //code ends here


Same issue is with sending / Receiving SMS also.
Can somebody guide me what is wrong with SoftwareSerial Library here in my code?

  • Code is hard to read, please re-format. What are you expecting the code to do instead of "dial/wait/hang up"? – tofro Apr 15 '18 at 6:28
  • @tofro Sorry for bad formatting. I have formatted the post / code and have added comments for easy understanding of code. – Jatinderpal Singh Apr 17 '18 at 22:43
  • next: "This code is not working" is not a very good bug description. What do you expect it to do and what does it do? – tofro Apr 18 '18 at 9:16
  • You might want to swap the terminal interface and the GSM one - because the latter one is the one you want to be reliable. You might also want to consider swapping SoftwareSerial for AltSoftwareSerial, which is known to be much more reliable. – tofro Apr 18 '18 at 9:23
  • did you connect arduino GND with GND of GSM shield . rest code seems correct . – Nikunj Feb 18 at 2:54

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.