Smart Intruder Detector with PIR and GSM


After looking through the GSM modem tutorial, I believe you will wonder what can you do with the GSM modem in our daily life. So , I have come out with the idea of using it with the PIR sensor to detect passive infrared (I mean HUMAN).  In this tutorial I will use the GSM modem with PIR sensor and SK28A withPIC18F2550. I use the SK28A since it is small and easy to be kept or use as mobile device at any place I wanted to.

*Note: You can use other type of microcontroller such as PIC16F876A  or PIC16F886 which are 8-bit, 28-pin, on SK28A. I use PIC18F2550 because that is the PIC I have which is 28-pin 🙂

It will become a Smart Intruder Detector system. When there is someone enter a room out of expectation hour, it will send a SMS to alert me :). Isn’t that fun!? Where can we use this smart system (I always wonder about it)? We can install this system in our house, living room, or garage, or basement where you want it to monitor the room for you. Suddenly I believe it is a good project so I started to design it and believes many who is worries about their room or space would be able to benefit from it. When you go to class or other places just power up the system. If someone break into you room, you will be notified through SMS  within few seconds, is great!

So, let’s get started!

Hardware required:



2. SK28A with PIC18F2550


3. LC04A


4.PIR sensor



Software required:

  • MPLAB IDE v8.63 ( I am using version 8.63, I believe other version is fine, just try it first)
  • MPLAB C18 MCC18 Compiler v3.37.01
  • PICKIT 2

Related References:


The Interface, Wiring!

Here are some photos of the connections I made 😀 Since there are too many wires, it is a bit messy. I will show a clearer image later on.




OK let’s look at a clearer schematic which I created using Fritzing, this is clearer and easier 🙂


If you have inquiry, please do not hestitate to discuss in our technical forum

Example Code

Here is the sample code, it is just for reference, I do not guarantee anything as I have only tested it in few conditions. Feel free to modify it according to your needs and again, if you have problem, do discuss in our technical forum.  Remember, we will need to burn/program the code into the PIC18f2550 on SK28A. I will provide the sample code I use in this tutorial. But if you prefer to use other chip or coding like HI-TECH C. This can be a basic reference.

So, let me explain briefly about the coding.

This is the main body of the code I use:


For the sending sms, I will show you the function initialization


The code can be modified according to your usage. you are welcome to show us your project inside the forum and what you have done with this GSM modem.

We look forward to see what you do with the GSM modem, be creative!



· There are lots of pins pull out from the TC35 development board, accidentally provide wrong voltage will kill the GSM modem, so please be extremely cautious before powering up. Double check the connection.

· UART from GSM modem is using 2.6V logic to communicate, provide 5V will shorten the lifespan of TC35 development board.

· If there is still much problem, please do post in our technical forum for help.



14 thoughts on “Smart Intruder Detector with PIR and GSM”

  1. sambong, you need to have the functions to make LCD work, 18Fxxx only define registers. Please do continue the discussion in our technical forum.

  2. can anyone help me with my project using this modem? I need the coding for this modem to send sms when smoke is detected.tq.

  3. Hi there,
    thanx guys! i found d the try to match the speed of sending sms using GSM and normal phone..

  4. hello..
    i already setup this project and it works well for the led blinking..
    however when i load the coding for smart intruder detector..and change the target phone number..
    build failed…and it say at the PICkit2 screen the some of the code not in hex format..i only change the target number and also the service centre number + additional coding for my sim pin password
    thank you

  5. Hi, for this project the gsm modem (SIEMENS TC35 GSM Development Board) can replace with RS232 GSM/GPRS Modem ?

  6. Hi, can there be multiple PIR sensor connect to one SK28A? is there additional electronic component we need to add?
    My scenario would be multiple sensor be placed at different location.tq

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

Is it possible to program Maker UNO with Python?
Camera and DSI Driver on the Latest Raspberry Pi Bullseye OS
Remote Control ZOOM:BIT using Grove 8266 WiFi and Blynk
Icon Case with Heatsinks & Fan Stressberry Test
Low Profile Aluminum Case Stressberry Test
Tutorials of Cytron Technologies Scroll to Top