Sunteți pe pagina 1din 57

CHAPTER 1

INTRODUCTION

1.1 Background of Study

Nowadays, in many situations, a communication link between two devices that


are reasonably far apart becomes essential. RF communication widely used because of
its wide range. The two devices do not need to be in line of sight in order to function
since it can cross many obstacles. It is very popular in various everyday applications
such as radios, cell phones and satellites. The application of RF communication in the
study of flood alert system can improve the response time of the public safety worker
and better way for communication between public safety worker and the flooded area.
The flood alert system improves the vision of public safety workers towards the current
situation in a flood area. It also can improve the flood alert system especially in a rural
area. The projects goal is to help public workers handle emergency situation like
floods efficiently and cut off response time should save a lot of life.

1.2 Problem Statement

In certain area, flash flood can occur which cannot be forecasted by The
Meteorological Department. Since the flood came suddenly, many locals face the flood
unprepared or at least informed about it right before the flood came while the local
authorities are delayed in action to respond to the flood. Some cable network and
telecommunication station might also damage during the flood; the cable might short
circuit due to conductive nature of water.
The flood alert system directly informs the authorities regarding the flood via a
wireless communication. During flood, road transport and telecommunications are
disrupted and electricity supply is short-circuited. Since it is much safer and will less
likely to experience damage during the flood, the wireless communication is much
more reliable than cable network. It directly informs multiple authorities responsible for
emergency situation like fire-fighter and paramedic from the water level indicator.
Through this direct contact system, a lot of time can be saved and the public safety
workers can respond in time, saving a lot of life in the process.

Rain gauge and


water level stations

Info-Banjir
website.

Department of
Irrigation and
Drainage

Short
message
system (SMS)
alert to
officers incharge.

Figure 1.2.1: The current alert system

Locals

Local
Authoritie
s

Rain gauge and


water level stations

Local
Authorities

Figure 1.2.2: This project alert system

Figure 1.2.3: Flash flood in the city area

1.3 Objective of Research

These are objectives for this project:


1. To implement software coding using Visual Basic.
2. To receive information regarding the water level through the receiver.
3. To deliver information about the current water level to the authorities via
wireless communication.
In order to achieve above objective, the following tasks will be implemented upon this
project:
1. Review on any articles or publication from books and websites related to usage
of Visual Basic software and transmission antennae.
2. Design and simulate both a simple program using Visual Basic and the receiver
schematic circuit.
3. Analyze the output of both programs and schematic circuit.
4. Construct the prototype.
5. Troubleshooting and modification of the prototype will be conducted if
necessary.
6. The result of the experiment will be collected and analyzed.

1.4 Scope of Study

Flood alert system that is designed in this project is suitable to be use near the
city where water source is abundant and is prone to flash floods. This flood alert system
is low in cost. With this system, citizen will be informed about the flash flood where
they can prepare to avoid it in time.
This project focuses on the communication system during flood. This project
centre around the PIC that controls the signal sent and retrieved. The PIC is
programmed and transferred to the simulation circuit to test the coding. Since this
project focuses the communication part of the whole system, the sensor that detects the
water level at the transmitter is replaced by buttons.
The signal produced by the button is then sent by using RF communication and
sent to computer for processing. At this stage, the VB software is implemented where
the signal received presents the hazard level of the floods

CHAPTER 2
MATERIALS AND METHOD

2.1 Methodology

The RF communication is used throughout this project where information is


received from a transmitter to a receiver and then amplified. The amplified frequencies
that represents to different hazard of flood are then sent to a computer. Using software
called Visual Basic, the different hazard levels are determined and shown, and the
information is sent to the respective authorities. This project only focuses on the
communication part between transmitter and receiver, not on the transmitter part where
the water sensor is used.

Stage 1

Stage 2

The information
regarding the
flood is
transmitted via a
transmitter.

The information is
received via a receiver
and processed by a
computer.

Stage 3
The different hazard
level of flood is
determined using
Visual Basic.

Figure 2.1.1: Block Diagram of the overall project.

2.1.1 Flow Chart

