[SOLVED]GSM Shiled power requirement problem

I brought a GSM Shield and I tried to send sms by the GSM shield. I connect GSM Shield to the arduino uno and I connect PIR sensor and 315MHz receiver(to get LP and SMOKE sensors signals when HIGH).

First I connected Arduino uno via USB but I didn't send sms messages as expected but sometimes it sent. According to the specification of GSM Shield it take upto 2A sometimes. So I use a battery to power the Arduino. I didn't recharge the battery after purchase since it shows 6.42V multimeter reading. It works as expected only in first time but now again it is not working, actually it is not registered to the network. I think there should be a kind of power issue. Can anyone tell me whether that battery is enough to initiate the GSM shield and register to the network or what was the problem of the setup. I am attaching the arduino code too, so please check whether it causes due to the coding.

#include <SoftwareSerial.h>
#include <VirtualWire.h>
#include "SIM900.h"
#include "sms.h"
SMSGSM sms;
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;

const int transmit_pin = 12;
const int receive_pin = 4;
const int transmit_en_pin = 5;
const int PIRpin = 6; 
boolean started=false;
int ledPin =10;

void setup(){
 Serial.begin(9600);
 Serial.println("Start");
    pinMode(PIRpin,INPUT);
    pinMode(ledPin,OUTPUT);
    digitalWrite(PIRpin, LOW);
    digitalWrite(ledPin,LOW);
    
    vw_set_tx_pin(transmit_pin);
    vw_set_rx_pin(receive_pin);
    vw_set_ptt_pin(transmit_en_pin);
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_setup(300); // Bits per sec
    vw_rx_start(); 
    
  if(gsm.begin(4800)){
    started=true; 
    digitalWrite(ledPin,HIGH);
     Serial.println("Ready");
      
  }else{
    digitalWrite(ledPin,LOW);
  }   
};

void loop(){
  if(started){
   //Serial.println("Start");
    if(digitalRead(PIRpin) == HIGH){
   Serial.println("Send SMS");
    
      sms.SendSMS("0783972406", "Motion detect");
      
      
    } 
    
    if (vw_get_message(buf, &buflen))
    {
      if (buf[0] == 'l')
      {
      Serial.println("L");
        sms.SendSMS("0783972406", "Gas Leak in the house. Call police 119");
        
        
      }else if(buf[0] == 's'){
      Serial.println("S");
        sms.SendSMS("0783972406", "Smoke in the house. Call police 119");
        
      }
     
    }
      
  }
    
    
  
};

Please I am doing this as project. I tried several weeks to solve this but I failed. I am new to Arduino and Electronics too. Please help me to solve this.

Thank you

What happens when a battery looses charge is that the inner resistance increases while the unloaded voltage pretty much stays the same. In order to determine a batteries charge status you must measure the voltage under full load. But you are describing a complex system where many things can go wrong and issues can interact. Dont stare yourself blind on a single one

Thank you Nilton6l. This is actually two separate unites.

One is security unit which is going to have Arduino Uno, GSM shield, PIR sensor, 315MHz receiver, JPEG camera, SD card shield with eye-fi card.

Other one is safety unit which is going to have Arduino Uno, LP and Smoke sensors, Buzzer, 315Mhz transmitter.

What is happening here is safety unite is communicating with security unit via transmitter and receiver and from security unit it sends sms message when LP or Smoke is detected or a motion detected by PIR sensor.

Upto now I have only attached PIR sensor and 351MHz receiver to the security unit for testing that part.

As you say I understood that I have to measure the voltage under full load. I'll let you know what happens. :slight_smile:

When full load it goes down 6.42v to 6.38v. Is it ok?

The battery seems to be good. But are you powering the GSM from the arduino? The NCP1117 regulator onboard the arduino can provide maximun 1A and if powered with less than 7V the voltage may drop below 5V as specified here (power section). If that is the case i suggest powering the GSM sepatately

So I use USB to power the arduino and 6V lead acid battery to power the GSM. I am going to directly input lead battery + to GSM VCC and lead batter - to the Ground..is it ok?

It sounds ok as long as you do not exceed the gsm max voltage

I'll do it and let you know

It works Thank you very much. I put the battery to charge and have to do some testing at night.

nice to hear that.

Thank you very much for your support. Now it works as expected. :smiley: