Nano project not working correctly when using external power

Nano project not working correctly when using external power ..
I have an issue when running my project on an external power source rather than a USB connection, I’ve read a number of threads regarding his but have failed to resolve the issue.
Project : Controlling rol-down-shutter by sending SMS commands.
Herefore y use a SIM800L EVB (send/receive SMS commands), an Arduino Nano V3.0 as microcontroller and the Arduino 5V relais modules.
Powered by an external source and voltage input regulated by a LM 2596 DC-DC Step down converter.
The sms stuctures are "Up,12" "Down,12" "Status", where the number 12 is an indicator time in seconds how long the motor will turn.

The program is working without any problems when the project is connected with the USB serialcontroller of my computer and the external 5V regulated power connected to the 5V pin !
When I disconnect the Serial USB line with the computer, the project is still running without any problems on the connected external power.
But then comes the problem, when I disconect (or disconnection by power failure) the external power and reconnect the external power,
the NANO doesn't funtion correctly, like there is a rebooting problem ! The SIM800L connect to the network (receiving /send sms indicated activities) and the power LED on the Nano is working.
But there is no reaction on the Nano when receiving SMS from the Sim800L
After pushing the Reset Button on the Nano, it restart and everything works again normal!!!
There is some kind of rebooting problem with the Nano !
When I connect the Nano to the USB rather than the stepped-up battery supply, there is no issue, all the elements work as expected.
But powered only by external power source it doesn't boot or reboot (due to power failure or interrupt), I have to reboot by the Reset Button !

I have posted the code and circuit layout picture below (To make it simple only one relais on the picture).
I hope I have included enough detail but am happy to supply further information if required. Thanks in advance for your help and suggestions.

Greetings

/*
 SMS LED STURING V3
   https://github.com/ahmadlogs/arduino-ide-examples/blob/main/sim800l-registered-phone/sim800l-registered-phone.ino
   Wiring Guide
   ============
   GSM Module >  Sim800 L EVB
              Tx Pin >  2 Pin
              Rx Pin >  3 Pin
              Gnd Pin > Gnd Pin
              Vcc Pin > 5V (Power supply should be 2A !!! )

   Including Send SMS response based on Status rol-down-shutter
   Device 1  > 10
   Device 1  > 11
  Commands:  UP,xx  //    DOWN,xx  //   STATUS  // OK (delete received sms)     xx= sec
*/ 

#include <SoftwareSerial.h>

//GSM Module TX is connected to Arduino D8
#define SIM800_TX_PIN 2

//GSM Module RX is connected to Arduino D9
#define SIM800_RX_PIN 3

SoftwareSerial mySerial(SIM800_TX_PIN, SIM800_RX_PIN); //Create software serial object to communicate with GSM Module

int device_1 = 10; // attach pin D13 of Arduino to Device-1
int device_2 = 11; // attach pin D13 of Arduino to Device-2

// defines variables
int index = 0;
String number = "";
String message = "";
String response = "";
String Cmd = "";

char incomingByte;
String incomingData;
bool atCommand = true;

String TestSignaal = "";
 int dTMax = 18;   Max allowed movement time rrol-down-shutter
 String Msg;
 String MsgAction;
 String SendStatus;
 int n;      //plaats van ","
 int dT;     //MoveTime int    Movement Time  rol-down-shutter
 int StatusdT;

 String MoveTime;
 bool Status;    // rol-down-shutter Up = true   rol-down-shutter     Down = false
 bool MotMk;     //rol-down-shutter motor in action Marker
 bool MotStop;   //rol-down-shutter motor Stop Marker
 const String Phone = "+32xxxxxxxxxx";

 unsigned long StartTime;     // StartTime rol-down-shutter motor
 unsigned long Time;