The flow chart for this project is as illustrated as in Figure 2.1.1. The data is
presented by numbers ranging from 0 to 9. This data can be adjusted at the transmitting
end of the communication system by using a mini slide switch. After it is sent to the
receiver and processed by the PIC, the data, depending on the number that was sent will
lead to different hazard of flood level.
If the number ranging from 0 to 3 is received, the system will recognized it as
Flooding is expected, be prepared at the computer screen which represents the 1st
level of hazard level. If the number received is from 4 to 6, the system will recognized
it as Flooding is expected, immediate action is required at the computer screen,
representing the 2nd hazard level of the flood. Lastly, if the number range is 7 to 9, the
system will recognized it as Severe flooding, danger to life in which represents the 3rd
and last hazard level of the flash flood. If no number is received, it will wait the data to
be produced in the receiver part.
The data is shown at the computer screen via VB software. All the warning is
then sent to the local authorities for them to deal with and warn the locals about the
incoming flash flood

START
Transmit information about the
current water level at the water
source. (Numbers ranging from 0
to 9)
Receive data of
different number.
YES
Flooding is possible, be
prepared.

1-3
NO

Flooding is expected,
immediate action
required.

YES
4-6
NO
NO

YES
Flooding is severe,
danger to life.

7-9

Control Part
(Computer)

Send warning to
local authorities

END

Figure 2.1.1: Flow Chart of Flood Alert System.

2.2 Experimental Setup

2.2.1 Proteus Simulation

Proteus is software for microprocessor simulation, schematic capture, and


printed circuit board (PCB) design. Component of system:

ISIS schematic Capture a tool for entering designs

PROSPICE Mixed mode SPICE simulation industry standard SPICE35


simulator combined with a digital simulator.

ARES PCB Layout PCB design system with automatic component placer, ripup and retry auto-router and interactive design rule checking.

VSM Virtual System Modelling lets co simulate embedded software for


popular micro-controllers alongside hardware design.

System Benefits Integrated package with common user interface and fully
context sensitive help.

2.2.1.1 Schematic Capture

The circuit is simulated using the Proteus software. Step below shows the step
to complete the simulation. The simulation is created on a simple circuit using Proteus
software.
1. Firstly, click on the P button as shown in Figure 2.2.1.1.1.

Figure 2.2.1.1.1: How to click to Pick from Library

2. To find the desired component, write the component name at the left side box as
shown in Figure 2.2.1.1.2. From there, it will display the component that have
the closes name as the written component name.

Figure 2.2.1.1.2: How to find component from library

10

3. Place the chosen component on the schematic diagram as shown in Figure


2.2.1.1.3.

Figure 2.2.1.1.3: How to place components

4. Drag wire to connect the circuit as shown in Figure 2.2.1.1.4.

Figure 2.2.1.1.4: How to connect the components

5. After the circuit had been connected, push the run button to simulate the circuit
as shown in Figure 2.2.1.1.5.

Figure 2.2.1.1.5: How to simulate the circuit

11

2.2.1.2 PCB Layout

From the created circuit on the Proteus software, the PCB layout can be created
with the same software. The following step describe on making a PCB layout after the
circuit simulation is done.
1. Find the component that have footprint so the wire will be easy to be connected
or use connector CONN-H2 component at each voltage source, input and
output. Click the net list ARES to transfer the circuit into the layout as shown
in Figure 2.2.1.2.1.

Figure 2.2.1.2.1: How to transfer schematic diagram to PCB layout

Figure 2.2.1.2.2: How to put connector.


2. To create a new layout, click the Generic Single Layer and OK button as
shown in Figure 2.2.1.2.3.

12

Figure 2.2.1.2.3: How to create new layout

3. To set the size of PCB layout, board edge has to be created. Click the bottom
left box and then click the Board Edge at the left side as shown in Figure
2.2.1.2.4.

Figure 2.2.1.2.4: How to set the PCB layout size

4. Place the component according to the circuit given to make sure that the wires
are not overlap. The component also can be arrange and place as it is. After all
the component had been placed, click the AUTOROUTE button to create the
track as shown in Figure 2.2.1.2.5.

13

