Sie sind auf Seite 1von 44

CHAPTER 1 INTRODUCTION The sole aim of this project is to keep the unsafe vehicles of the road and allow

for electronic payment of toll. It alerts the enforcers of toll payment violation and debits the requisite amount in the earliest time possible. This system revolves around the wireless transmitter and receiver. Only the license holders will be allowed to pass through the toll plaza. RFID cards are provided to individual owner which is used as a smart card provided to individual owner and mounted on the front and rear side of vehicle. Authentication and current ownership of vehicle is maintained using this smart card .This card will be the gateway mechanism using which the vehicle can roam in the toll way. This RFID card will be used for ignition control of vehicle where we need to disclose the password to start up the initialisation process Last but not the least RFID tag mounted on each vehicle is used to pay toll automatically. This toll payment is monitored by the toll collection centre which is a simplified infrastructure and accounting system.

1.1 MICROCONTROLLER The AT89S51 is a low-power, high-performance CMOS 8-bit microcontroller with 4K bytes of In-System Programmable Flash memory. The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the indus-trystandard 80C51 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory pro-grammer. By combining a versatile 8-bit CPU with In-System Programmable Flash on a monolithic chip, the Atmel AT89S51 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. 1.2 TRANSMITTER MODULE The TWS-434 extremely small, and are excellent for applications requiring short-range RF remote controls. The transmitter module is only 1/3 the size of a standard postage stamp, and can easily be placed inside a small plastic enclosure. TWS-434: The transmitter output is up to 8mW at 433.92MHz with a range of approximately 400 foot (open area) outdoors. Indoors, the range is approximately 200 foot, and will go through most walls. 1.3 RECEIVER MODULE The receiver also operates at 433.92 MHz and has a sensitivity of 3 uv.TWS 433 receiver operates from 4.5 to 5.5 volts dc and has both linear and digital output.

