Hello,
I have a project and everything is working perfectly, I'm using GSM SIM900A mini and i connected it with an adapter with 5V 2A
#include <SoftwareSerial.h>
const int buzzerPin = 12;
const int flamePin = 11;
int Flame = HIGH;
int redled = 5;
int greenled = 6;
void setup()
{
pinMode(buzzerPin, OUTPUT);
pinMode(redled, OUTPUT);
pinMode(greenled, OUTPUT);
pinMode(flamePin, INPUT);
Serial.begin(9600);
}
void loop()
{
Flame = digitalRead(flamePin);
if (Flame== HIGH)
{
Serial.println("ATD+966508791545;"); // ATDxxxxxxxxxx; semicolon should be at the last ;AT command that follows UART protocol;
digitalWrite(buzzerPin, HIGH);
digitalWrite(redled, HIGH);
digitalWrite(greenled, LOW);
Serial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1 second
Serial.println("AT+CMGS=\"+966508791545\"\r"); // Replace x with mobile number
delay(1000);
Serial.println("Yazaq");// The SMS text you want to send
delay(1000);
Serial.println((char)26);// ASCII code of CTRL+Z for saying the end of sms to the module
delay(100);
}
else
{
digitalWrite(buzzerPin, LOW);
digitalWrite(greenled, HIGH);
digitalWrite(redled, LOW);
}
}
It's a fire alarm with the ability to make a call and send SMS .
When I make a flame the buzzer is running and the red led lights up but the GSM don't send or call.