Figure 2.2.1.2.5: How to place component so that the wire not overlap to each
other
5. Click the Begin Routing button to create the track as shown in Figure
2.2.1.2.6. The blue colour represents the track connection.

Figure 2.2.1.2.6: How to create the track for the PCB layout

6. If there is a path that is not connected, it must be connected manually. Usually a


red circle will show the location of disconnected path. Click at the bottom left
and select Board Edge to make the size of the PCB as shown in Figure
2.2.1.2.7.

14

Figure 2.2.1.2.7: The component track

7. Gerber file can be created if there is no error in the layout. To create Gerber file,
click the output and choose Gerber / Excellon output as shown in Figure
2.2.1.2.8.

Figure 2.2.1.2.8: How to expect the layout to the Gerber file


8. If there is no fail mentioned as shown in, click the close button and proceed.
If there is fail mentioned, locate the error and fix it.

15

9. Next, make sure the bottom copper had been click to make the Gerber file.
Lastly, click OK button as shown in Figure 2.2.1.2.9.

Figure 2.2.1.2.9: Dialog box for Gerber file

16

2.2.2 Microsoft Visual Basic 2008 Express Edition

This project uses VB to show the data received on the computer screen. The
following step describe on making a new project.
1. Open Visual Basic software. Click File on the menu bar, and then click New
Project. Choose the icon Windows Forms Application from the Template list as
shown in Figure 2.2.2.1

Figure 2.2.2.1
.
2. Choose Common Controls on the left side and place it on the design as shown in
Figure 2.2.2.2.

17

Figure 2.2.2.2

3. Double click the on the button for programming. A programming window will
appear as shown in Figure 2.2.2.3.

Figure 2.2.2.3: Current status of the software

4. Program the button. For this example the program closes the window when it is
click as shown in Figure 2.2.2.4. If an error exists, locate it and fix it by referring to
reference book.

Figure 2.2.2.4

18

2.2.3 MPLAB X IDE

MPLAB X IDE is a software program that develops applications for Microchip


microcontrollers and digital signal controllers. It supports all 8-bit PIC microcontroller.
1. Open the MPLAB X IDE, click main menu and select File > New Project.
2. Choose the project type. From the categories choose Microchip Embedded.
From the project column, choose Standalone Project. Then Next as shown
in Figure 2.2.3.1.

Figure 2.2.3.1: Step to start a new project on MPLAB

3. Select device > Family > All Families. Then Device > PIC 16F877A > Next as
shown in Figure 2.2.3.2

Figure 2.2.3.2: Step to select a device

18

4. Select Tool > Hardware Tool > PICkit 2 > Next as shown in Figure 2.2.3.3.

Figure 2.2.3.3: Step to choose hardware tool

5. Select Compiler > XC8 > Next as shown in Figure 2.2.3.4.

Figure 2.2.3.4: Step to select compiler

6. Select Project Name and Folder > Project Name > Project Location > Project
Folder > Finish > Done as shown in Figure 2.2.3.5.

20

Figure 2.2.3.5: Step to select project name and folder

21

2.3 Equipment and Components

No.

Components

Quantity

1.

IC PIC 16F876A

2.

IC Socket-28 pin (slim)

3.

Crystal H49S (Low Profile) 20MHz

4.

Voltage Regulator +5V

5.

Diode 1N4007

6.

Diode 1N4148

7.

Electrolytic Capacitor 16V 10uF

8.

Ceramic Capacitor 0.1uF

9.

Ceramic Capacitor 30pF

10.

2510 PCB Connector 2 Ways

11.

Mini Slide Switch (PCB)

12.

DC Plug (Adaptor Socket)

13.

6x6x1 Push Button 2 Pins

14.

LED 3mm Green

15.

Resistor 1/4W 220R

16

16.

Resistor 1/4W 10K

17.

Resistor 1/4W 4K7

18.

Single core cable (Antenna) 18cm

19.

7 Segment Display 0.5(C/Cathode)

20.

RF Receiver 315MHz

21.

RF Transmitter 315MHz

22.

10 Ways Straight Box Header

23.

3mm screw & nut

24.

Header Pin 4 way (R/A)

