Uploaded by Muhammad Haziq

RAIN SAFETY SYSTEM REPORT

advertisement
FAKULTI KEJURUTERAAN ELEKTRONIK & KEJURUTERAAN KOMPUTER
BENC2423 – MICROPROCESSOR TECHNOLOGY
PROJECT TITLE : RAIN SAFETY SYSTEM
NAME
MUHAMMAD HAZIQ BIN SHAARI
MATRIC ID
B021810074
NURUL HIDAYAH BINTI A.HALIM
B021810049
KAHTINISH A/L MURUGAIH
B021810065
THIVILAN A/L SHUNMUGAM
B021810117
Section : 1 BENG (SECTION 2)
Lecturer’s Name: DR MUHAMMAD IDZDIHAR BIN
1.1 ROLE OF THE PROCESSOR
To control the system by interfacing water sensor, dc motor, 3v relay, and led’s.
1.2 INNOVATIVE EMBEDDED IN THE SYSTEM
The innovation that were applied in this system are focusing on raining situation. Most of
current cars do not have this type of safety. It fully depends on the driver to slow down the
car and turn on the headlamp when it is raining. But, sometimes people tend to forget to do
so and it will probably lead to an accident. Cars will highly slipped off the road when the speed
is not in suitable way, this may cause a fatal accident with a high speed. Another thing is,
when the driver forgot to turn on the headlamp, other drivers may have a vision problem on
seeing the car. This also can lead to a fatal accident.
1.3 INPUT AND OUTPUT IN THE SYSTEM
INPUT
OUTPUT
Water Sensor
DC Motor
LED’s
____
2
1.4 OBJECTIVE
The main objective of this project is to reduce the accidents on the road.Vehicle drivers generally
forget to on their headlamp and manage their vehicle speed when raining. Through this project
we can facilitating guides who sometimes forget to on their headlamp when rain heavily and
maintain the speed on the road. This automatically can ensure that other user on the road in
safety condition so the number of accident on the road will decrease.
1.6 EQUIPMENT
1. Microprocessor LPC1768
2. Water Sensor
3. Led
4. 3V Relay
5. Switch
6. External power supply
7. Jumper wire
8. Crocodile clip
9. Breadboard
10. Multimeter
11. DC-DC Boost Converter (1v to 5v)
3
2. BLOCK DIAGRAM OF THE PROJECT
DC Motor
(Engine)
Water
sensor
MICROPROCESSOR
LPC 1768
LED’s
(Headlamp)
4
3. FLOWCHART OF PROJECT
5
4. SCHEMATIC CIRCUIT
6
5. CODDING
AREA
MYCODE, CODE, READONLY
ENTRY
EXPORT SystemInit
EXPORT __main
; code area (segment)
; start of area MYCODE
; export SystemInit symbol
; export __main symbol
;SENSOR REGISTERS
PINSEL4 EQU 0X4002C040
FIO2MASK EQU 0x2009C050
FIO2PIN EQU 0X2009C054
FIO2DIR EQU 0X2009C040
; PIN SELECT
; MASKING
; READ PIN CONDITION
; PIN DIRECTION
;LED AND RELAY REGISTERS
PINSEL0 EQU 0X4002C000
FIO0SET EQU 0X2009C018
FIO0CLR EQU 0X2009C01C
FIO0MASK EQU 0x2009C010
FIO0DIR EQU 0X2009C000
; PIN SELECT
; TURN ON LED
; TURN OFF LED
; MASKING
;PIN DIRECTION
EXPORT
SystemInit
SystemInit
; export SystemInit symbol
; SystemInit routine
;;SENSOR CONFIGURATION (DIGITAL INPUT)
;PINSEL1
LDR R0,=PINSEL4
LDR R1,=0x00000000
STR R1,[R0]
;FIO4DIR
LDR R0,=FIO2DIR
LDR R1,=0x00000000
STR R1,[R0]
;MASKING
LDR R0,=FIO2MASK
LDR R1,=0xFFFFFFDF
;SELECT P2.5
;SET P2.5 AS INPUT
;MASKING SENSOR
7
;;LED AND RELAY CONFIGURATION;;
;PINSEL0
LDR R0,=PINSEL0
LDR R1,=0x00000000
STR R1,[R0]
;FIO0DIR
LDR R0,=FIO0DIR
LDR R1,=0x00000300
STR R1,[R0]
;MASKING
LDR R0,=FIO0MASK
LDR R1,=0xFFFFFCFF
STR R1,[R0]
;SELECT P5 (P0.9) AND P6 (P0.8)
;SET P5 AND P6 AS OUTPUT
;MASKING LED AND RELAY
__main
; __main routine
LOOP
;FIQ0PIN
LDR R0,=FIO2PIN
LDR R1,[R0]
AND R1, R1,#0x00000020
CMP R1, #0x20
BEQ NOT_TRIGGERED
LDR R0,=FIO0SET
LDR R1,=0x00000300
STR R1,[R0]
;SET P21 INITIALLY AS 1 (NOT PRESSED)
;CHECK THE SENSOR ARE TRIGGERED OR NOT
;TURN ON LED AND RELAY
NOT_TRIGGERED
LDR R0,=FIO0CLR
LDR R1,=0x00000300
STR R1,[R0]
;TURN OFF LED AND RELAY
B LOOP
ALIGN
END
; ensure the area is memory aligned
8
DISCUSSION
We have managed to complete this project within given time. Our project’s title is Raining
Safety System that embedded inside a motorized vehicles. We chose this system because it is
suitable with Malaysia’s weather and driver’s behavior.
While working on this project, we have encountered many problems that may have change
a little bit concept of our first idea. One of the hardest part in this project is doing a program for
our system. It requires a lot of patience and determination to complete the program.
The main problem in our project is about controlling the speed of motor. If we direct the
DC motor into LPC1768 GPIO’s pin, the motor would not even move a bit because lacks of
voltage. Thus, we decided to use an external power source to power up the motor. But the
problem is on controlling the motor. We came up with an idea to use 3V relay that will be triggered
by the LPC1768. Sadly, it is still not working because the output voltage of LPC1768 for GPIO’s
pin is only 0.9V. We still have not give up, we try to use a DC-DC step up converter but it is still
not working because the converter requires minimum of 1V input. We tried to find a DC-DC step
up converter with a lower voltage input but the result is disappointment. At last, we just use a
normal SPST switch button to activate the relay replacing the LPC1768 automatic output signal.
9
CONCLUSION
In conclusion, this project completed almost as we wanted from our first idea. The only
disappointment is at the automatic activated relay. We forced to use the SPST switch to activate
the relay.
The result of this project just as we wanted, as the sensor detects water, the LED’s
(headlamp) will turns on and the speed of motor (engine) will reduce. This may be just a simple
system but it can greatly help to reduce the amount of accident’s rate especially in Malaysia where
the weather are always cloudy and raining. Everybody knows that we cant escape from driving
while raining, sometimes the weather is just unpredictable. While raining, our vision greatly
reduced so does the other drivers. If we not turn on the headlamp, the risk to get an accident is
high.
As for speed, this also contributes to an accident. Even on a dry weather people can
involved to accident due to speed, if it is while raining it can be more severe. With our roads
condition, there may be a puddles on the road that we did not notice while driving. Imagine a fast
car going straight into a puddle of water, what could happen ?. The car will lost control because
the tires is actually floating for a while and the slippery road will make it worst.
10
REFFERENCES
1.
2.
3.
4.
5.
https://os.mbed.com/platforms/mbed-LPC1768/
https://www.exploreembedded.com/wiki/LPC1768:_Register_Configuration(lpc17xx.h)
https://openlabpro.com/guide/led-blinking-using-lpc1768/
http://www.ocfreaks.com/lpc1768-gpio-programming-tutorial/
https://www.androiderode.com/how-to-use-keil-software/
11
APPENDIX
Figure 1: Water Sensor
Figure 3: Connection of LED’s
Figure 2: DC Motor (Engine)
Figure 4: Arm Cortex LPC1768
12
Figure 5: 3V Relay
Figure 6: External Power Supply
Figure 7: Testing complete circuit
13
Figure 8: Measure output voltage of LPC1768
Figure 9: DC-DC Boost Converter requires 1v
minimum voltage to operates
Figure 10: DC-DC Boost
converter replaced by
SPST ON/OFF switch
14
Download
Study collections