1.4 ENCODER HT12E The 212 encoders are a series of CMOS for remote control system applications. They are capable of encoding information which consist of N address bits and 12N data bits. The programmed address/data are together with the header bits via RF transmission medium upon receipt of trigger signal. 1.5 DECODER HT12D The 212 decoders are a series of CMOS LSIs for remote control system applications. They are paired with Holteks 212 series of encoders (refer to the encoder/decoder cross reference table. For proper operation, a pair of encoder/decoder with the same number of addresses and data format should be chosen. The decoders receive serial addresses and data from a programmed 212 series of encoders that are transmitted by a carrier using an RF transmission medium. 1.6 POWER SUPPLY The ac voltage, typically 220V rms, is connected to a transformer, which steps that ac voltage down to the level of the desired dc output. A diode rectifier then provides a full-wave rectified voltage that is initially filtered by a simple capacitor filter to produce a dc voltage. This resulting dc voltage usually has some ripple or ac voltage variation. The regulator circuit removes the ripples and also remains the same dc value even if the input dc value changes. And this is usually obtained through the use of popular voltage regulator IC units.

1.7 RS 232 Serial communication is basically the transmission and reception of data one at a time. The serial port is used to convert each byte to a stream of ones and zeroes as well as to convert a streams of ones and zeroes to bytes. The serial port contains a electronic chip called a Universal Asynchronous Receiver/Transmitter (UART) that actually does the conversion When we look at the connector pinout of the RS232 port, we see two pins which are certainly used for flow control. These two pins are RTS, request to send and CTS, clear to send. With DTE/DCE communication (i.e. a computer communicating with a modem device) RTS is an output on the DTE and input on the DCE. CTS is the answering signal coming from the DCE. Before sending a character, the DTE asks permission by setting its RTS output. No information will be sent until the DCE grants permission by using the CTS line. If the DCE cannot handle new requests, the CTS signal will go low. A simple but useful mechanism allowing flow control in one direction. 1.8 MAX232 The Max 232 is a dual driver/receiver that includes a capacitive voltage generator to supply TIA/EIA-232-F voltage levels from a single 5V supply. The MAX232 acts as a buffer driver for the processor. It accepts the standard digital logic values of 0 and 5 volts and converts them to the RS232 standard of +10 and -10 volts. It also helps protect the processor from possible damage from static that may come from people handling the serial port connectors.

1.9 RELAY The relay is an electrically operated switch. The current flowing through the coil creates a magnetic field which attracts the lever and changes the switch contacts. The coil current can be on and off so relays have two switch positions and they are double switches. There is no electrical connection inside relay between the two circuits the link is magnetic and mechanical. .

CHAPTER 2 LITERATURE REVIEW 2.1 OBJECTIVE The prime object of this project is to overcome the disadvantages of the existing system and to maximize the utility of modern transportation. This innovation makes this system a flawless one. The existing system is quite tedious and time consuming where the vehicle needs to wait for long hours and causing inconvenience to commuters The main objective is to allow for electronic payment of toll and alerts enforcers of toll payment violation and debits the participating account. Further it provides various other benefits such as if a vehicle is registered or not is determined .Vehicle waiting time is reduced and emissions of harmful effluents is reduced to a greater extent providing a fast and efficient service.

2.2 BLOCK DIAGRAM

2.2.1 DESCRIPTION The automatic toll collection or electronic toll collection comprises of vehicle and toll collection block which is monitored by the toll collection centre. Each individual owner of the vehicle is provided with a license fulfilling registration information, type of vehicle, toll scheme implemented and lastly some personal information for recovery purpose during accidents.

A RFID tag is mounted on the front or rear side of the vehicle which continually transmits information that the vehicle is approaching the toll centre. User license card is used for ignition control which on detection by the receiver in the vehicle asks for the user password for authentication and safety. Invalid pin wont be accepted and on disclosing the valid password only, initialisation process begins. Hence authentication of vehicle is maintained and vehicle theft can be scrutinized to a greater extent. When the vehicle approaches the toll gate i.e. particular defined distance information regarding is detected via RF transmission medium by the receiver in toll monitoring room. At last a requisite amount is debited without the vehicle being stopped. Even though if the concerned owner is not having a sufficient balance, the requisite amount will be debited from his account and he would be having negative balance which need to be credited by him within a stipulated period of time. Therefore efficiency of transportation is being maintained and good quality of service is provided and congestion of traffic at toll gate is avoided.

2.3 VEHICLE SECTION

2.3.1 DESCRIPTION: 1. It transmits the encoded data to the toll gate section that a vehicle is nearing few metre distances away. 2. Every individual vehicle is provided with a RFID tag which transmits the information using the unlicensed frequency band of 433.92 MHz

2.4 LICENSE SECTION

2.4.1 DESCRIPTION: 1. To maintain the current ownership of the vehicles an individual card is given to each owner which contains the confidential information about the vehicle ownership. 2. The encoded data from the card is transmitted to the toll section to check out whether vehicle registration is fulfilled or not.

10

2.5 IGNITION CONTROL SECTION

2.5.1 DESCRIPTION: 1. The sole aim of using this section is for password verification, which controls the ignition of the vehicle. 2. The encoded information is given to the receiver section provided within the vehicle where the owner needs to disclose the unique password which controls the ignition of the vehicle.
11

2.6 TOLL SECTION

2.6.1 DESCRIPTION 1. In this section after acquiring the ownership information, toll section performs the vital operation. 2. Toll section maintains a database of all the vehicles crossing through the toll and improves the overall quality of service. Last but not the least debit collection is done automatically and gate is opened which is controlled through stepper motor. 3. Hence theft of vehicles, waiting times is reduced to a greater limit.
12

2.7 CIRCUIT DIAGRAM OF VEHICLE SECTION

2.7.1 DESCRIPTION 1. The programmed addresses/data are transmitted together with the header bits via an RF transmission medium. 2. HT-12E is capable of encoding information which consists of N address bits and 12N data bits.

13

3. Dout transmits the concerned information to the data pin of RF transmitter which is send via medium through the antenna of TWS 434 RF module.

2.8 CIRCUIT DIAGRAM OF TOLL SECTION

14

2.8.1 DESCRIPTION

15

1. Toll section consist of HT-12D which receive serial address and data from encoder that are transmitted by using transmission through the Din pin of decoder. 2. They compare the serial input data three times continuously with their local address and if no error occurs data are transmitted to the output pin. Valid transmission pin goes high. 3. AT89S51 is the heart of this section which includes pull up resistor for heavy devices connected to port o.Relay is used for the motor and the alarm. Decoded output is given to port 2 of microcontroller.P3.0 and P3.1 are used as UART pins which are transmits the TTL logic which is converted to RS 232 logic by MAX 232 level converter IC. 4. MAX 232 includes two transmitter and receiver pins so two serial ports can be used with a single chip 5. Transmit and receive data pins are used in RS 232 and fifth pin is for signal ground which helps us to monitor the data. RF

16

2.9 C CODE FOR TOLL #include<reg51.h> #include<stdio.h> sbit TollA = P2^0; sbit TollB = P2^1; sbit TollC = P2^2; sbit LicA = P1^0; sbit LicB = P1^1; sbit LicC = P1^2; sbit alarm = P0^0; sbit Motor = P0^7; //--------------------------------Serial Initialization--------------------------------void Serial_Init() { SCON = 0x50; // setup serial port control // hardware (1200 BAUD TMOD = 0x20; @11.05592MHZ) TH1 = 0xfd; // TH1 9600 Baud rate TR1 TI = 1; } //-------------------------------------Delay---------------------------------------void DelayMs(unsigned char n) { unsigned char i,j; for(i=0;i<n;i++)
17

= 1;

// Timer 1 on

for(j=0;j<250;j++); } //-----------------------------------------------------------------------------------------void alert() { unsigned int a; for(a=0;a<10;a++) { alarm = 1; DelayMs(10); alarm = 0; DelayMs(10); } } void run_Motor() unsigned int m; for(m=0;m<10;m++) { Motor = 1; DelayMs(30); Motor = 0; DelayMs(20); } } //------------------------------------Main Program----------------------------------------void main() { //unsigned char a,b,i; P2 = 0xFF; P1 = 0xFF;
18