25.

Header Pin 3 way

Table 2.3.1: List of Components for Receiver and Transmitter Part


22

No.

Components

Quantity

1.

AC to DC adaptor

2.

UIC00A Programmer

Table 2.3.2: List of Components for microC PIC programming

No.

Components

Quantity

1.

RS232 Shifter

2.

RS232 to USB

Table 2.3.3: List of components for connecting the circuit to computer

23

2.3.1.1 PIC 16F876A

PIC16F876A is the main component and act as the brain in this project circuit.
It controls the operation between the transmitter and receiver of the project.

Figure 2.3.1.1.1: PIC16F876A

Parameter

Value

Digital Communication

1xA/E/USART, 1 x MSSP(SPI/I2C)

Program Memory (KB)

14KB or 8K 14-bit Flash

RAM (bytes)

368

Data EEPROM (bytes)

256

Timers

2 x 8 bit, 1 x 16-bit

Comparators

Max Crystal Speed

20MHz

Capture/Compare/PWM

2 x CCP

Pin Count

28

Table 2.3.1.1: The features of PIC16F877A


24

2.3.1.3 Crystal H49S (Low Profile) 20MHz

The use of Crystal H49S (Low Profile) 20MHz is to provide clock at 20MHz. It
is resistance welded type crystal units. It is mass produced and low in cost.

Figure 2.3.1.3.1: Crystal H49S (Low Profile) 20MHz

25

2.3.1.4 Voltage Regulator +5V

Voltage regulator is designed to automatically maintain a constant voltage


level. It can be simple feed-forward or may include negative feedback control loop.
Figure 2.3.1.4.1 show a voltage regulator and Figure 2.3.1.5.2 show its circuit form.

Figure 2.3.1.4.1: Voltage Regulator

Figure 2.3.1.5.2: Voltage Regulator +5V circuit

26

2.3.1.5 Diode 1N4007

The 1N4007 diode is a general purpose silicon rectifier diode. It is commonly


used in AC adapter in common household appliances. Figure 2.3.1.5.1 shows a 1N4007
diode.

Figure 2.3.1.5.1: Diode 1N4007

27

2.3.1.6 Diode 1N4148

The 1N4148 Diode is a standard silicon switching diode. This component has a
much higher leakage current since leakage is almost never a desirable property. It is
known as a special diode that allows the flow of current in a forward path and also in
reverse direction thus producing breakdown voltage. Figure 2.3.1.6.1 shows a 1N4148
diode.

Figure 2.3.1.6.1: Diode 1N4148

28

2.3.1.7 RF Receiver 315MHz

The RF Receiver as shown in Figure 2.3.1.7.1 is very small in dimension. The


low cost RF receiver can be used to receive RF signal from transmitter at the specific
frequency which determined by the product specifications.

Figure 2.3.1.7.1: RF Receiver 315MHZ

29

2.3.1.8 RF Transmitter 315MHz

The RF Transmitter as shown in Figure 2.3.1.8.1 is both small and low-cost. It


also has a wide operating voltage range (3V-12V).

Figure 2.3.1.8.1: RF Transmitter 315MHz

30

2.3.1.9 Capacitor
2.3.1.9.1 Ceramic Capacitor

A ceramic capacitor is a fixed value capacitor in which ceramic material acts as


the dielectric. It is constructed of two or more alternating layers of ceramic and a metal
layer acting as the electrodes. The composition of the ceramic material defines the
electrical behaviour and therefore applications. Figure 2.3.9.1 shows a ceramic
capacitor.

Figure 2.3.9.1: Ceramic Capacitor

31

2.3.1.9.2 Multilayer Capacitor

Multilayer capacitors (MLCs) overcome this problem by interleaving dielectric


and electrode layers. The electrode layers are usually palladium or a palladium-silver
alloy. These metals have a melting point that is higher than the sintering temperature of
the. Figure 2.3.9.2 shows a multilayer capacitor.

Figure 2.3.9.2: Multilayer Capacitor

32

2.3.1.10 RS 232 Shifter

RS232 is a serial-port interface. It allows a microcontroller that uses RF


