Problem with SIM800L while serial port is diconnected

Hello all,

I am using an ARDUINO nano with sim800l module. I uploaded a simple sketch to send/receive SMS. While the usb cable is connected to my PC, every things goes well and I can send\ rceive SMS. after I detach the cable the project work well, but after unplug power supply and plug it again (or ever reset only the SIM800l), it doesn't send/receive SMS until I connect it to serial port again. the voltage of the moduleis 4.2 volt. Any one can help me?
My simple code is s bellow (which obtained it by googling)

#include <SoftwareSerial.h>
//SoftwareSerial mySerial(10,11); // (Rx,Tx > Tx,Rx)
#include <Sim800l.h>
#include <Wire.h>

#define RX 10
#define TX 11
#define SIM800_DTR 5 //SIM800 DTR pin

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

char incomingByte;
String inputString;
int relay = 13; // Output for Relay Control

void setup()
{
pinMode(relay, OUTPUT);
pinMode(SIM800_DTR, OUTPUT);
digitalWrite(relay, LOW); // Initial state of the relay
// Serial.begin(9600);
mySerial.begin(9600);

while(!mySerial.available()){
mySerial.println("AT");
delay(1000);
// Serial.println("Connecting...");
}
//Serial.println("Connected!");
mySerial.println("AT+CMGF=1"); //Set SMS to Text Mode
delay(1000);
mySerial.println("AT+CNMI=1,2,0,0,0"); //Procedure to handle newly arrived messages(command name in text: new message indications to TE)
delay(1000);
mySerial.print("AT+CMGR=1");
delay(1000);

mySerial.println("AT+CMGL="REC UNREAD""); // Read Unread Messages
delay(1000);
mySerial.println("AT+CMEE=1"); //Activate the extended error report
delay(1000);

mySerial.println("AT+CREG?");
delay(1000);

mySerial.println("AT+COPS=?");
}

void loop()
{

digitalWrite(SIM800_DTR, LOW); //wake up SIM900
delay(5000);//

mySerial.println("AT"); //A dummy command which sustains SIM wakeup.

delay(10);
mySerial.println("AT");
delay(10);
mySerial.println("AT+CSCLK=0");

if(mySerial.available()){
delay(100);

// Serial Buffer
while(mySerial.available()){
//digitalWrite(relay, HIGH);

incomingByte = mySerial.read();
inputString += incomingByte;

}

delay(10);

inputString.toUpperCase(); // Uppercase the Received Message
delay(1000);
//turn RELAY ON or OFF
if (inputString.indexOf("ON") > -1){
digitalWrite(relay, HIGH);
delay(2000);
}
if (inputString.indexOf("OFF") > -1){
digitalWrite(relay, LOW);
delay(2000);
// Serial.println("off!");
}

delay(50);

//Delete Messages & Save Memory
if (inputString.indexOf("OK") == -1){
mySerial.println("AT+CMGDA="DEL ALL"");

mySerial.print("AT+CMGR=1");
mySerial.print("AT+CMGDA="");
mySerial.println("DEL ALL"");

delay(1000);}

inputString = "";
incomingByte = "";
}
}

Please provide a detailed description of how the project is powered when the USB cable is not connected.

The power supply is 12v/3.5A. I used LM7805 to regulate voltage, follows by a 1N4007 diode to reduce voltage to 4.3v to feed SIM800L.
When the board is connected (and SIM800L is operational), disconnecting the serial cable has no effect on the operation and I can do every thing. While I reset the SIM800L or unplug\plug the power supply (the serial cable not connected yet), although the module blinks every 3s, but doesn't send or receive SMS.
If I connect the serial cable, every thing get normal!

What do you mean by "serial cable"? Are you talking about the USB cable?

My suspicion is that your power supply can't supply enough current for the SIM800L. The SIM800L's radio draws a lot of current and I don't think your setup is sufficient. When you have the USB cable connected, the computer is supplying power to the Nano, and I suspect the SIM800L as well, and that might be the difference between the SIM800L working and not working.

Dear Pert

Thanks for your answer. I think my12v power supply provides sufficient current for SIM800, since while I disconnect the usb cable, it can receive SMS without problem. The problem apearas after resetting SIM800 (by reset pin or unplug/plug power supply). It seems after resetting SIM800, it has to be connected to the usb serial port to get functional! and it confused me a lot!

Regards

Hi,

Did you manage to find a solution to this problem? I am experiencing the exact same issue and would appreciate any ideas on how to fix it.

Thanks.