Bukit Mertajam, Penang

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 with PIC18F2550. 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.



Related Posts

Comments (14)

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

Hi Ameen,

Yes.. you can add more PIR sensor.
Please continue discuss in our technical forum.

Hi, can i buy this project ? If can, then how i purchase it ?

We do not have package for this project. Please buy separately from http://www.cytron.com.my

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


The protocol and hardware is totally different. You need to modify it.

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

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


Can I use this tpye of GSM module for the Smart Intruder detector with PIR and GSM ? (see link):


This is the type used by Cytron :


Is there any differnce in using either of them??


Hi, is it necessary for the GSM module to be place under 3G coverage area only it works?

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.

can we include #include on 18fXX projects for LCD to work?

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

Not necessary 3G, but normal GSM signal coverage is a must.

Leave a comment