P0 = 0x00; Serial_Init(); EA = 1; ES = 1; while(1) { if (TollA == 0) { SBUF = 'X'; DelayMs(1000); while(TollA == 0); } if (TollB == 0) { SBUF = 'Y'; DelayMs(10); while(TollB == 0); } if(TollC == 0) { SBUF = 'Z'; DelayMs(10); while(TollC == 0); } if(LicA == 0) { SBUF = 'A'; DelayMs(10); while(LicA == 0);
19

} if(LicB == 0) { SBUF = 'B'; DelayMs(10); while(LicB == 0); } if(LicC == 0) { SBUF = 'C'; DelayMs(10); while(LicB == 0); } } } //------------------------------------Interrupt----------------------------------------void serin (void) interrupt 4 unsigned char c; ACC = SBUF; c=ACC; if(RI==1) { if (c == 'Z') { alert(); } else if (c == 'R') { run_Motor();
20

} } RI = 0; SCON = 0x50; }

21

2.10 VISUAL BASIC CODING 2.10.1 VISUAL BASIC CODE FOR LICENSE Public clicks As Integer Dim RsCheck As New ADODB.Recordset Private Declare Sub Sleep Lib "kernel32" (ByVal sleepTime As Long) Private Sub Command1_Click() 'WmPlayBack.Close 'Frame2.Visible = True rs.Open "Select * from Personal", ConL, 1, 2 MsgBox rs.RecordCount rs.Close End Sub Private Sub Form_Load() Call Module1.main Label1.Visible = True Label2.Visible = True Label3.Visible = True lblPIN.Visible = True Call Invisible TmrClicks.Enabled = True TmrProgress.Enabled = False 'WmPlayBack.URL = App.Path & "\Images\formclip.avi" With MSCommCard .CommPort = 1 .Handshaking = 0 .RThreshold = 1 '.SThreshold = 10
22

' change port no.

'.RTSEnable = True .InputMode = comInputModeText .Settings = "9600,n,8,1" .PortOpen = True .InputLen = 1 End With Label3.Caption = "" lblPIN.Caption = "" 'Text1.Visible = False Call InvisNew 'Frame2.Visible = True End Sub Private Sub InvisNew() ' txtName.Visible = False ' txtBgroup.Visible = False ' txtLocation.Visible = False ' Label4.Visible = False ' Label5.Visible = False ' Label6.Visible = False End Sub Private Sub Invisible() Dim i As Integer 'Frame2.Visible = False Label1.Visible = False Label2.Visible = False 'For i = 0 To 7 ' CmdButton(i).Enabled = False 'Next 'For i = 0 To 3
23

