Monday, 3 August 2015

GSM/GPS VEHICLE GEOGRAPHICAL TRACKER




The project is based on a Gsm/Gps/Gprs. Its main function is to detect a illegal entry and communicate its own geographical position using, on the choice, the cellular phone reference system or the GPS. I use the recent product by SIMCOM - SIM908 which operate on 5 - 12 volt  dc supply, which makes it work on wide-range dc power supply...  Well i still cant believe that i  can burn a code of 21kb  into program memory chip of 14kb (pic16f876a), but, it works all good.... 
maybe one of this days am gonna write a code of 30kb on this mircontroller chip, just wanna confirm the max. program memory size....  
 The featuring  mircontroller chip is the pic16f876a, the reason i keep using this chip is because it cost less than $2 and I guess is available in all country... 



1st TEST VIDEO

The GPS Tracker is a small gadget that will record exactly where your vehicle, boat or aeroplane has travelled over time. It is intended to be wired into the ignition of your vehicle and then forgotten.
It will record your travels in Google Earth format, GPS Exchange format or as raw NMEA data and using software such as Google Earth you can then see your trips mapped onto the surface of the earth with a resolution of a few meters. Below are my experimental pics, pcb layout, and code....





PROTEUS SIMULATION 


SIM908 CONNECTION 1


SIM908 CONNECTION 2

PCB MAKING 1

PCB MAKING 2


PCB AND COMPONENT FIXING

PC GPS SERIAL BOARD QUICK TEST


FIRST TEST ON GET GPS LOCATION WITH SMS COMMAND




COMPLETE PCB LAYOUT AND CODE: http://1drv.ms/1Lof3e1

Code written in picbasic pro
'GSM AND GPS CONTROLLER
'PROGRAMMER : AYOMIDE
'USER: OPEYEMI
'ACECCT.BLOGSPOT.COM
'PIC16F876A
'2015

 DEFINE OSC 4
     include "modedefs.bas"

' Define ADCIN parameters
Define ADC_BITS     10    ' Set number of bits in result
Define ADC_CLOCK    3     ' Set clock source (3=rc)
Define ADC_SAMPLEUS 50    ' Set sampling time in uS

'-------------[PORT INITIALIZATION]-----------------
      ' 76543210
TRISA = %11111111
ADCON1 = 7
PORTB = 000000  'reset portB resigters to zero
TRISB = 000000  'Setting portB as output port
PORTC = 000000  'reset portC resigters to zero
TRISC = %10000000

'--------------[LCD DEFINES]----------------------
DEFINE LCD_DREG PORTB ' LCD Data bits on PORTB
DEFINE LCD_DBIT 4 ' PORTB starting address
DEFINE LCD_RSREG PORTB ' LCD RS bit on PORTB
DEFINE LCD_RSBIT 2 ' LCD RS bit address
DEFINE LCD_EREG PORTB ' LCD E bit on PORTB
DEFINE LCD_EBIT 3 ' LCD E bit address
DEFINE LCD_BITS 4 ' LCD in 4-bit mode
DEFINE LCD_LINES 2  ' DEFINE LCD ROW AS 2

'VARIABLE ------------------------------
LCD_MOVE VAR WORD ' LCD AMINATION
AT_TEST VAR WORD : AT_TEST = 0
OWNER VAR WORD
SENDER VAR BYTE[25] : SENDER = 0
NET2 VAR WORD
A0 VAR WORD : A0 = 0
BUFF160        VAR BIT[160]
ENCODER90 VAR BYTE[90]
LAT20 VAR BYTE[20]
LONG20 VAR BYTE[20]
ENCODER10 VAR BYTE[10]
A2 VAR WORD : A2 = 0
KEY VAR PORTB.0
B0 VAR WORD
LOCATE VAR WORD : LOCATE = 0

'--------- ASCII ---------------
ENTER con 13
CTRLZ CON 26

' ------- COMMUNICATION PORT --------------
REMOTE_RX VAR PORTC.0
GSM_TX VAR PORTC.6
GSM_RX VAR PORTC.7

' ----------- PORT ALIASES -----------------
OWNER_SW VAR PORTA.5
BOOT VAR PORTA.1
DOOR VAR PORTA.2
BONNET VAR PORTA.3
RELAY_RX VAR PORTA.4

SECURED_LED VAR PORTC.0
ENGINE_LED VAR PORTC.1
DOOR_LED VAR PORTC.2

BUZZER VAR PORTC.3
ENGINE_RELAY VAR PORTB.0
DOOR_RELAY VAR PORTB.1


'---------[LCD INITIALIZATION]-----------
LCDOUT $FE,1 ' CLEAR SCREEN
LCDOUT $FE,2
PAUSE 500          ' Wait .5 second for lcd to ready