transmitter and RF receiver to communicate with computer. Figure 2.3.1.10.1 show the
schematic diagram of RS 232 shifter and Figure 2.3.1.10.2 show the RS 232 shifter
itself.

Figure 2.3.1.10.1: RS232 schematic diagram

Figure 2.3.1.10.2: RS232 Shifter

33

2.3.1.11 RS232 to USB Converter

RS232 to USB converter send data from RS232 Shifter to USB, since many
latest computers does not have DB9 connector. Figure 2.3.11 show a typical USB
Converter.

Figure 2.3.11: RS232 to USB Converter

34

2.3.1.12 LED
LED or Light Emitting Diode is a semiconductor light source. It is usually used
as an indicator lamp in many devices. Figure 2.3.1.12 shows a LED.

Figure 2.3.1.12: LED

35

CHAPTER 3
CIRCUIT DESIGN AND OPERATIONS

3.1 Schematic Diagram

Figure 3.1.1 below shows the schematic diagram for the transmitter part.

Figure 3.1.1
36

Figure 3.1.2 below shows the schematic diagram for the receiver part.

Figure 3.1.2

37

3.2 Circuit Operations

1. Figure 3.2.1 below shows the schematic of transmitter circuit in Proteus


simulation. After the circuit is switched on, the number at the 7-segment
initially is 0. It can be increase by pushing the push button at R12 and decrease
by pushing the push button at R11. The function of push button at R10 is to
initiate sending of the data. The data is processed and then transmitted by the
RF transmitter.

Figure 3.2.1: Transmitter circuit

2. Figure 3.2.2 shows the schematic of receiver circuit in Proteus simulation. After
the circuit is switched on, the RF receiver will receive data sent by the
transmitter. The data is processed and shows on the 7-segment.

38

Figure 3.2.2: Receiver circuit

39

3.3 PCB Designs

3.3.2 Procedures of Printed Circuit Board (PCB) Fabrications

Step 1:
Preparing the artwork by designing schematics and layout using Proteus software.
Step 2:
Generating Gerber File from the design.
Step 3:
Film Processing using photo plotter to process a film. The films are generated from
Gerber data.
a. Lift the photo lid and place fill on the drum fix it by masking tape along the top
and bottom edge.
b. Rotate the drum back to its initial position, and close the lid and set the switch
to auto mode.
c. After completing the photo plot film, open the lid and remove film. Immediately
using developer and fixed chemical to process film.
Step 4:
Cutting PCB.PCB board must be cut depend on circuit design size using PCB Shear
cutter.
a. Ensure the handle is firmly clamped to top bar of shear by the handle clamp and
place the handle in the vertical position.
b. Insert PCB board on the feed bed against the ruler and adjust to cut size using
ruler.
c. Hold PCB with one hand and pull the handle down with the other hand slowly
until horizontal position (PCB board will be cut).
40

d. Release the handle back to vertical position.


e. Remove the PCB board.

Step 5:
The PCB board needs to go through the Clean/Brush and Drying process. Wash the
board under tap with scotch brite.
a. Before placing the PCB board, close the top lid and turn on water supply,
MAINS, BRUSH, OSCILLATOR, CONVEYOR and DRYER. After that set
the oscillator and conveyor speed.
b. Put the PCB board through the brush cleaning machine, make sure copper clad
on top before input.
c. Twist the Brush Pressure Adjuster knob to adjust brush pressure on board
(Clockwise for tighter and anticlockwise for looser)
d. Remove board from the exit end of machine.
e. Repeat process (b) until PCB board is clean free from finger print.
f. Turn on the machine switch and press Heating button. Wait about 10 seconds
for heat up.
g. Finally, put the wet PCB board through conveyor PCB Dryer on right hand side
of the machine and collect dry PCB board from other end
Step 6:
Apply dry film photo resist on copper PCB board surface by using laminator. Make
sure there is no bubble after laminated.
a. Switch on the machine.
b. Set the temperature to 105. Press MEAS to measure the actual temperature of
rollers.
c. Set the roller speed to number 3
d. Put board into Board Dryer Machine to ensure PCB board is free of grease or
oxides before dry film lamination.
41