' lblLeft(i).Visible = False ' lblRight(i).Visible = False 'Next End Sub Private Sub MakeVisible() Dim i As Integer Frame2.Visible = True ' Picture1.Picture = App.Path & "\Images\wallpaper-1024x768005.jpeg" Label1.Visible = False Label2.Visible = False Label3.Visible = False lblPIN.Visible = False End Sub Private Sub MSCommCard_OnComm() Dim StrData As String Select Case MSCommCard.CommEvent Case comEvReceive StrData = MSCommCard.Input Call Handle(StrData) End Select End Sub Private Sub Handle(ByVal Data As String) Select Case Data Case "X" Call Check("SB400") Case "Y" Call Check("SB500") Case "Z"
24

Call Check("SB600") End Select End Sub Private Sub Check(ByVal ID As String) Dim Note As String RsCheck.Open "Select * from Personal where ACCNO = '" & ID & "' ", ConL, 1, 2 Log = RsCheck(0) Pw = RsCheck(1) Label7.Visible = False If Right(Time, 2) = "AM" Then Note = "Good Morning" ElseIf Time > "5" Then Note = "Good Evening" Else Note = "Good AfterNoon" End If If RsCheck.RecordCount > 0 Then 'WmPlayBack.Close Label1.Visible = True Label2.Visible = True Frame2.Visible = True 'Frame1.BackColor = &H404080 Label1.Caption = Note & vbCrLf & vbCrLf & RsCheck(2) Label2.Caption = "Please Enter your PIN" txtPIN.SetFocus End If 'RsCheck.Close End Sub
25

Private Sub TmrClicks_Timer() If Len(txtPIN) = 4 Then 'MsgBox "HI" TmrClicks.Enabled = False End If End Sub Private Sub TmrProgress_Timer() If Len(Label3.Caption) < 35 Then Label3.Caption = Label3.Caption & "|" Else TmrProgress.Enabled = False 'Unload Me 'Me.Show Call MakeVisible 'Frame1.BackColor = RGB(120, 100, 180) Picture1.Picture = LoadPicture(App.Path & "\Images\yes.bmp") ' ' ' ' txtName.Visible = True txtBgroup.Visible = True txtLocation.Visible = True Label4.Visible = True ' Label5.Visible = True ' Label6.Visible = True Call FillDetails End If End Sub Private Sub FillDetails() ' txtName = RsCheck(2) ' txtBgroup = RsCheck(3) ' txtLocation = RsCheck(4)
26

Label4.Visible = True MSCommCard.Output = "R" Sleep (1000) MSCommCard.Output = "R" MSCommCard.Output = "R" RsCheck.Close End Sub Private Sub txtPIN_Change() If txtPIN <> "" And Len(txtPIN) = 4 Then If Pw = txtPIN Then TmrProgress.Enabled = True Cnt = 0 Else Cnt = Cnt + 1 If Cnt = 3 Then MSCommCard.Output = "Z" Sleep (1000) MSCommCard.Output = "Z" If MsgBox("Invalid User " & vbCrLf & "Process Failed to Start!", vbCritical, "Terminate") = vbOK Then End Else Label2.Caption = "Invalid PIN!" lblPIN.Caption = "" txtPIN.Text = "" txtPIN.SetFocus Sleep (2000) Label2.Caption = "Re Enter your PIN !" 'Me.Hide 'Unload Me
27

'frmWelcome.Wmplayer1.URL = App.Path & "\Images\PIN_Error.avi" 'frmWelcome.Show End If End If End If End Sub Private Sub txtPIN_KeyPress(KeyAscii As Integer) If KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0 Else lblPIN.Caption = lblPIN.Caption & "*" End If End Sub Public ConL As New ADODB.Connection Public ConR As New ADODB.Connection Public rs As New Recordset Public Log, Pw As String Public Cnt As Integer Public Sub main() ConL.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Users.mdb;Persist Security Info=False") ' frmDataEnv.Show vbModal Cnt = 0 End Sub

28

