• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Contact | Calculators-online
You are here: Home / Arduino Projects / GSM Car Ignition and Central Lock Circuit Using Arduino

DIY Circuits | Learn Basics | Arduino Coding




GSM Car Ignition and Central Lock Circuit Using Arduino

Last Updated on January 26, 2026 by Swagatam 8 Comments

In this post I will show how to construct a GSM based car security system using Arduino, which can lock and unlock car’s ignition system and central lock by sending a password SMS to car from your cellphone

Car theft can be a heart break; it feels like your loved one got kidnapped. It hurts more when an old car which you spend years with it got stolen. Old cars and low tier cars may get stolen often because they offer less security features.

As the time progress new methods are invented to exploit the cars, covering those exploits in mainstream and old cars can cost huge sum of money.

The proposed project can add another layer of security to your car at cheap cost, which might save your car from getting stolen one day.

The proposed project consist of GSM modem (SIM 800/900) which is the heart of the project, an Arduino board which acts as brain of the project.

Few relays interfaced with Arduino board enables and disabled the ignition and central lock of the car.

A valid SIM card with working SMS plan is required to operate this project and try to take advantage of the SMS offers availed by your network provider to reduce the expenses due to SMS.

Now let’s look at the circuit diagram of this cellphone controlled Arduino based GSM car central locking system:

The above circuit is fairly easy to replicate one. The GSM modem is interfaced with Arduino’s Tx and Rx pin.

The Tx of Arduino is connected to Rx of GSM modem and Rx of Arduino is connected Tx of GSM modem i.e. Tx to Rx and Rx to Tx.

Ground to ground connection between Arduino and GSM modem is also established.

A 9V regulator 7809 is added in the circuit to provide to fixed voltage to GSM modem and arduino board as the battery voltage is subjected to change while ignition and charging, higher than 12 volt may damage the boards.

The Arduino’s PIN # 7 is the output to the central lock and ignition lock mechanism.

Arduino Car Ignition lock diagram:

Arduino GSM Car Ignition and Central Lock Relay Wiring

The diodes are connected to prevent high voltage spike from relay due to back EMF.

A fuse must be connected at the input as the short circuit can turn into catastrophic damage to the car.

A switch is provided which may be placed inside the bonnet. It can used to turn off the circuit if you are not planning to use the car for more than a week which will avoid battery drain.

NOTE: If the circuit is turned off (using switch) the central and ignition lock is activated and your car is safe.

Program:

//----------------Program developed by R.Girish------------//

int temp = 0;
int i = 0;
int j = 0;

char str[15];                 // Incoming SMS buffer
boolean state = false;

const int LOCK = 7;

void setup()
{
  Serial.begin(9600);

  pinMode(LOCK, OUTPUT);
  digitalWrite(LOCK, LOW);

  // GSM module warm-up delay
  for (j = 0; j < 60; j++)
  {
    delay(1000);
  }

  Serial.println("AT+CNMI=2,2,0,0,0");
  delay(1000);

  Serial.println("AT+CMGF=1");
  delay(500);

  Serial.println("AT+CMGS=\"+91xxxxxxxxxx\"\r"); // Replace x with mobile number
  delay(1000);

  Serial.println("Your car is ready to receive SMS commands.");
  delay(100);

  Serial.println((char)26);   // CTRL+Z
  delay(1000);
}

void loop()
{
  if (temp == 1)
  {
    check();

    temp = 0;
    i = 0;
    memset(str, 0, sizeof(str));   // Clear buffer

    delay(1000);
  }
}

void serialEvent()
{
  while (Serial.available())
  {
    if (Serial.find("/"))          // Start delimiter
    {
      delay(1000);

      while (Serial.available())
      {
        char inChar = Serial.read();

        if (i < (sizeof(str) - 1)) // Prevent overflow
        {
          str[i++] = inChar;
        }

        if (inChar == '/')
        {
          str[i - 1] = '\0';       // Proper string termination
          temp = 1;
          return;
        }
      }
    }
  }
}

