پاسخ : محافظ ولتاژ
بله بالاخره تونستم محافظ رو بعد از تست کردن کاملا عملی با اتوترانس(واریابل دقیق) بسازم. اونم با دقت0.5ولت! :wow: :nerd:
تکرار می کنم کاملا در عمل تست شده.
این مدار این جوریه که محدوده کارش 170 تا 250 ولت هست ولی اگه برق قطع بشه یا تغییر کنه این دفعه باید در محدوده180تا245 ولت باشه تا وصل بشه(برای از بین بردن نوسانات هنگام وصل شدن).موقع وصل شدن هم 30 ثانیه چشمک و بوق میزنه بعد برق رو وصل می کنه.
فایل شبیه سازی و برنامه و توضیحات مدار رو از اینجا دانلود کنید.
http://s2.picofile.com/file/71411461...mart_.zip.html
این نقشه مدار:

اینم متن برنامه:
راستی اینجا دوباره از وحید نصیری عزیز تشکر میکنم :job:
بله بالاخره تونستم محافظ رو بعد از تست کردن کاملا عملی با اتوترانس(واریابل دقیق) بسازم. اونم با دقت0.5ولت! :wow: :nerd:
تکرار می کنم کاملا در عمل تست شده.

این مدار این جوریه که محدوده کارش 170 تا 250 ولت هست ولی اگه برق قطع بشه یا تغییر کنه این دفعه باید در محدوده180تا245 ولت باشه تا وصل بشه(برای از بین بردن نوسانات هنگام وصل شدن).موقع وصل شدن هم 30 ثانیه چشمک و بوق میزنه بعد برق رو وصل می کنه.
فایل شبیه سازی و برنامه و توضیحات مدار رو از اینجا دانلود کنید.
http://s2.picofile.com/file/71411461...mart_.zip.html
این نقشه مدار:

اینم متن برنامه:
$regfile = "M8def.dat"
$crystal = 1000000
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portb.2 , Db5 = Portb.3 , Db6 = Portb.4 , Db7 = Portb.5 , E = Portb.1 , Rs = Portb.0
Config Adc = Single , Prescaler = Auto , Reference = Avcc
Config Clock = Soft , Gosub = Sectic
Config Portd = Output
Enable Interrupts
Enable Timer2
'-----------------------------------------------
Dim B As Word , Volt As Single , Seco As Byte , Lock As Bit , Fuse1 As Bit , Key1 As Bit , Key2 As Bit , Alarm As Byte
Cursor Off
Cls
Rele Alias Portd.0
Fuse1 = 1
Do
'-----------------------------------------------
Start Adc
B = Getadc(0)
Stop Adc
Waitms 100
Volt = B * 0.57
Home
Lcd "Volt = " ; Fusing(volt , "##.#"
; " [v] "
Lowerline
Lcd Seco ; " "
'----------------------------------------------- down
If Volt < 170 Then
Set Portd.1
Reset Portd.2
Reset Portd.3
Reset Rele
Lock = 0
Key1 = 1
Key2 = 0
End If
'----------------------------------------------- up
If Volt > 250 Then
Reset Portd.1
Reset Portd.2
Set Portd.3
Reset Rele
Lock = 0
Key1 = 0
Key2 = 1
Seco = 0
End If
'-----------------------------------------------normal
If Fuse1 = 1 Then
If Volt > 170 And Volt < 250 Then
Lock = 1
If Seco > 30 Then
Fuse1 = 0
Seco = 0
Lock = 0
Key1 = 0
Key2 = 0
Reset Portd.1
Set Portd.2
Reset Portd.3
Set Rele
End If
End If
End If
'******************************************** **
If Fuse1 = 0 Then
If Volt > 180 And Volt < 245 Then
Fuse1 = 0
Lock = 0
Reset Portd.1
Set Portd.2
Reset Portd.3
Set Rele
End If
End If
'-----------------------------------------------
Loop
End 'end program
Sectic:
If Lock = 1 Then
Incr Seco
If Key1 = 1 Then Toggle Portd.1
If Key2 = 1 Then Toggle Portd.3
Alarm = Seco Mod 2
If Alarm = 0 Then
Sound Portd.4 , 500 , 50
End If
If Alarm = 1 Then Reset Portd.4
End If
Return
$crystal = 1000000
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portb.2 , Db5 = Portb.3 , Db6 = Portb.4 , Db7 = Portb.5 , E = Portb.1 , Rs = Portb.0
Config Adc = Single , Prescaler = Auto , Reference = Avcc
Config Clock = Soft , Gosub = Sectic
Config Portd = Output
Enable Interrupts
Enable Timer2
'-----------------------------------------------
Dim B As Word , Volt As Single , Seco As Byte , Lock As Bit , Fuse1 As Bit , Key1 As Bit , Key2 As Bit , Alarm As Byte
Cursor Off
Cls
Rele Alias Portd.0
Fuse1 = 1
Do
'-----------------------------------------------
Start Adc
B = Getadc(0)
Stop Adc
Waitms 100
Volt = B * 0.57
Home
Lcd "Volt = " ; Fusing(volt , "##.#"

Lowerline
Lcd Seco ; " "
'----------------------------------------------- down
If Volt < 170 Then
Set Portd.1
Reset Portd.2
Reset Portd.3
Reset Rele
Lock = 0
Key1 = 1
Key2 = 0
End If
'----------------------------------------------- up
If Volt > 250 Then
Reset Portd.1
Reset Portd.2
Set Portd.3
Reset Rele
Lock = 0
Key1 = 0
Key2 = 1
Seco = 0
End If
'-----------------------------------------------normal
If Fuse1 = 1 Then
If Volt > 170 And Volt < 250 Then
Lock = 1
If Seco > 30 Then
Fuse1 = 0
Seco = 0
Lock = 0
Key1 = 0
Key2 = 0
Reset Portd.1
Set Portd.2
Reset Portd.3
Set Rele
End If
End If
End If
'******************************************** **
If Fuse1 = 0 Then
If Volt > 180 And Volt < 245 Then
Fuse1 = 0
Lock = 0
Reset Portd.1
Set Portd.2
Reset Portd.3
Set Rele
End If
End If
'-----------------------------------------------
Loop
End 'end program
Sectic:
If Lock = 1 Then
Incr Seco
If Key1 = 1 Then Toggle Portd.1
If Key2 = 1 Then Toggle Portd.3
Alarm = Seco Mod 2
If Alarm = 0 Then
Sound Portd.4 , 500 , 50
End If
If Alarm = 1 Then Reset Portd.4
End If
Return
راستی اینجا دوباره از وحید نصیری عزیز تشکر میکنم :job:
دیدگاه