2.10.2VISUAL BASIC CODE FOR TOLL DETAILS Dim StrData As String Public contest As New ADODB.Connection Function lockit() txtname.Locked = True txtlicence.Locked = True cmbtollscheme.Locked = True cmbtype.Locked = True End Function Function unlockit() txtname.Locked = False txtlicence.Locked = False cmbtollscheme.Locked = False cmbtype.Locked = False End Function Private Sub cmdadd_Click() 'txtregno.Text = "" 'Call CLEARALL lblstat.Caption = "" txtregno.Locked = False txtregno.SetFocus strname = txtregno.Text If strname <> "" Then 'MsgBox rsadd.RecordCount rstest.Open "Select * from info Where RegNo = '" & strname & "' ", conn, 1, 2 'rstest.Open "Select * from info where RegNo =" & txtregno.Text, conn, adOpenDynamic, 2
29

'MsgBox rstest.RecordCount If rstest.RecordCount > 0 Then 'MsgBox "You are ALREADY on Record!", vbInformation, App.Title & " - ADD " lblstat.Caption = "This RECORD Already Exists!!" tmrblink.Enabled = True txtname = rstest(1) cmbtollscheme.Text = rstest(2) cmbtype.Text = rstest(3) txtlicence = rstest(4) On Error Resume Next imgperson.Picture = LoadPicture(rstest(5)) cmdsave.Enabled = False Else lblstat.Caption = "Click the SAVE button to add the record" cmdsave.Enabled = True Call unlockit txtregno.Locked = True End If rstest.Close 'rsadd.Close Else lblstat.Caption = "Enter the New Registration Number to Begin!" End If End Sub Private Sub cmdbrowse_Click() With dlgtools .DialogTitle = "Open" .CancelError = False
30

.Filter = "All file (*.jpg)|*.jpg" .ShowOpen If Len(.FileName) = 0 Then Exit Sub imgperson.Picture = LoadPicture(.FileName) StrData = .FileName End With End Sub Private Sub Command5_Click() End Sub Private Sub cmdexit_Click() Unload Me LOAD.Show End Sub Private Sub cmdsave_Click() rsadd.Open "Select * from info", conn, 1, 2 If StrData <> "" Then 'MsgBox rsadd.RecordCount If txtname.Text <> "" And txtregno.Text <> "" And txtlicence <> "" And cmbtollscheme.Text <> "" And cmbtype.Text <> "" And StrData <> "" Then rsadd.AddNew rsadd(0) = txtregno rsadd(1) = txtname rsadd(2) = cmbtollscheme.Text rsadd(3) = cmbtype.Text rsadd(4) = txtlicence rsadd(5) = StrData rsadd(6) = Right(cmbtollscheme.Text, 3)
31

MsgBox rsadd(6) rsadd.Update rsadd.MoveLast rsadd.MoveFirst MsgBox rsadd.RecordCount MsgBox "Successfuly updated" Call CLEARALL Else MsgBox "Please Fill all the columns!", vbCritical, App.Title & "- ADD DETAILS " End If Else MsgBox "Please select an Image !", vbCritical, App.Title & "- Add Details" End If rsadd.Close End Sub Function CLEARALL() txtregno = "" txtname = "" txtlicence = "" cmbtollscheme.Text = "" cmbtype.Text = "" tmrblink.Enabled = False 'imgperson.Visible = False StrData = "" imgperson.Picture = LoadPicture(StrData) txtregno.Locked = False End Function
32

Private Sub Command1_Click() Call CLEARALL End Sub Private Sub Form_Load() 'MsgBox imgperson.Picture 'Dim contest As New ADODB.connection 'contest.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Customers.mdb" 'contest.Open 'contest.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\start.mdb;Persist Security Info=False" Dim rec As New ADODB.Recordset tmrblink.Enabled = False cmbtollscheme.List(0) = "RC200" cmbtollscheme.List(1) = "RC500" cmbtype.List(0) = "HMV" cmbtype.List(1) = "LMV" cmdedit.Enabled = False cmdsave.Enabled = False cmddelete.Enabled = False 'rstest.Open "Select * from login", contest, 1, 2 'MsgBox rstest.RecordCount 'rstest.Close lblstat.Caption = "Click ADD button to add new records" txtregno.Locked = True Call lockit

33