void check()
{
  //--------------------------------------------------------------------------//
  if (!(strncmp(str, "qwerty", 6)))   // Password
  //--------------------------------------------------------------------------//
  {
    if (!state)
    {
      digitalWrite(LOCK, HIGH);
      delay(1000);

      Serial.println("AT+CMGS=\"+91xxxxxxxxxx\"\r");
      delay(1000);

      Serial.println("Central Lock: Unlocked.");
      Serial.println("Ignition Lock: Unlocked.");

      delay(100);
      Serial.println((char)26);

      state = true;
      delay(1000);
    }
    else
    {
      digitalWrite(LOCK, LOW);
      delay(1000);

      Serial.println("AT+CMGS=\"+91xxxxxxxxxx\"\r");
      delay(1000);

      Serial.println("Central Lock: Locked.");
      Serial.println("Ignition Lock: Locked.");

      delay(100);
      Serial.println((char)26);

      state = false;
      delay(1000);
    }
  }
  else if (!(strncmp(str, "status", 6)))
  {
    Serial.println("AT+CMGS=\"+91xxxxxxxxxx\"\r");
    delay(1000);

    Serial.println("The System is Working Fine.");

    if (!state)
    {
      Serial.println("Central Lock: Locked.");
      Serial.println("Ignition Lock: Locked.");
    }
    else
    {
      Serial.println("Central Lock: Unlocked.");
      Serial.println("Ignition Lock: Unlocked.");
    }

    delay(100);
    Serial.println((char)26);
    delay(1000);
  }
}

//----------------Program developed by R.Girish------------//

NOTE 1:

The user has to place the password in the code before uploading to Arduino.

//--------------------------------------------------------------------------//

if(!(strncmp(str,"qwerty",6))) // (Password Here, Length)

//--------------------------------------------------------------------------//

Replace the “qwerty” with your own password and change the number 6 to length of your password. For example:

if(!(strncmp(str,"@rduino",7))) // (Password Here, Lenght)

“@rduino” is the password and it has 7 letters (Length). You can place numbers, letters, special characters and combination of these. The password is case sensitive.

NOTE 2:

Replace all the “xxxxxxxxxxx” with car owner’s 10 digit phone number in the code at four places:

Serial.println("AT+CMGS=\"+91xxxxxxxxxx\"\r"); // Replace x with mobile number

How to operate this project with cellphone SMS:

• Sending /status/ to GSM modem will send an SMS to car owner’s phone number about the current status of the lock.

• Sending the correct password will toggle the state of the central and ignition lock.

Here is the screen shot:

The above result is from the tested prototype.

• Sending /status/ to the SIM card number inserted in GSM modem will send an acknowledgement SMS regarding the current status of the lock to car owner’s phone number.

• Sending the correct password to GSM modem in the above case /qwerty/ is the password, this will unlock the central and ignition lock. It will also send an acknowledgement SMS as shown above.

• Sending the same correct password again will lock the central and ignition lock.

NOTE 3: Start your password with “/” and also end with “/”

NOTE 4: Once the circuit is turned on please wait about a minute. The circuit will send an SMS saying “Your car is ready to accept SMS command” to car owner’s cellphone number. Only then you can send those SMS commands.

If you have any specific questions regarding this GSM car ignition lock, central lock circuit using Arduino, you can send them through the below given comment box

You'll also like:

  • 4 pin LEDHow to Make Powerful Car Headlights Using LEDs
  • Arduino programmable timer circuitArduino 2-Step Programmable Timer Circuit
  • mosfetregulatorcircuit3phaseMotorcycle Voltage Regulator Circuits
  • P 20150830 153854Make this 7 Segment Digital Clock with Beep Alert Circuit

Filed Under: Arduino Projects, Automobile Electronics Tagged With: Arduino, Central, GSM, Ignition, Lock

About Swagatam