//------------------------------------------------------------------------------------------------------------
void setup()
{
  Serial.begin(9600); // Serial Communication for Serial Monitor is starting with 9600 of baudrate speed
  mySerial.begin(9600); // Serial Communication for GSM Module is starting with 9600 of baudrate speed
  Serial.println("SMS LED STURING V3");
  Serial.println("------------------");
  pinMode(device_1, OUTPUT); //Sets the device_1 as an OUTPUT
  pinMode(device_2, OUTPUT); //Sets the device_2 as an OUTPUT

  digitalWrite(device_1, HIGH); //Sets the device_1 in to OFF state at the beginning
  digitalWrite(device_2, HIGH); //Sets the device_2 in to OFF state at the beginning


  // Check if you're currently connected to SIM800L
  while (!mySerial.available()) {
    mySerial.println("AT");
    delay(1000);
    Serial.println("connecting....");
  }

  Serial.println("Connected..");

  mySerial.println("AT+CMGF=1");  //Set SMS Text Mode
  delay(1000);
  mySerial.println("AT+CNMI=1,2,0,0,0");  //procedure, how to receive messages from the network
  delay(1000);
  mySerial.println("AT+CMGL=\"REC UNREAD\""); // Read unread messages

  Serial.println("Ready to received Commands..");
}   //  Einde SETUP
//--------------------------------------------------------------------------------------------------------
void loop()
{
  if (mySerial.available()) {
    delay(100);

    // Serial buffer
    while (mySerial.available()) {
      incomingByte = mySerial.read();
      incomingData += incomingByte; 
    }

    delay(10);
    if (atCommand == false) {
      receivedMessage(incomingData);
      Serial.println("Incoming Data = " +incomingData);
    } 
    else {
      atCommand = false;
    }

    //delete messages to save memory !!!
    if (incomingData.indexOf("OK") == -1) {
      mySerial.println("AT+CMGDA=\"DEL ALL\"");
      delay(1000);
      atCommand = true;
    }
    incomingData = "";
  }
  // Procedure Stop Motor   x seconds after StartTime     send sms as response in var Status
  if ((MotMk == true)  && ((millis() - StartTime) > (dT*1000)) ) {
      Serial.println("Stopaktie");
      //MotMk = true;MotStop = true;
      //Serial.print("StopTime =  ");Serial.println(millis());
      Serial.print("dT = ");Serial.println(dT);
      MotMk = false;
      digitalWrite(device_1, HIGH);
      digitalWrite(device_2, HIGH);
          if (Status == true) {
              response = "Rolluik OP uitgevoerd";
              Serial.println(response);}
          else {
              response = "Rolluik NEER uitgevoerd";
              Serial.println(response);
              }
   SendSMS(response);
  }
  delay(1000);
    
}   //Einde Loop
//------------------------------------------------------------------------
// Funties
void receivedMessage(String inputString) {

  //1. Get The number of the sender
  index = inputString.indexOf('"') + 1;
  inputString = inputString.substring(index);
  index = inputString.indexOf('"');
  number = inputString.substring(0, index);
  Serial.println("Number: " + number);

  //2.Get The Message of the sender
  index = inputString.indexOf("\n") + 1;
  message = inputString.substring(index);
  message.trim();
  Serial.println("Message: " + message);
  message.toUpperCase(); // uppercase the message received

  Analyse(message);   //Analyse(Incoming Signal SMS);

  //turn Device 1 ON
  if (message.indexOf("UP") > -1) {
    digitalWrite(device_1, LOW);
    digitalWrite(device_2, HIGH);
    StartTime = millis();
        Status = true;
        MotMk = true;
        Serial.print("Status = ");
        Serial.println(Status);
    delay(1000);
    Serial.println("Command: Device 1 Turn On.");
  }    
  
  //turn Device 2 ON
  if (message.indexOf("DOWN") > -1) {
    digitalWrite(device_2, LOW);
    digitalWrite(device_1, HIGH);
    StartTime = millis();
       Status = false;
        MotMk = true;
       Serial.print("Status = ");
      Serial.println(Status);
                            // Serial.print("Waarde StartTime = ");
                            //  Serial.println(StartTime);
    delay(1000);
    Serial.println("Command: Device 2 Turn On.");

    
  }
     
  delay(50);// Added delay between two readings
  if (message.indexOf("STATUS") > -1) {if (Status == false) {
        Serial.println(StatusdT);
        SendStatus = "Rolluik Dicht,";
        SendStatus.concat(StatusdT);       
        Serial.println(SendStatus);
      }
      if (Status == true) {
        Serial.println(StatusdT);
         SendStatus = "Rolluik Open,";
         SendStatus.concat(StatusdT);      
          Serial.println(SendStatus);
        }     
   }
  }    //  Einde Received Message
//-------------------------------------------------------------------------------
void Analyse(String message){
   Serial.println("Fie Analyse "); 
   Serial.println("------------");
   //Serial.println("Analyse TestSignaal");
   //Serial.print("TestSignaal is  ");

   Msg = message;
                         //Serial.print("dTMax = ");
                         //Serial.println(dTMax);
                         //Serial.print("Msg = ");
                         //Serial.println(Msg);
   n = Msg.indexOf(",");
   MsgAction = Msg.substring(0,n);
                         //Serial.print("MsgAction = ");
                         //Serial.println(MsgAction);
   MoveTime = Msg.substring(n+1);
   dT = MoveTime.toInt();
  
   if (dT > dTMax) {
          dT = dTMax;
          StatusdT = dT; }
   Serial.print("MoveTime = ");
   Serial.println(MoveTime);
   Serial.print("dT = ");
   Serial.println(dT);
                         //Serial.println("------------");
  Serial.println("------------");
 }       //Einde Analyse
//-------------------------------------------------------------------
void SendSMS(String response){
   Serial.println("Fie Send SMS   ");
   Serial.println("-------------"); 
   mySerial.print("AT+CMGF=1\r");
    delay(1000);
   mySerial.println("AT+CMGS=\""+Phone+"\"\r");
    delay(1000);
   mySerial.print(response); //text content
    delay(100);
   mySerial.write(0x1A);//ascii code for ctrl-26 //sim800.println((char)26); //ascii code for ctrl-26
    delay(1000);
    Serial.println("SMS Sent Successfully.");
  }
	typ of plak hier code

You do not have mains (red) connected to COM, earth connected to the bulb, and the relay is not lined up with the wire connected to DIO pin 10.

Thank you for this positive response, but the connection lines as designed with my Cirkit Designer are not so good (line up problems). But in reality the Relay module is connected to DIO pin 10 and the Bulp is well connected, It was not possible to find a circuit 220 V board in the Designer Biblio. The project RUNS without problems when connected to the USB serial port of my PC , and also on the external power after I actionned the Reset Button !
In reality I used a two relay arduino board and the output of the relay is the rol-on-shutter where relay1 gives the Rol Up signal and relay 2 gives the Rol Down feeds to the shutter motor.
I simplyfied the circuit schema with one relay and a bulb as output.
The program is running without any problems, its only by Startup from external power and power failure that it fails, due to the Nano reboot issue thats not working, it function again after usung the Reset Button. The Sim800L is independly powered by the external power and is working after power failure or interruption.

So, why doesn't reboot the Nano after power failure , despite the power LED is working on the Nano ?

Maybe the SIM800L is over-loading the supplied voltage during startup. Can you raise the buck converter a little (5.1vdc, 5.2vdc... but under the rated maximum input voltage of the SIM900L)?

From the datasheet:

The power supply range of SIM800L is from 3.4V to 4.4V.Recommended voltage is 4.0V

Maybe the relay coil is loading the circuit? Try putting the relay on its own coil power.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.