Hello all !
I want to make a call using sim800l connecting to arduino uno as in picture
This is the code
<SoftwareSerial.h>
// Define the software serial pins for communication with SIM800L
SoftwareSerial sim800(10, 11); // RX, TX
// Your phone number in international format
String yourPhoneNumber = "+123456789";
void setup() {
// Start communication with SIM800L
sim800.begin(9600);
// Start serial communication with the computer for debugging
Serial.begin(9600);
// Wait for the SIM800L to initialize
delay(1000);
Serial.println("GSM SIM800L Initialized");
Serial.println("Enter character for control option:");
Serial.println("m : to send message");
Serial.println("c : to make a call");
Serial.println();
delay(100);
}
void loop() {
if (Serial.available() > 0) {
switch (Serial.read()) {
case 'm':
SendMessage();
break;
case 'c':
MakeCall();
break;
}
}
}
void SendMessage() {
// Set SMS text mode
sim800.println("AT+CMGF=1");
delay(1000);
// Replace with your phone number in international format
sim800.print("AT+CMGS=\"");
sim800.print(yourPhoneNumber);
sim800.println("\"");
delay(1000);
// Replace with the message you want to send
sim800.println("Hello from SIM800L!");
delay(100);
// End of message character (Ctrl+Z)
sim800.println((char)26);
delay(1000);
}
void MakeCall() {
// Make a call to the specified number
sim800.print("ATD");
sim800.print(yourPhoneNumber);
sim800.println(";");
Serial.println("Calling...");
delay(20000); // Wait for call to establish (adjust delay as needed)
sim800.println("ATH"); // Hang up the call
Serial.println("Call hung up");
}
Can you help why i didnt recieve the call when i press "c".
It apear in serial monitor "Calling..." and then "Call hung up" .
Please can you help me where is the problem ?