e. When temperature rollers are 105, insert PCB board between rollers and press
RUN.
f. Allow roller to run until the whole PCB board is covered with dry film
laminator.
g. Allow a little bit more of dry film to run then press STOP. This makes it easier
to cut dry film from the groove behind the machine.
h. Use a blade to cut off the dry film from the groove behind the machine.
i. Cut off excess dry film from the PCB board.
j. Switch OFF machine after use and close with black cloth.
Step 7
There is a lot of method for transferring the layout or artwork onto copper board. One
of them is by using UV exposure process.
a. Place a film toner face down o a laminated PCB board. Use transparent tape to
hold the film in position. Make sure3 that the laminated PCB board. Use
transparent tape to hold the film in position. Make sure that the film is oriented
correctly (tape on top over artwork/ top side of negative artwork).
b. Place PCB board in a vacuum UV exposure unit and run it for 20 seconds.
When UV light strikes the panels. It hardens the resist.
c. Remove the negative film and protective film from PCB board to reveal the
photo resist after exposure.
Step 8:
The exposed photo resist is removed chemically using developer, leaving the layout
photo resist on copper which is call Developer Process using Rota-spray Developer.
The parts that are to be etched should look like completely clean copper, no residue. A
well developed board should have solid traces and a clean copper background.
a. Make sure set the temperature at 35C (wait 10 minutes for heat-up) before
leave exposed PCB board.

42

b. Set timer for 1 min (over developer will damage the photo resist coating). The
developer removes the unexposed photo resist dry film. The areas of PCB board
that have been exposed to UV light will be hardened and cannot be removed by
the developing solution.
c. Put the PCB board into BOARD HOLDER, then insert BOARD HOLDER to
develop chamber.
d. Press START/STOP button to start developer. (Timer will count-down to
zero).
e. After processing has finished it is best to lift the board holder and leave residue
liquid drain into the develop chamber before putting to wash chamber.
f. Insert board holder to wash chamber, then turn ON the spray wash switch.
Step 9:
Next step is Etching Process. The board is placed in an etcher, which is a machine that
washes warm Ferric Chloride over the board eating away any exposed copper.
a. After washed, leave PCB board into etching machine conveyor until exit the
machine. The Etching removes machine removes the exposed copper.
b. The photo resist dry film protects the copper circuitry from being etched.
c. Turn on isolator switch to turn ON the machine.
d. If SUMP-LOW indicators turn on it means Ferric Chloride need to top up to
the set level.
e. Press START button and set temperature to 45C.
f. Turn ON conveyor and set the speed between 0-2 m/min.
g. Switch ON water supply.
h. Press START button next to MAINS ON the Ferric Chloride and water
start spraying now.
i. Insert PCB board to the right hand side of the machine.
j. Take out PCB board from etching machine.
k. Repeat step (h) & (i) if copper is not fully etched.
Step 10:
43

This process will remove all the photo resist from the etched circuit board revealing the
cooper that makes circuit on the board. The process is called Photo resist Stripper.
a. Leave PCB board into tank 1 (photo resist stripper at 45C which contain 1 liter
Photo resist Stripper a 4 litre water) approximately 3 minutes until all photo
resist film are removed. The photo resist stripper removed all photo resist dry
film on PCB board.
b. Put PCB board into tank 2 (Acid cleaner at 40C which contain 1 iter 1320 Acid
Cleaner and 4 litre deionizer water), immerse for 4 minutes until the board clean
and ready to prepare the copper for plating.
c. After that transfer PCB board into tank 3 (Micro Etch at 35C which contain
1305500g Micro Etch Solution and 5 litres water); immerse 4 minutes until the
board clear to have perfectly clean copper and ready to accept the chemical tin
plating.
d. Finally, transfer PCB board into tank 4 (Immersed Tin at 50C- which contain
PC 168 450g immerse Tin Powder and 5 litres deionizer water), immersed for 5
minutes.
e. Make sure, for each step, take out PCB board and spray wash for about 1
minute.
Step 11:
PCB board is applying a Dryer Process. This process required a dryer machine.
a. Turn on the machine via ON/OFF switch.
b. Press Heating and wait until about 10 second for heat up.
c. Insert wet PCB board on right hand side of the machine.
d. Collect dry PCB board from other end.
Switch OFF the machine after use.

