Wednesday 24 October 2012

FYP 2 (WEEK 14)

WEEK 14


Title of Activity


  • Presentation 
  • Appendix
  • Video about the project
  • Prototype


Objective

  • To make a preparation for the final week of presentation.
  • To prepare all those listed above and make sure all plan right on track.



Video





Conclusion

 


The project conclusion can be assessed through successful and unsuccessful outcomes according to the original requirements that were expected from the finished system. In this last task, the Eye Blink Sensor has been presented. The connection between the Mercury Sensor, processing and display the data received have been successfully developed. The source code for all the system was written in C Language and compiled using PIC-C Compiler which are easy tools to provide an easy environment and reliability for PIC microcontroller in designing system. Finally, the objectives of this project are successfully achieved.

FYP 2 ( WEEK 13)

WEEK 13


Title of Activity

  • Preparing the Slide / Poster

Objective
  • To prepare a slide / poster and get ready for the presentation

Content / Procedure



Conclusion

As a conclusion,when designing the poster student skill in summarizing the information are needed.This is because, we just need to put the important point in the poster and so with a slide for presentation.

FYP 2 (WEEK 12)

WEEK 12


Title of Activity
  • Design the casing for the project ( sensor and the circuit )
  • Design the poster for the project

Objective
  • To design a box to cover the sensor and also the circuit
  • To design the poster for the project

Content / Procedure


Front view of the project

Back view of the project
Side view of the project

Side view of the project
Conclusion

As a conclusion,through this task student are able to design and construct a casing for the circuit.Besides,the circuit are more secured with the casing compared without the casing.

FYP 2 (WEEK 11)

WEEK 11


Title of Activity


  • Test project


Objective

  • To make sure the project functionality


Content / Procedure


The project is ready for a test

Problem Statement
  • The LCD did not display anything and the vibrator not function

Solution
  • Change the power supply for IC regulator L7805CV
  • Change the output device for vibrator because the vibrator is very sensitive. 

Analysis

LCD display NORMAL

After the IC regulator have been changed,the output from LCD are successfully displayed.After the IC is burned with the new program,the output vibrator also functioning well. This program flow are focusing on 3 different mode which is when the mercury switches are in normal mode,it mean that the drivers are not sleepy. For the 2nd mode, when the mercury is not linear within 3 second the LCD will display "MENGANTUK" and that means the driver is falling asleep while driving and the 3rd mode is "PEMANDU PENGSAN" when the mercury is not linear more than 3 second and the GSM will send the user a message to tell that the driver are asleep or fainted.


The LCD display mode 2 "MENGANTUK"

Conclusion

As a conclusion,student are able to identify and trouble shoot the problem on the circuit. From this task, student get to gain more knowledge indirectly while troubleshooting it.


FYP 2 (WEEK 10)

WEEK 10


Title of Activity


  • Combine the program for PIC and GSM
  • Combine the circuit and the sensor



Objective

  • To combine the circuit and the program together
  • Burn the program into the PIC 16F877A


Content / Procedure



Burn the program into PIC 16F877A

The circuit combination between the PIC and GSM


  • Combination of the PIC program and also the GSM program
  • The input ( Mercury sensor ) 
  • The output ( LCD display , buzzer , vibration , sms )


Problem statement

  • When the both program are combined, there is a little bit problem that occur and this cause the program failed.

Solution

  • This is because both program have their own command and still need to be adjust to match them together . ( between the input port )

Analysis

The PIC cannot declare the command that directly send to the controller to the same input / output. We have to make sure that the program are modified to ensure there is no command to the same input from a different source. Every single pins must be declare before it can function properly.


Conclusion

As a conclusion, before doing a program first we must know the pins for the input and output ports.
Using a datasheet to refer the ports can be so helpful in order to avoid the mistake while programming the program.

FYP 2 (WEEK 9)

WEEK 9


Title of Activity

  • Program for PIC and GSM (PART II)


Objective

  • To gain more knowledge from the programming
  • To create a program that suits the project


Content / Procedure

;----------------------------------Program for GSM-----------------------------------------------------------;


SendSMScommand
bcf RCSTA,CREN ;pulse cren off...
movf RCREG,W ;flush fifo
movf RCREG,W ; all three elements.
movf RCREG,W

movlw A'A'
call transmit
movlw A'T'
call transmit
movlw A'+'
call transmit
movlw A'C'
call transmit
movlw A'M'
call transmit
movlw A'G'
call transmit
movlw A'S'
call transmit
movlw A'='
call transmit
movlw A'"'
call transmit
movlw A'0'
call transmit
movlw A'1'
call transmit
movlw A'3'
call transmit
movlw A'7'
call transmit
movlw A'0'
call transmit
movlw A'3'
call transmit
movlw A'7'
call transmit
movlw A'8'
call transmit
movlw A'4'
call transmit
movlw A'8'
call transmit
movlw A'"'
call transmit
movlw d'13'
call transmit
movlw d'10'
call transmit
call SECOND_1
return


MSG_ALM movlw A'P'      ;TEXT data being send
call transmit
movlw A'e'
call transmit
movlw A'm'
call transmit
movlw A'a'
call transmit
movlw A'n'
call transmit
movlw A'd'
call transmit
movlw A'u'
call transmit
movlw A' '
call transmit
movlw A'P'
call transmit
movlw A'e'
call transmit
movlw A'n'
call transmit
movlw A'g'
call transmit
movlw A's'
call transmit
movlw A'a'
call transmit
movlw A'n'
call transmit
movlw A'!'
call transmit
movlw A'!'
call transmit
movlw d'26' ;value for <ctrl Z>
call transmit
bcf RCSTA,CREN ;pulse cren off...
movf RCREG,W ;flush fifo
movf RCREG,W ; all three elements.
movf RCREG,W
bsf RCSTA,CREN ;turn cren back on.
          return