ON_MODULE:  ' ACTIVATE GSM/GPRS/GPS MODULE
low BUZZER: LOW RELAY_RX: LOW ENGINE_RELAY: LOW DOOR_RELAY
HIGH ENGINE_LED : HIGH DOOR_LED : HIGH SECURED_LED : PAUSE 1000
LOW ENGINE_LED : LOW DOOR_LED : LOW SECURED_LED
      PAUSE 10: LOW PORTC.5: PAUSE 1000
      HIGH PORTC.5: PAUSE 500
   high BUZZER : PAUSE 800: low BUZZER: PAUSE 200
   LCDOUT "AJAYI OMOYEMI A."  : LCDOUT $FE, $C0
LCDOUT "  EEE/11/5048   "
PAUSE 2500
LCDOUT $FE,1 ' CLEAR SCREEN  
CHECK_GSM:
CLEAR          ' CLEAR ALL VARIABLE

'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
for AT_TEST = 0 to 3
SEROUT2 GSM_TX,84,["AT",$0D,$0A]
     LCDOUT $FE, $C0 : LCDOUT " Initialize !!! "
       lcdout $fe,$8
        pause 500
          lcdout $fe,$c
            pause 500
next AT_TEST

PAUSE 300  
SEROUT2 GSM_TX,84,["AT+CMGF=1",ENTER] : PAUSE 300
   SEROUT2 GSM_TX,84,["AT+CMEE=1",ENTER] : PAUSE 300
     
LCDOUT $FE,1 ' CLEAR SCREEN
FOR NET2 = 0 TO 2      ' GET NETWORK STATUS
PAUSE 100 : LCDOUT "SEARCHING SIM908"
   SEROUT2 GSM_TX,84,["AT+CSQ",ENTER]
     SERIN2 GSM_RX,84,3000,CHECK_GSM,[WAIT("+CSQ: "), STR ENCODER90\6] : PAUSE 2
         LCDOUT $FE, $C0 : LCDOUT "  CSQ:    ", STR ENCODER90\6  : PAUSE 1500
NEXT NET2

PAUSE 2
SEROUT2 GSM_TX,84,["AT+CSQ",ENTER]
  SERIN2 GSM_RX,84,3000,GSM_CHECK_ERR,[WAIT("OK")]  : pause 100
      LCDOUT $FE, $C0 : LCDOUT "SIM908 CONNECTED" : PAUSE 2500
         HIGH BUZZER :PAUSE 500 :LOW BUZZER  :PAUSE 200
            HIGH BUZZER :PAUSE 500 :LOW BUZZER  :PAUSE 2
GOTO SEND_OKGSM

GSM_CHECK_ERR:
LCDOUT $FE, $C0 : LCDOUT " NOT  CONNECTED "
PAUSE 1500

'*****************************************************************
SMS_SETUP:
PAUSE 500
SEROUT2  GSM_TX,84,["AT+CMGF=1",ENTER]    ' SW TO SMS MODE
PAUSE 500
SEROUT2 GSM_TX,84,["AT+CMGS=",34,"+2348100581270",34,ENTER]
PAUSE 500
RETURN

SEND_SMS:
PAUSE 300
  SEROUT2 GSM_TX,84,[CTRLZ]
     SEROUT2 GSM_TX,84,[26]
        PAUSE 5000
LCDOUT $FE,1 ' CLEAR SCREEN
   LCDOUT $FE, $C0 : LCDOUT "  MESSAGE SENT "
   HIGH BUZZER :PAUSE 500 :LOW BUZZER  :PAUSE 3000
   LCDOUT $FE,1 ' CLEAR SCREEN
  
      RETURN
'******************************************************************

SEND_OKGSM:
GOSUB SMS_SETUP
SEROUT2 GSM_TX,84,["SIM908 - GSM/GPRS/GPS CONNECTED AND OK, "," NETWORK CSQ: ",STR ENCODER90\6,_
" [ VEHICLE SECURED ]",ENTER]  :PAUSE 500
   GOSUB SEND_SMS
      PAUSE 1000

MAIN_PROGRAM:
LCDOUT $FE,1 ' CLEAR SCREEN
   LCDOUT "SIM908 CONNECTED"
      LCDOUT $FE, $C0 :LCDOUT "VEHICLE  SECURED"
      HIGH SECURED_LED :PAUSE 500 :LOW SECURED_LED 
         PAUSE 700

IF BOOT = 0 OR DOOR = 0 OR BONNET = 0 THEN  ' CHECK DOOR
  HIGH BUZZER :PAUSE 500 :LOW BUZZER  :PAUSE 200
    HIGH BUZZER :PAUSE 500 :LOW BUZZER  :PAUSE 200
    HIGH BUZZER :PAUSE 500 :LOW BUZZER  :PAUSE 2
 SEROUT2  GSM_TX,84,["AT+CMGD= 1",ENTER]  
      LCDOUT $FE, $C0 :LCDOUT " VEHICLE OPENED "
        PAUSE 2000