End Sub Private Sub tmrblink_Timer() If lblstat.Visible = True Then lblstat.Visible = False Else lblstat.Visible = True End If End Sub Private Sub txtregno_Change() cmdedit.Enabled = True If txtregno.Text <> "" Then cmdedit.Enabled = False End Sub Private Sub txtregno_KeyPress(KeyAscii As Integer) If txtregno.Locked = True Then lblstat.Caption = "Click CLEAR to enter new Registration Number!" End Sub 2.10.3 VISUAL BASIC CODE FOR TOLL VIEW Public rsViewOUT As New ADODB.Recordset Public rsAdvSelect As New ADODB.Recordset Public rsControl As New ADODB.Recordset Private Sub cmbOption_Click() cmbSelect.Clear Dim rsOption As New ADODB.Recordset
34

'rsOption.Open "Select * from info where " & rsViewInfo.Fields(cmbOption.Text) & " = *", conn, 1, 2 rsOption.Open "Select * from info", conn, 1, 2 If cmbOption.Text = rsOption.Fields(3).Name Then cmbSelect.List(0) = "LMV" cmbSelect.List(1) = "HMV" ElseIf cmbOption.Text = rsOption.Fields(2).Name Then cmbSelect.List(0) = "RC200" cmbSelect.List(1) = "RC500" Else For i = 0 To rsOption.RecordCount - 1 'rsViewInfo.RecordCount 1 cmbSelect.List(i) = rsOption.Fields(cmbOption.Text) rsOption.MoveNext Next End If rsOption.Close End Sub Private Sub cmbOption_GotFocus() ' On Error Resume Next 'rsAdvSelect.Close End Sub Private Sub cmbOption_LostFocus() 'MsgBox "HI" End Sub Private Sub cmbSelect_Click()

35

rsAdvSelect.Open "Select * from info where " & cmbOption.Text & "= '" & cmbSelect.Text & "' ", conn, 1, 2 Set rsControl = rsAdvSelect Call ViewDetails(rsAdvSelect) 'rsAdvSelect.Close fmeAdvanced.Visible = False fmeControl.Visible = True End Sub Private Sub cmdback_Click() Me.Hide LOAD.Show End Sub Private Sub cmdFirst_Click() cmdLast.BackColor = &HC0C000 cmdNext.BackColor = &HC0C000 If rsAdvSelect.BOF = False Then rsAdvSelect.MoveFirst Else cmdFirst.Enabled = False If rsAdvSelect.BOF = False Then Call ViewDetails(rsAdvSelect) Else cmdFirst.BackColor = RGB(200, 0, 0) End If End Sub Private Sub cmdLast_Click() cmdFirst.BackColor = &HC0C000 cmdPrev.BackColor = &HC0C000
36

If rsAdvSelect.EOF = False Then rsAdvSelect.MoveLast If rsAdvSelect.EOF = False Then Call ViewDetails(rsAdvSelect) Else cmdLast.BackColor = RGB(220, 0, 0) End If End Sub Private Sub cmdNavigate_Click() fmeControl.Visible = False fmeAdvanced.Visible = True If rsAdvSelect.State = 1 Then rsAdvSelect.Close End Sub Private Sub Command6_Click() End Sub Private Sub Command4_Click() End Sub Private Sub cmdNext_Click() cmdFirst.BackColor = &HC0C000 cmdPrev.BackColor = &HC0C000 If rsAdvSelect.EOF = False Then rsAdvSelect.MoveNext Else cmdNext.Enabled = False If rsAdvSelect.EOF = False Then Call ViewDetails(rsAdvSelect) Else cmdNext.BackColor = RGB(220, 0, 0) End If

37

End Sub Private Sub cmdPrev_Click() cmdLast.BackColor = &HC0C000 cmdNext.BackColor = &HC0C000 If rsAdvSelect.BOF = False Then rsAdvSelect.MovePrevious Else cmdPrev.Enabled = False If rsAdvSelect.BOF = False Then Call ViewDetails(rsAdvSelect) Else cmdPrev.BackColor = RGB(200, 0, 0) End If End Sub Private Sub cmdStop_Click() cmdFirst.Enabled = True cmdNext.Enabled = True cmdPrev.Enabled = True cmdLast.Enabled = True End Sub Private Sub Form_Load() txtregno.Locked = True txtname.Locked = True txtlicence.Locked = True txtBalance.Locked = True txtType.Locked = True txttollscheme.Locked = True
38