44

CHAPTER 4
RESULT AND DISCUSSION

4.1 Software Simulation Result

4.1.1 Proteus
1. Figure 4.1.1.1 below shows simulation for voltage supply. The power source
that could be supplied for this circuit board is between 7V to 15V. Higher input
voltage will result in increase of heat at LM7805 voltage regulator. Typical
voltage would be 12V. However, with 12V supply, the LM7805 regulator will
still produce heat. In the figure below, the simulation supply 11.203V to
LM7805 voltage regulator and it regulates it to 5V.

Figure 4.1.1.1: Simulation result for voltage supply.

45

2. Figure 4.1.1.2 below show the simulation for push button. One I/O pin is
needed for one push button as input of PIC microcontroller. The I/O pin should
be pull up to 5V using a resistor and this will result an active-low input. When
the button is pressed, reading of I/O pin will be in logic 0, while when the
button is not pressed, reading of I/O pin will be logic 1.

Figure 4.1.1.2: Simulation for push button

46

4.1.2 Visual Basic

1. Figure 4.1.2.1 below shows the overall program for this project. An input is
insert to the program as shown on the Figure 4.1.2.2.

Figure 4.1.2.1: The overall program

Figure 4.1.2.2: Insert input

2. When the input with the range between 1 to 3 is insert, the display button is
click to show which Led is ON as shown in Figure 4.1.2.3.

47

Figure 4.1.2.3: Program display warning symbol

3. Led 1 is ON, because is in range of 1 to 3.


4. Warning Statement displays the status condition of the input as shown in
Figure 4.1.2.4.

Figure 4.1.2.4: The program displays the warning status

5.

Input range between 4 to 6 turns Led 2 ON and display the warning Flooding
is expected, immediate action required.

6. Those with input 7 to 9 turns Led 3 ON and display the warning Severe
Flooding, Danger to Life.
7. Reset button and Exit button. The Reset button is for resetting the
program and will revert to Figure 4.1.2.1, while the Exit button function is to
end the program.

48

4.2 Hardware Implementation Result

Figure 4.2.1 show the two hardware circuit for this project. The transmitter
circuit is on the left one and the receiver is the right one of the picture.

Figure 4.2.1: Tx and Rx circuit.

49

4.3 Circuit Testing and Troubleshooting

In order to test the communication circuit, the number can be increase and
decrease at the transmitter circuit. The same number is received at the receiver circuit
as shown in Figure 4.2.1.

In order to test the RS232 to USB connection, one of the RS232 is connected to
one of the USB as COM1 and another as COM2. The hardware connection is as shown
in Figure 4.3.1 where the transmitter pin (2) of the 1st RS232 to USB connection is
connected to the receiver pin (3) of the 2nd one and vice versa. Software called Hyper
Terminal is used to show the sending and receiving of data. The connection between
the two is a success as shown in Figure 4.3.2. However, this software only exists in
Windows XP. Furthermore, the Ports (COM & LPT) in Device Manager do not exist in
Windows 7. Figure 4.3.3 show the hardware connection.

Figure 4.3.1: Connection between RS232 to USB

50

Figure 4.3.2: Hyper Terminal Software

Figure 4.3.3: Hardware connection

51

4.4 Data Analysis and Discussions


4.4.1 Data Analysis

The circuit successfully sent data from the transmitter to the receiver. The same
number that is produced from transmitter circuit is received at the receiver circuit. This
indicates that the radio communication at frequency of 315MHz between the two
circuits is a success. The connection of RS232 to USB had been proven successful only
on Windows XP. Windows 7 does not detect the USB and in Device Manager, no COM
is detected.

52

4.4.2 Discussions