GOTO CHECK_OWNER
ENDIF
PAUSE 2000
GOTO MAIN_PROGRAM


CHECK_OWNER:
LCDOUT $FE,1 ' CLEAR SCREEN
PAUSE 2
 FOR OWNER = 1 TO 15
   LCDOUT "  VERIFY OWNER  "
     LCDOUT $FE, $C0 :LCDOUT " IN 15 SECOND(S)"
       PAUSE 1000
        IF OWNER_SW = 0 THEN MAIN_PROGRAM
 NEXT OWNER
 IF OWNER = 15 THEN GOTO SMS_OWNER
 SMS_OWNER:
SEROUT2 GSM_TX,84,["AT+CMGD=1",ENTER] : PAUSE 1000  ' DELETE ALL INBOX
GOSUB SMS_SETUP
SEROUT2 GSM_TX,84,["AN INTRUDER DETECTED, REPLY (CMD:ACIVATE_ LOCK (OR) UNLOCK, ALARM (OR)SILENT, GET_LOCATION, OWNER",ENTER]  :PAUSE 500
   GOSUB SEND_SMS
     PAUSE 1000
  CLEAR
DECODE_SMS:
  LCDOUT $FE,1 ' CLEAR SCREEN
PAUSE 100
LCDOUT "WAITING FOR  SMS": PAUSE 500
SEROUT2  GSM_TX,84,["AT+CMGR= 1",ENTER]    ' READ INBOX 1
'SERIN2  GSM_RX,84,3000,DECODE_SMS,[WAIT("+CMGR:"),SKIP 0, STR ENCODER90\20] : PAUSE 50
SERIN2  GSM_RX,84,1500,DECODE_SMS,[WAIT(47),SKIP 14, STR ENCODER90\24] : PAUSE 50
LCDOUT $FE, $C0
LCDOUT "SMS 1: ", STR ENCODER90(19)
    'for B0=1 to 108    'MOVE LEFT
     ' lcdout $fe,$1e
        pause 3000
    'next B0
   
if (ENCODER90(19)="L") THEN      ' ACTIVATE LOCK
HIGH DOOR_RELAY  : HIGH DOOR_LED
HIGH ENGINE_RELAY : HIGH ENGINE_LED: PAUSE 5
GOSUB DELETE_SMS
ENDIF
if (ENCODER90(19)="U") THEN     ' ACTIVATE UNLOCK
LOW DOOR_RELAY  : LOW DOOR_LED
LOW ENGINE_RELAY : LOW ENGINE_LED: PAUSE 5
GOSUB DELETE_SMS
ENDIF
if (ENCODER90(19)="A") THEN    ' ACTIVATE ALARM
HIGH BUZZER : PAUSE 5
GOSUB DELETE_SMS
ENDIF
if (ENCODER90(19)="S") THEN      ' ACTIVATE SILENT
LOW BUZZER : PAUSE 5   
GOSUB DELETE_SMS
ENDIF
if (ENCODER90(19)="G") THEN     ' ACTIVATE GET LOCATION
LOW BUZZER : PAUSE 5
gosub  GET_LOCATION  
GOSUB DELETE_SMS
ENDIF
if (ENCODER90(19)="O") THEN    ' ACTIVATE OWNER
LOW BUZZER
LOW DOOR_RELAY  : LOW DOOR_LED
LOW ENGINE_RELAY : LOW ENGINE_LED: PAUSE 5 
GOSUB DELETE_SMS
LCDOUT $FE,1 ' CLEAR SCREEN
LCDOUT "VEHICLE  SECURED"  : LCDOUT $FE, $C0
LCDOUT " OWNER VERIFIED "
PAUSE 10000
GOTO MAIN_PROGRAM
ENDIF
GOTO DECODE_SMS

DELETE_SMS:
 SEROUT2  GSM_TX,84,["AT+CMGD= 1",ENTER]
 PAUSE 1
 RETURN

 GET_LOCATION:
CLEAR
LCDOUT $FE,1 ' CLEAR SCREEN
PAUSE 50     
SEROUT2  GSM_TX,84,["AT+CGPSPWR=1",ENTER]    ' POWER ON THE GPS MODULE
PAUSE 500
SEROUT2  GSM_TX,84,["AT+CGPSRST=1",ENTER]    ' POWER ON THE GPS MODULE
PAUSE 500
SEROUT2  GSM_TX,84,["AT+CGPSIPR=9600",ENTER]    ' POWER ON THE GPS MODULE
PAUSE 500