I am an electronics engineer and doing practical hands-on work from more than 15 years now. Building real circuits, testing them and also making PCB layouts by myself. I really love doing all these things like inventing something new, designing electronics and also helping other people like hobby guys who want to make their own cool circuits at home.

And that is the main reason why I started this website homemade-circuits.com, to share different types of circuit ideas..

If you are having any kind of doubt or question related to circuits then just write down your question in the comment box below, I am like always checking, so I guarantee I will reply you for sure!

Previous Post: « Compact 3-Phase IGBT Driver IC STGIPN3H60 – Datasheet, Pinout
Next Post: 120 Watt Amplifier Circuit using TDA 2030 IC »

Reader Interactions

Comments

Suren W says:
July 8, 2023 at 8:23 am

How can it be modified to be SMS controlled by more than one phone no.

Reply
Swagatam says:
July 8, 2023 at 8:35 am

SMS based circuit is already posted and available in this blog.

Reply
abubakar says:
December 10, 2017 at 2:27 am

else if(!(strncmp(str,”status”,6)))

{

Serial.println(“AT+CMGS=”+923412124417″r”); // Replace x with mobile number

delay(1000);

after this line its giving an error (
exit status 1
expected ‘)’ before string constant
)

Reply
Swagatam says:
December 10, 2017 at 9:50 am

I have copied the codes again. please check it now and let me know….

Reply
abubakar says:
December 17, 2017 at 2:55 am

thank u sir .. now its working fine

Reply
Swagatam says:
December 17, 2017 at 9:22 am

OK, good!!

Reply
muhammad abubakar says:
November 9, 2017 at 12:55 pm

sir how can i modify this project as io want that …
when someone trying to open the door it will send me the massage..
2ndly if the iginition started it will again send me a massage tha your “car has been started” and then i will send a command to my cell phon and it breaks the car iginition system to stop the stolling ..hence the rober started ignition ..car will gives no respond even a ignition ..
when i came next i will snd again a command of start ..so relay energize and start terminal manuly working by key system…kindly sir help me out. in programning as well as hardware

Reply
Swagatam says:
November 9, 2017 at 1:59 pm

Muhammad, you can try the following concept

https://www.homemade-circuits.com/gsm-water-pump-controller-with-call/

and change the relay signal feedback to car door switch feedback….while the main relay switch ON/OFF can be integrated with the ignition start, or central lock

Reply

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

circuit simulator image



Subscribe to get New Circuits in your Email



Categories

  • Arduino Projects (95)
  • Audio and Amplifier Projects (133)
  • Automation Projects (18)
  • Automobile Electronics (103)
  • Battery Charger Circuits (87)
  • Datasheets and Components (109)
  • Electronics Theory (149)
  • Energy from Magnets (27)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (20)
  • Health related Projects (27)
  • Home Electrical Circuits (13)
  • Indicator Circuits (16)
  • Inverter Circuits (95)
  • Lamps and Lights (159)
  • Meters and Testers (71)
  • Mini Projects (28)
  • Motor Controller (68)
  • Oscillator Circuits (28)
  • Pets and Pests (15)
  • Power Supply Circuits (91)
  • Remote Control Circuits (50)
  • Renewable Energy (12)
  • Security and Alarm (64)
  • Sensors and Detectors (106)
  • SMPS and Converters (34)
  • Solar Controller Circuits (60)
  • Temperature Controllers (43)
  • Timer and Delay Relay (49)
  • Voltage Control and Protection (42)
  • Water Controller (37)
  • Wireless Circuits (31)





Other Links

  • Privacy Policy
  • Cookie Policy
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap



People also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Stack Exchange
  • Linkedin



Recent Comments

  • Swagatam on Door Security Alarm Circuit for Alerting if Door was Opened
  • Swagatam on High Wattage Brushless Motor Controller Circuit
  • Swagatam on Arduino 2-Step Programmable Timer Circuit
  • Duff on Door Security Alarm Circuit for Alerting if Door was Opened
  • Lex on High Wattage Brushless Motor Controller Circuit

© 2026 · Swagatam Innovations