In Proteus software, the communication between transmitter and the receiver cannot
be simulated as there is no transmitter components exist or working in the library. The
power supplied for both transmitter and receiver circuit is 12V. However, the
PIC16F876A, RF Transmitter and RF Receiver all use voltage source of 5V and could
damage with 12V voltage source. In order to achieve this, a voltage regulator is added
to the circuit to regulate 12V into 5V.
In order to use the Visual Basic program, a RS232 serial-interface is used to transfer
the data from the circuit into the computer. However, many of today latest produced
computer does not have the DB9 connector that fits with RS232 serial-interface. To
solve this, a RS232 to USB converter is used to link the RS232 serial-interface with the
computer since all modern computers have USB interface. The RS232 needs a
controller between the communication circuit and PC.
The Visual Basic needs input and output (I/O) programs to receive data from the
serial COM Port. When starting this project, a lot of problems need to encounter in the
process, especially the designing of the program using the Visual Basic 2008 Software.
Firstly, the design must be connected to the button which in this case was the display
button. There are no problems for the typing of integers in the textbox as the program
wants the input in numbers. The main problem is to connect the button to display the
picture of a chosen Led to be display when a certain input is insert, but the input
displayed the same Led picture when different range of input was enter. OrElse is
confused to pick either 0 or numbers lower than 3.eventually the program should use
AndAlso because it need both ranges as written below.
If Input = 0 AndAlso Input <= 39 Then

53

CHAPTER 5
CONCLUSION AND RECOMMENDATION

5.1 Conclusion

As a conclusion, students have been able to design both transmitter and receiver
circuit for Flood Alert System project. The purpose of this project is to warn the local
authorities on the flash flood in shot time and at a very low cost is achieved. During the
process of doing this project students have learned to use a wide variety of software like
Proteus, Visual Basic and MPLAB. Students also have been able to turn a circuit design
from an idea into reality. This project teaches students to take an alternative if facing a
problem.
Students now understand the basic of Radio Frequency communication using
PIC16F876A as a controller. This project teaches students to do a project step by step
which is good for the future of the students. Other than that students understand the
basic use of PIC16F876A as a microcontroller device.

54

5.2 Recommendation

This project allows authorities to receive information regarding flash floods via
wireless communication and inform the locals to prepare. This project can save a lot
life and monetary damages, not to mention it is low cost and simple. It also makes the
rescuer job a lot easier since most people would already save themselves. It is very
useful to the people who do not want to get caught in the flood in their car or in their
premises.
This project can be further improved by sending the information not only to
local authorities but also to the people who live in the flood prone locations. This
information can be sent to them by using Short Message Service or SMS to them since
most people own cellular phone. This not only save the time spent by the local
authorities to inform the locals but also allocate them a lot of time to react to the
upcoming flash flood. If the SMS need to be sent to the locals, the circuit design needs
to be modified by adding a Global System for Mobile Communication (GSM) modem.
The transmitter and receiver used in this project can only communicate up to a
couple of meter away from each other. This can be improved by placing both of them at
high communication tower or simply high building. To have the best result, place both
of them at a high tower which is build on high building in the city are or mountains in
the rural area.

55

REFERENCES

Textbook
1. G.K. Mithal. Introductory Electrical Engineering.
2. Alexander Sadiku. Fundamentals of Electric Circuits. Fourth Edition. McGrawHill International Edition.
3. Diane Zak. (2008). Microsoft Visual Basic 2008 : Reloaded. Cencage Learning.
4. Qizheng Gu. (2006). RF System of Tranceiver for Wireless Communication.
Springer.
5. Andrei Grebennikov. (2004). RF and Microwave Power Amplifier Design.
McGraw Hill.
6. Jon B. Hagen. (2009). Radio-Frequency Electronic. Cambridge University Press.

Websites
1. http://www.hardwaresecrets.com/article/317
2. http://visualbasic.about.com/od/applications/a/whatisvb.htm
3. http://www.electronics-tutorials.ws/amplifier/amp_5.html
4. http://www.circuitstoday.com/transistor-amplifier
5. http://www.falstad.com/circuit/e-schmitt.html
6. http://www.nuffieldfoundation.org/practical-physics/transistor-current-amplifier
7. http://electronics.howstuffworks.com/relay.htm

56

APPENDICES

57

S-ar putea să vă placă și