LOCATION:
for LOCATE = 0 TO 2
SEROUT2  GSM_TX,84,["=AT+CGPSINF=32",ENTER]    ' get location
'HSERIN 2000,SETUP,[SKIP 5,WAIT (10),STR BUFF\20\13]
'SERIN2  GSM_RX,84,[WAIT("+CMGR: "),SKIP 45, STR ENCODER90\20] : PAUSE 200
SERIN2  GSM_RX,84, 1000, LOCATION,[WAIT("A,"),STR LAT20\12] : PAUSE 200
PAUSE 500
SEROUT2  GSM_TX,84,["AT+CGPSINF=32",ENTER]    ' get location
SERIN2  GSM_RX,84,[WAIT("N,"),SKIP 0, STR LONG20\12] : PAUSE 200
LCDOUT $FE,1 ' CLEAR SCREEN

PAUSE 200
LCDOUT $FE, $C0
LCDOUT "DOWNLOADING....."
PAUSE 1500
NEXT LOCATE
'------- SEND LOCATION TO MOBILE ------------------------
GOSUB SMS_SETUP
SEROUT2 GSM_TX,84,[" CURRENT VEHICLE LOCATION :::  LAT :", STR LAT20\12,"   ","LON: ", STR LONG20\12  , ENTER] 
PAUSE 500

'SEROUT2 GSM_TX,84,["SIM908 - GSM/GPRS/GPS CONNECTED AND OK, "," NETWORK CSQ: ",STR ENCODER90\6,_
'" [ VEHICLE SECURED ]",ENTER]  :PAUSE 500
   GOSUB SEND_SMS
      PAUSE 1000
RETURN

end



If you have any question, feel free to comment on this post and ask me any question.... acecct.18f4550@gmail.com OR call me on :  +2348123206299

21 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Smart Track Africa provides excellent fleet management solutions to a wide array of clients to help them track their fleets for safety and management purposes. Fleet Management

    ReplyDelete
  3. vehicle tracking : GPS Tracking Solutions to suit any budget. Based in Sydney Australia. GPS Trackers for all applications from vehicle tracking to personal tracking

    ReplyDelete
  4. could you sent COMPLETE PCB LAYOUT AND CODE because url not fount

    ReplyDelete
  5. Yes please the complete PCB and codes plus lay outs please auwalu2004@yahoo.com

    ReplyDelete
  6. GPS tracking unit is a device that uses Global Positioning System to track or record the location of a vehicle person or an establishment at anytime irrespective of the time and weather conditions. Phone locator

    ReplyDelete
  7. Hi Dear,

    I Like Your Blog Very Much..I see Daily Your Blog ,is A Very Useful For me.

    You Can Also find GPS tracking devices for car & Trucks - TraksUS

    Find the best GPS tracking devices for car & trucks at TraksUS. We provide a full set of driving reports, driving alerts, real-time traffic incidents and more.

    Visit Now - https://www.traksus.com/

    ReplyDelete

  8. hi dear its very nice and very helpful post for those who are new and thinking to start a blog site.Your posts are very helpful and creative. I have atlast opened a blog site being inspired from your articles clik here and see about inverter

    ReplyDelete
  9. Zero-One BVBA GPS track en trace oplossingen met 3 jaar waarborg. Betaalbaar en uiterst betrouwbaar op maat van uw gps track en trace noden.gps tracking auto

    ReplyDelete
  10. Reduce Fuel and Maintenance Costs – The average operating cost per vehicle is about $1.50 per mile. A company can reduce at least 25 miles per week for each vehicle with a RMT Rover GPS Tracking System. Fleet management

    ReplyDelete
  11. Great work!I found ur post very useful sir. keep doing the good work and revisit the code to upgrade it by sending the lat and log data with googlemap link in the message and incorporate the conversion in the software to be reading DECIMAL DEGREES instead of the raw value from GPS which is in DEGREES MINUTE.thanks for ur cooperation sir

    ReplyDelete
  12. Skimming is the point at which somebody takes the credit card data while you are making a genuine exchange. It is ordinarily an "inside work" by an exploitative worker of a real vendor. gsm receiver atm

    ReplyDelete
  13. Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign. gps tracker device

    ReplyDelete
  14. Thank you very much for this useful article. I like it. free mobile tracker

    ReplyDelete
  15. I'm glad I found this web site, I couldn't find any knowledge on this matter prior to.Also operate a site and if you are ever interested in doing some visitor writing for me if possible feel free to let me know, im always look for people to check out my web site. phone tracker app

    ReplyDelete
  16. Thanks for sharing the valuable information.
    car rental keyless

    ReplyDelete
  17. Looking for the smallest GPS tracker in Delhi? Look no further! Spy World offers cutting-edge GPS tracking devices for your personal or business needs. For any query: Call us at 8800809593 | 8585977908.

    ReplyDelete

Featured post

PURE SINE WAVE INVERTER WITH LED AND LCD

The inverter PCB is easy to assemble by following the label of the components to be inserted. The choice of the voltage to be used to power ...