Arduino Resets if not set HIGH to SIM800L pin before power SIM

I finished my project but i have a little problem.

I somekind solved the problem but i dont know if i faced the source of the problem (good) or just faced the result of the problem (not good)

The circuit is simple.

1 set of batteries powering arduino and the red of battery goes to a relay and the NC of the relay goes to SIM800L VCC.

So that when arduino triggers the relay ,,,the SIM800L is powered and be capable of communicating with arduino.

Now the problem is that if i just trigger the relay my arduino resets.

The relay has not flyback diode but i dont think this is the problem because ...even if i put diode...again reseting.... (But may i am wrong on this)

And i found the solution to write HIGH in the RX and TX pins of SIM800L (JUST 2 seconds before i trigger the relay) [u]so that the VCC of SIM800L goes to 2.24 Volt[/u] NOT from the original battery source , but via the arduino !!!!

And if its like this then its ok...no reseting.

Maybe the big yellow capacitor on sim ?...i really dont know.

But the problem is not only that i dont understand the WHY but...i dont know if this solution is going to damage (in the long run) my arduino or my sim800l !!!!

Can anyone please advise ?

Thank you in advance .

Below you see the code.... and the 3 lines of SALVATION code!

....
const uint8_t PinRelay = 4; // 
const uint8_t PinSimTx = 6; // our Rx ,SoftwareSerial INPUT_PULLUP
const uint8_t PinSimRx = 5; // our Tx ,SoftwareSerial OUTPUT (making LOW when finish job?)
#include 
SoftwareSerial sim(PinSimTx, PinSimRx);
....

void loop() {

  blinc(2);//simulate sleeping
  pinMode(PinSimTx,OUTPUT);
  digitalWrite(PinSimTx,LOW);//put all LOW just for ...saving power
  digitalWrite(PinSimRx,LOW);
  delay(2000);//end simulate sleeping some hours 
  
  
  
  blinc(3);//now wake up ,take measurements and send them to the network
      digitalWrite(PinSimTx,HIGH);//1)1st line of SALVATION CODE
      digitalWrite(PinSimRx,HIGH);//2)2nd line of SALVATION CODE
      //3)3rd line of SALVATION CODE
      delay(3000);//just for SIM VCC to clamp at 2.24 volt !!! critical for when relay triggered(1000 is ok ...but...)  

  digitalWrite(PinRelay,HIGH);//ok..now trigger relay to open
  pinMode(PinSimTx, INPUT_PULLUP);//back to the pullup mode for softwareserial
  delay(7000);///...for sim to be ok for question
  execAndReadATBattery();///do what ever here....
  delay(1000);
  digitalWrite(PinRelay,LOW);//ok..done...close relay and go for sleep

}

|500x375

ResetIfNoHIghProblem.JPG|1600x1200

It would be a big help if you post a schematic, your picture looks ok but is of not much use in solving your problem. As a SWAG I would guess you have a grounding problem and maybe a power supply impedance problem.

Thank you....the schematic is not too complicated.

MustSetHighBeforeTriggerRelay.png|538x507

A small correction Only Sim Tx (our Receive INPUT_PULLUP pin) needs to be HIGH 2-3 seconds before we power the sim via relay. So only 2 salvation code lines. ~~ digitalWrite(PinSimTx,HIGH);//1)1st line of SALVATION CODE~~ ~~ //2)2nd line of SALVATION CODE ONLY Sim Tx need to be HIGH~~ ~~ delay(3000);//just for SIM VCC to clamp at 2.24 volt !!! critical for when relay triggered~~

Erased...This is true for just not reset the arduino but i must write HIGH to Sim Rx (our transmitt pin) in order to be able to communicate after....

I am thinking that maybe this big yellow capacitor sucks much power when sim is powered on (and arduino resets by no having enough voltage) ...and with writing high at communication pins i just charging this capacitor....so that the time sim powers on it dows not suck voltage from arduino.

Can anyone agree with that?

Men!!...i think i soved it by removing yellow capacitor with a plier ....and leaving here the results in case that someone finds it ...and in case that someone has any DISSAGREEMENT with this solution because i dont know if removing the BYPASS capacitor is proper way ...when the creators of the module put it there for some reason . (I am not expert)

but just because i at least solved my problem ...here it is . Removing capacitor with a plier!!!!

PS..Green module that has not this yellow capacitor is working fine by default And green module has its RX and TX in reverse order relative to red module.

Solved_CapacitorOf_Red_Sim800L_Resets_Arduino_On_Relay_Powered.png|1124x759