I am using SIM800L (SimCom) with the Arduino UNO to send and receive sms. SIM800L module is getting connected to the network (LED is blinking every 3 sec) but not responding to any of the AT commands sent through arduino. I have used the following:
18650 Li-ion battery (3.7-4.2 V) for SIM800L
Stepped down the logic level of arduino to 3.3v using voltage divider
I folllowed the tutorial : In-Depth: Send Receive SMS & Call with SIM800L GSM Module & Arduino to make the connections.
I dumped the basic AT commands testing code:
#include <SoftwareSerial.h>
//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial(3, 2); //SIM800L Tx & Rx is connected to Arduino #3 & #2
void setup()
{
//Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
Serial.begin(9600);
//Begin serial communication with Arduino and SIM800L
mySerial.begin(9600);
Serial.println("Initializing...");
delay(1000);
mySerial.println("AT"); //Once the handshake test is successful, it will back to OK
updateSerial();
mySerial.println("AT+CSQ"); //Signal quality test, value range is 0-31 , 31 is the best
updateSerial();
mySerial.println("AT+CCID"); //Read SIM information to confirm whether the SIM is plugged
updateSerial();
mySerial.println("AT+CREG?"); //Check whether it has registered in the network
updateSerial();
}
void loop()
{
updateSerial();
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
}
while(mySerial.available())
{
Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
}
}
