I'm new to this arduino world. I'm trying to communicate with my arduino nano and SIM800L. I read few things in the internet and found a basic code. I tried copying it and tried to work it out, but I'm not getting the response as expected. I'm posting the code which I tried:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(11, 10); // RX, TX 

void setup()  
  // Open serial communication

  // set the data rate for the SoftwareSerial port

  Serial.println("Testing SIM800L module");
  Serial.print("Sizeof(mySerial) = "); Serial.println(sizeof(mySerial));


void loop() // run over and over

  if( mySerial.available() )
    char c = mySerial.read();

    String Arsp = Serial.readString();

    Serial.println("Serial available");
    Serial.println("Serial available end");


I tried to send AT command and the output I received was:

Testing SIM800L module

Sizeof(mySerial) = 31

Serial available

Serial available end

I don't get OK, which I should receive, it's returning empty.

I don't understand what's going wrong. Can someone help me with it?

  • \$\begingroup\$ Have you checked the baudrate of SIM800? \$\endgroup\$ – Abel Tom Oct 5 '17 at 9:14
  • \$\begingroup\$ Yea, it's 9600. \$\endgroup\$ – Electronic Brat Oct 5 '17 at 9:20
  • \$\begingroup\$ @AbelTom: I've updated my question. Take a look. \$\endgroup\$ – Electronic Brat Oct 5 '17 at 9:22
  • \$\begingroup\$ How are you resetting the SIM800L? A link to the SIM800L module that you're using may help, since there are many available. \$\endgroup\$ – Steve G Oct 5 '17 at 9:31
  • 1
    \$\begingroup\$ @AbelTom As far as I remember sim800 doesn't work @ 5 V. It is some small range around 4V \$\endgroup\$ – MaNyYaCk Oct 5 '17 at 13:24

Just include '\r\n' after command AT.

For example (test the code below):

at_cmd_return = sim800.readString();



Use #include <string.h> at the start since you can't use any string without the initialisation. Otherwise, your code should be working.

  • \$\begingroup\$ i mean use #include string.h. \$\endgroup\$ – alex mwita Nov 18 '17 at 15:09
  • \$\begingroup\$ Its been a while since I did any work with the arduino libraries, but my recollection is that string functions are included automatically without needing a header. \$\endgroup\$ – Jules Apr 22 '18 at 19:37

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.