0

I am using SIM800L and Arduino Uno.

The programme is working fine when I turn the serial monitor on using Arduino IDE but when I start the Arduino board by using the adapter it is not receiving anything. I have blinked LED on receiving SMS.

#include <SoftwareSerial.h>

SoftwareSerial wire(3, 2);
String  Grsp;

void setup()
{
   wire.begin(9600);    
   Serial.begin(9600);       
   wire.println("AT+CMGF=1"); 
    wire.println("AT+CNMI=2,2,0,0,0"); 
  pinMode(8, OUTPUT);   
  digitalWrite(8, HIGH); 
  delay(1000); 
    digitalWrite(8, LOW); 


   delay(100);
}


void loop()
{


  if (wire.available()>0)
  {
        Grsp = wire.readString(); 
     Serial.println(Grsp.length()); 
     Serial.println(Grsp); 

     if(Grsp.length() > 100)
     {
       Serial.println("if crossed"); 

      digitalWrite(8, HIGH); 
       delay(1000); 
        digitalWrite(8, LOW); 

      }




}


}
  • 1
    Do you have any common ground 'GND' between arduino and sim800l module. UART works when there is TX RX and GND terminals are connected between both modules. When you connect it with PC and open your terminal the both got supply from PC thus have common GND connection. – Vaibhav May 30 at 12:18
  • thank you so much Vaibhav you made my day,it was same as you said i used common GND on breadboard. – nikhil sanganwar May 31 at 16:21

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.