Kali ini saya akan menjelaskan mengenai bagaimana membuat alat untuk pengaman sepeda motor, jadi prinsipnya terdapat mikrokontroller yang akan mendeteksi saat motor dinyalakan atau saat pengaman aktif, ketika pengaman aktif dan motor menyala / dicuri maka akan menghidupkan buzzer dan mematikan pengapian mesin sehingga motor akan mati / off, setelah itu pengaman akan mengirimkan sms ke pemilik motor melalui sms. berikut adalah penjelasan skematik dan programnya.
1. Skematik Minimum System
2. Skematik RS232
3. Modem Wavecom
4. Program Bascom AVR
$regfile = "m8def.dat"
$crystal = 8000000
$baud = 9600
Config Lcdpin = Pin , Rs = Portc.4 , E = Portc.5 , Db4 = Portc.0
Config Lcdpin = Pin , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3
Config Lcd = 16 * 2
Dim No_hp As String * 15
Dim Data_masuk As String * 100
Dim Cmti_pos As Byte , Cmgr_pos As Byte , Index_pos As Byte , Cmd_pos As Byte
Dim Pjg_sms_index As Byte , Pjg_data As Byte
Dim Sms_index As String * 3
Dim Cmd As String * 4
Dim Cmdbin As Byte
Dim Hp As String * 30
Hp = "085643619527" 'no HP yang dituju / Target
'On Urxc Getchar
'Dim Inchar As String * 1
'Enable Interrupts
'Enable Urxc
'buzzer
Ddrd.5 = 1
'relay
Ddrd.7 = 1
'sensor
Ddrd.6 = 0
Cls
Cursor Off
Do
If Pind.6 = 0 Then
Portd.5 = 1
Portd.7 = 1
Cls
Upperline
Lcd "MOTOR TIDAK AMAN"
Wait 3
Cls
Upperline
Lcd "Kirim sms"
Lowerline
Lcd Hp
Print "AT+CMGS=" ; Hp
Wait 1
Print "MOTOR TIDAK AMAN !!!"
Print Chr(26)
Wait 1
Upperline
Lcd "Sudah dikirim "
Wait 1
Else
Portd.5 = 0
Portd.7 = 0
Cls
Upperline
Lcd "MOTOR AMAN"
Wait 1
End If
Loop
$crystal = 8000000
$baud = 9600
Config Lcdpin = Pin , Rs = Portc.4 , E = Portc.5 , Db4 = Portc.0
Config Lcdpin = Pin , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3
Config Lcd = 16 * 2
Dim No_hp As String * 15
Dim Data_masuk As String * 100
Dim Cmti_pos As Byte , Cmgr_pos As Byte , Index_pos As Byte , Cmd_pos As Byte
Dim Pjg_sms_index As Byte , Pjg_data As Byte
Dim Sms_index As String * 3
Dim Cmd As String * 4
Dim Cmdbin As Byte
Dim Hp As String * 30
Hp = "085643619527" 'no HP yang dituju / Target
'On Urxc Getchar
'Dim Inchar As String * 1
'Enable Interrupts
'Enable Urxc
'buzzer
Ddrd.5 = 1
'relay
Ddrd.7 = 1
'sensor
Ddrd.6 = 0
Cls
Cursor Off
Do
If Pind.6 = 0 Then
Portd.5 = 1
Portd.7 = 1
Cls
Upperline
Lcd "MOTOR TIDAK AMAN"
Wait 3
Cls
Upperline
Lcd "Kirim sms"
Lowerline
Lcd Hp
Print "AT+CMGS=" ; Hp
Wait 1
Print "MOTOR TIDAK AMAN !!!"
Print Chr(26)
Wait 1
Upperline
Lcd "Sudah dikirim "
Wait 1
Else
Portd.5 = 0
Portd.7 = 0
Cls
Upperline
Lcd "MOTOR AMAN"
Wait 1
End If
Loop
No comments:
Post a Comment