lbltime.Caption = Time tmrtime.Enabled = True Label6.Caption = mon(Month(Now) - 1) & " " & Day(Now) & " " & Year(Now) & Label6.Caption 'rsViewOUT.Open "Select * from info where RegNo ='" & Regnum & "' ", conn, 1, 2 rsAdvSelect.Open "Select * from info", conn, 1, 2 Call ViewDetails(rsAdvSelect) 'rsViewOUT.Close fmeAdvanced.Visible = False End Sub Private Sub tmrtime_Timer() lbltime.Caption = Time End Sub Private Sub ViewDetails(ByVal rsViewinfo As ADODB.Recordset) 'Dim rsViewReci As New ADODB.Recordset Dim i As Integer 'rsViewInfo.Open "Select * from info where RegNo ='" & Regnum & "' ", conn, 1, 2 'rsViewReci.Open "Select * from recieve where RegNo ='" & Reg & "' ", conR, 1, 2 If rsViewinfo.RecordCount > 0 Then txtregno = rsViewinfo.Fields(0) txtname = rsViewinfo(1)
39

txttollscheme = rsViewinfo(2) txtType = rsViewinfo(3) txtlicence = rsViewinfo(4) On Error Resume Next imgperson.Picture = LoadPicture(rsViewinfo(5)) txtBalance = rsViewinfo(6) End If For i = 0 To rsViewinfo.Fields.count - 3 cmbOption.List(i) = rsViewinfo.Fields(i).Name Next End Sub 2.10.4 VISUAL BASIC CODE FOR TOLL Private Sub Command1_Click() End Sub Private Sub cmdlogin_Click() Dim count As Integer count = 0 'cmdlogin.Enabled = False rs.Open "Select * from login", con, 1, 2 rs.Update rs.MoveLast rs.MoveFirst 'For i = 0 To rs.RecordCount - 1
40

While (count < rs.RecordCount) 'If count < rs.RecordCount Then If rs(0) = LCase(txtusername.Text) And rs(1) = txtpassword.Text Then 'MsgBox "Login Success", vbInformation, "Login" While (proglogin.Value < 900) proglogin.Value = proglogin.Value + 100 Wend LOAD.start = True LOAD.Connection = True LOAD.details = True LOAD.Log = False LOAD.lblloginfo.Caption = "Logged in as User : " & txtusername.Text & "" rs.Close Unload Me LOAD.Show Exit Sub Else rs.MoveNext count = count + 1 End If 'rs.Close Wend If count = rs.RecordCount Then 'Else msg = MsgBox("Login failed!", vbAbortRetryIgnore, "Login") If msg = vbRetry Then rs.Close Unload Me
41

Me.Show ElseIf msg = vbIgnore Then rs.Close Unload Me LOAD.Show Else rs.Close End End If End If 'Next 'rs.Cl ose End Sub Private Sub cmdlogin_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) 'tmrlogin.Enabled = True End Sub Private Sub cmdlogin_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) 'tmrlogin.Enabled = True End Sub Private Sub Form_Load() 'Call Module1.start 'LOAD.start = False tmrlogin.Enabled = False rs.Open "Select * from login", con, 1, 2
42

While Not rs.EOF = True 'txtusername.ToolTipText = txtusername.ToolTipText & vbCrLf & rs(0) rs.MoveNext Wend rs.Close End Sub Private Sub Form_Unload(Cancel As Integer) 'con.Close End Sub Private Sub Timer1_Timer() End Sub Private Sub tmrlogin_Timer() cmdlogin.BackColor = RGB(Rnd * 255, Rnd * 255, 255) End Sub

43

CHAPTER -3 CONCLUSIONS AND SCOPE OF FUTURE WORK Thus our project will be a new attempt at the student level being a real time project, student will have wide exposure to the real time development of the project. Our project helps in electronic toll collection and alerts enforcers of toll payment violations and debits the participating account. The basic principles of microcontroller, encoder, and decoder were thoroughly studied prior to the application in the project. This real time application can be implemented over a large scale and efficiency can be enhanced within shortest possible time.

44

Das könnte Ihnen auch gefallen