Delete1 call SECOND_1
call SECOND_1
call SECOND_1
   bcf RCSTA,CREN ;pulse cren off...
movf RCREG,W ;flush fifo
movf RCREG,W ; all three elements.
movf RCREG,W
movlw A'A' ;;set to text mode
call transmit
movlw A'T'
call transmit
movlw A'+'
call transmit
movlw A'C'
call transmit
movlw A'M'
call transmit
movlw A'G'
call transmit
movlw A'D'
call transmit
movlw A'='
call transmit
movlw A'1'
call transmit
movlw d'13'
call transmit
movlw d'10'
call transmit
call SECOND_1
call SECOND_1
return

;--------------------------------------- END of Program------------------------------------------------;


Analysis

The output from the program is " PEMANDU PENGSAN " . This message are sent to the user to mentioned that the driver are collapse or fainted during the driving. The message to the ambulance or police will be send if the driver did not push the reset button in a certain time that have been set.


Conclusion

During the programming part, what can be conclude is to generate a program is not easy. We must understand each single command in order to give the right command to the controller.

FYP 2 (WEEK 8)

WEEK 8


Title of Activity

  • Program for PIC and GSM (PART I)


Objective

  • To gain more knowledge from the programming
  • To create a program that suits the project


Content / Procedure


Microcontroller programming concept


;--------------------------PIC/HARDWARE SETTING----------------------

list p=pic16f877a
include p16f877a.inc
    __config 0x1E72
    errorlevel -302    ;Suppress bank warning

;----------------------------------------------------------------------
;VARIABLE DECLARATION
CBlock 0x20
N ; Delay registers.
N1
count1
counta
countb
countc
RXD
FIXDELAY


rxtime1
rxtime2

SMS1Counter ;SMS Alert counter
SMS2Counter
SMS3Counter
SMS4Counter
counter
;----------------------------------------------------------------------------------
org 0xFF
;---------------------I/O SETTING - DEFAULT INITIALIZATION--------------------------
start call initports ; Initialize Ports as output/inputs.
call setupUART
call INITLCD ; Initialize LCD 
call clrscreen ; Clear LCD SCREEN
call DisLCD
call visualdelay
call SECOND_1 ;3s delay before start main program
call SECOND_1
call SECOND_1
movlw d'0'
movwf SMS1Counter
movwf SMS2Counter
movwf SMS3Counter

;Initialize MODEM
;-----------------------------------------------------------------------------------------
bcf RCSTA,CREN ;pulse cren off...
movf RCREG,W ;flush fifo
movf RCREG,W ; all three elements.
movf RCREG,W
call SECOND_1
call SECOND_1
call SECOND_1
movlw A'A'      ;;test communication between microcontroller and GSM MODEM

call transmit
movlw A'T'
call transmit
movlw d'13'
call transmit
movlw d'10'
call transmit
call SECOND_1
call SECOND_1

movlw A'A' ;;set to text mode. 
call transmit
movlw A'T'
call transmit
movlw A'+'
call transmit
movlw A'C'
call transmit
movlw A'M'
call transmit
movlw A'G'
call transmit
movlw A'F'
call transmit
movlw A'='
call transmit
movlw A'1'
call transmit
movlw d'13'
call transmit
movlw d'10'
call transmit

call SECOND_1
call SECOND_1 ;delete SMS in memory 1 (receive SMS)
call Delete1
call clrscreen
call SECOND_1
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
bcf PORTD,2 ;Turn off Relay1
bcf PORTD,3 ;Turn off Relay2
bcf PORTD,4 ;Turn off Relay3

bcf PORTD,0
bcf PORTD,1
;------------------MAIN PROGRAM------------------------------------------------

main btfsc PORTA,0 ;Check Vibration
goto NORMAL
goto DETECTED

NORMAL call DisNormal
call SECOND_1
bcf PORTD,2 ;Turn off Relay1
bcf PORTD,3 ;Turn off Relay2
bcf PORTD,4 ;Turn off Relay3
bcf PORTD,0
bcf PORTD,1
movlw d'0'
movwf SMS1Counter
goto main

DETECTED movlw d'3'
movwf counter
Loop1 call SECOND_1
btfsc PORTA,0 ;Check Vibration
goto NORMAL
decfsz counter,1
goto Loop1
call DisWarning
bsf PORTD,2 ;Turn on Relay1
bsf PORTD,3 ;Turn on Relay2
bsf PORTD,4 ;Turn on Relay3
bsf PORTD,0
bsf PORTD,1
call SECOND_1
Loop2 movlw d'12'
movwf counter
Loop3 call SECOND_1
btfsc PORTA,0 ;Check Vibration
goto NORMAL
decfsz counter,1
goto Loop3
call DisWarning2
call SendAlm1
movlw d'1'
movwf SMS1Counter
call SECOND_1
goto Loop2
;----------------------------------------------------------------

Analysis

From the program, what we can say is PIC have 3 parts which is A,B and C . Port A and B are as input while PORT C act as output port. Every single port / pins have to be declare neither it can not function or can not be identified and this will cause the program to failed.


Conclusion

What we can conclude here, it takes a while to generate this program. I take about three days to make sure this program for PART I succeed.

FYP 2 (WEEK 7)

WEEK 7


Title of Activity
  • Test circuit

Objective
  • To make sure the circuit can function properly


Content / Procedure

Test the PIC circuit and LCD display

Test circuit for LCD display


Problem Statement
  • LCD did not display the output from PIC circuit

Solution
  • Change the the pin port in PIC circuit

Conclusion

As a conclusion,what we can conclude here in week 7 is we manage to troubleshoot the circuit and gain more knowledge about the LCD .