امتیاز موضوع:
  • 1 رأی - میانگین امتیازات: 5
  • 1
  • 2
  • 3
  • 4
  • 5
مشكل در اندازه گيري دما توسط سنسور ds18b20
نویسنده پیام
moham9d آفلاین
تازه وارد

ارسال‌ها: 7
موضوع‌ها: 1
تاریخ عضویت: آبان ۱۳۹۳

تشکرها : 1
( 0 تشکر در 0 ارسال )
ارسال: #1
Question  مشكل در اندازه گيري دما توسط سنسور ds18b20
شماتيك و كل مدار

http://upload.dmf313.ir/uploads/guest/test.rar

فایل ویدیویی نحوه عملکرد مدار هم قرار دادم

http://uplod.ir/9xuft9qnedf9/20141109_113145.3gp.htm

من مدار دماسنج ds18b20 رو با mega 8 بستم
شبیه سازی مشکل نداره
فقط روی برد برد مدار به خوبی کار میده ولی دما که از ۵۰ بالا تر میره سنسور ارور میزنه رو ال سی دی
به نظر استادان مشکل از کجاست
ممنونConfused
(آخرین ویرایش در این ارسال: ۲۲-آبان-۱۳۹۳, ۱۳:۲۸:۱۵، توسط moham9d.)
۲۲-آبان-۱۳۹۳, ۱۳:۲۶:۲۴
ارسال‌ها
پاسخ
a.mehran آفلاین
مدیر بخش
*****

ارسال‌ها: 1,029
موضوع‌ها: 93
تاریخ عضویت: فروردین ۱۳۹۲

تشکرها : 5125
( 4490 تشکر در 1882 ارسال )
ارسال: #2
RE: مشكل در اندازه گيري دما توسط سنسور ds18b20
ارور میزنه یعنی چی ؟

silent people have the loudest minds شادی − بهینه شده برای ورژن جدید شادی − بهینه شده برای ورژن جدید
سایت من Abrdade.com
۲۲-آبان-۱۳۹۳, ۱۴:۰۰:۳۲
ارسال‌ها
پاسخ
aKaReZa75 آفلاین
حسین باقری
*****

ارسال‌ها: 1,488
موضوع‌ها: 23
تاریخ عضویت: مرداد ۱۳۹۱

تشکرها : 4898
( 4581 تشکر در 1478 ارسال )
ارسال: #3
RE: مشكل در اندازه گيري دما توسط سنسور ds18b20
سلام.
تو شبیه ساز هم همینطوری بود .
برنامه نویس نوشته اگه تو خواندن مقادیر سنسور مشکلی بوجود اومد متغیر Error_thermo_counter یک واحد بهش اضافه بشه ، هر موقه شد 2 یا بیشتر اون ارور رو ال سی دی بنویسه .
ولی بنظرم برنامه نویس خودش این محدودیت رو گذاشته .
از برنامه زیر استفاده کن دیگه این محدودیت رو نداری :
کد:
$regfile = "m8adef.dat"
$crystal = 1000000
$hwstack = 40
$swstack = 16
$framesize = 32

Config Lcdpin = Pin , Rs = Portb.1 , E = Portb.2 , Db4 = Portb.3 , Db5 = _
Portb.4 , Db6 = Portb.5 , Db7 = Portb.6
Config Lcd = 16 * 2
Config 1wire = Portb.0


Deflcdchar 0 , 8 , 20 , 8 , 32 , 32 , 32 , 32 , 32

Dim Arr(9) As Byte
Dim X As Integer
Dim Y As Single

Cls
Cursor Off
Lcd " DS18B20 Sensor"

Do
   1wreset
   1wwrite &HCC
   1wwrite &H44
   Wait 1
   1wreset
   1wwrite &HCC
   1wwrite &HBE
   Arr(1) = 1wread(9)
   Wait 1
   X = Makeint(arr(1) , Arr(2))
   Y = X / 16
   Lowerline
   Lcd Fusing(y , "#.&") ; Chr(0) ; "C" ; Spc(8)
Loop
End
این کد رو بچه های wle نوشتن.
در ضمن یکم باید کد رو تغییر بدی که اون دیگه پایه خودت .

سلام، من حسین باقری هستم، طراح الکترونیک و برنامه نویس میکروکنترلر.
توی کانال یوتیوب من قراراه طراحی انواع بردهای الکترونیکی مثل بردهای تک لایه، دو لایه یا به طور کلی بردهای چند لایه، بردهای مبتنی بر میکروکنترلر، بردهای صنعتی، بردهای الکترونیک قدرت و بردهای فرکانس بالارو یاد بگیریم.
همینطور کدنویسی انواع میکروکنترلرهای 8 بینی مثل میکروکنترلرهای خانواده AVR-STM8، میکروکنترلرهای میبتی بر معماری ARM مثل STM32 و پردازنده های مخصوص اینترنت اشیاء مثل ESP32-ESP8266 و DSPها یاد میگیریم.
در کنار مباحث گفت شده، اصول اندازه الکترونیکی، نحوه صحیح مونتاژ و عیب‌یابی بردهای الکترونیکی، شبیه سازی مدارات مختلف رو هم یاد میگیریم.
اگر علاقه مند به یادگیری موضوعات عنوان شده هستید، به کانال یوتیوب من با آدرس زیر سر بزنید.
https://www.youtube.com/@aKaReZa75
(آخرین ویرایش در این ارسال: ۲۲-آبان-۱۳۹۳, ۱۴:۱۴:۴۱، توسط aKaReZa75.)
۲۲-آبان-۱۳۹۳, ۱۴:۰۸:۴۳
وب سایت ارسال‌ها
پاسخ
تشکر شده توسط : a.mehran, omid_phoenix, moham9d, رسول
moham9d آفلاین
تازه وارد

ارسال‌ها: 7
موضوع‌ها: 1
تاریخ عضویت: آبان ۱۳۹۳

تشکرها : 1
( 0 تشکر در 0 ارسال )
ارسال: #4
RE: مشكل در اندازه گيري دما توسط سنسور ds18b20
(۲۲-آبان-۱۳۹۳, ۱۴:۰۰:۳۲)a.mehran نوشته است: ارور میزنه یعنی چی ؟

sensor eror مينويسه و ديگه درجه رو نشون نميده
اگه فايل ويديويي رو مشاهده كني متوجه ميشيد
۲۲-آبان-۱۳۹۳, ۱۷:۲۴:۵۳
ارسال‌ها
پاسخ
moham9d آفلاین
تازه وارد

ارسال‌ها: 7
موضوع‌ها: 1
تاریخ عضویت: آبان ۱۳۹۳

تشکرها : 1
( 0 تشکر در 0 ارسال )
ارسال: #5
RE: مشكل در اندازه گيري دما توسط سنسور ds18b20
ممنون از راهنماييتون
ولي دوست عزيز من به اين برنامه و مدار نياز دارم كجاشو بايد دست كاري كنم كه محدوديتش حذف شه
كلافه ام كرده اين مدار
کد:
'*****************************************************************************
'**            Thermometer, thermostat with Temperature - 0.1°C             **
'**          The range of supported temperatures of - 55 to +125 °C         **
'**   Compiler - BASCOM v 2.0.1.0; Ñontroller - ATmega8; Sensor - DS18B20   **
'**   Author - Peter                                           24.11.2010ã. **
'*****************************************************************************

$regfile = "m8def.dat"                                      ' ATmega8
$crystal = 4000000                                          ' 4 ÌÃö

$hwstack = 80
$swstack = 80
$framesize = 80

Declare Sub Mk_init()
Declare Sub Selectmode()
Declare Sub Thermo_lcd(thermo As Integer)
Declare Sub Thermocontrol(thermo As Integer , Thermosetting As Integer)
Declare Sub Modify_setting_button()
Declare Sub Modify_setting_lcd(thermo As Integer)
Declare Function Read_thermo(thermo As Byte) As Byte

1wire_pin Alias Portd.0                                     ' The output for the sensor DS18B20.
Button_plus Alias Pind.1                                    ' Button "+ / current temperature".
Button_minus Alias Pind.2                                   ' Button "- / settings".
Led_read_1wire Alias Portc.0                                ' The output for the LED blinks when data is read from the sensor DS18B20.
Out_thermostat Alias Portc.1                                ' Output the thermostat. It connects the load.
Sreaker Alias Portc.2                                       ' Output to the speaker.

Const Button_delay = 24
Const Button_force_delay = 200                              ' The delay in milliseconds. change in long-term retention of digits in service mode buttons.
Const Thermostat_type = 0                                   ' 0 - thermostat operates in heating, 1 - Cooling.
Const Error_sound_state = 1                                 ' 1 - beep if an error occurs reading data from the sensor DS18B20.
Const Button_force_time = 2                                 ' Time in seconds after which to begin a rapid change in the current setting temperature.
Const Thermo_mode_save_time = 8                             ' Âðåìÿ â ñåêóíäàõ, ïî ïðîøåñòâèþ êîòîðîãî, áóäóò çàïèñàíû äàííûå î òåêóùåé òåìïåðàòóðå, åñëè íå íàæèìàëàñü íè îäíà êíîïêà.
Const Button_beep_state = 1                                 ' 1 - îçâó÷èâàòü êëàâèàòóðó
Const Button_mode_time = 4                                  ' Time in seconds, after which will be recorded in the EEPROM data on the current temperature, if not clicked no button.

Dim Flaginputtermo As Byte                                  ' 1 - the need to poll the sensor DS18B20.
Dim Thermo_mode_state As Byte                               ' The auxiliary variable used in the translation unit in setting mode.
Dim Button_plus_state As Byte                               ' The auxiliary variable used in determining when press / release the "+ / current temperature" in service mode.
Dim Button_minus_state As Byte                              ' The auxiliary variable used in determining when press / release button "- / settings" in the mode.
Dim Button_force_counter As Byte                            ' Time counter (seconds), after which begins a rapid change in temperature in the installed mode.
Dim Temp_1wirearray(9) As Byte                              ' In this array of data from the sensor is placed DS18B20
Dim 1wire_array(9) As Byte                                  ' and if no errors, then the data is copied into the array.
Dim Error_thermo_counter As Byte                            ' Error counter reading from the sensor DS18B20.
Dim Thermo_mode As Byte                                     ' Working hours: 0 - normal operation, 1 - preparing for the transition to a service mode 2 - mode settings.
Dim Thermo_mode_counter As Byte                             ' Counter counting down the time (in seconds) required to switch to the settings.
Dim Thermo_mode_save_counter As Byte                        ' Counter, after which the settings will be saved in EEPROM.
Dim Currenttermo As Integer At 1wire_array Overlay          ' Current temperature.
Dim Thermo_setting As Integer                               ' Supported by the thermostat temperature.
Dim Modify_thermo_setting As Integer                        ' Time value maintained by the thermostat temperature to be used in service mode.
Dim Ee_thermosetting As Eram Integer                        ' Memory location in EEPROM, which stores the current temperature is maintained.


Config Lcd = 16 * 2                                         ' Display 2 lines of 16 characters.
Config Lcdbus = 4
Config Lcdmode = Port
Config Lcdpin = Pin , Db4 = Portb.0 , Db5 = Portb.1 , Db6 = Portb.2 , Db7 = Portb.3 , Rs = Portb.4 , E = Portb.5
Config 1wire = 1wire_pin                                    ' The configuration pin of the temperature sensor DS18B20.
Config Led_read_1wire = Output                              ' The configuration pin output for the LED blinks when data is read from the sensor.
Config Out_thermostat = Output                              ' The configuration pin for the thermostat output.
Config Sreaker = Output                                     ' The configuration pin for output to speaker, the sender of an emergency.
Config Button_plus = Input                                  ' The configuration pin for the "+ / current temperature".
Config Button_minus = Input                                 ' Configuration pin for a button "- / settings".
Config Timer1 = Timer , Prescale = 64                       ' The configuration of the timer Timer1.
On Timer1 Timer1_interrupts
Stop Timer1

Config Watchdog = 2048                                      ' The configuration of the watchdog response time of about 2 seconds.


Call Mk_init()
Enable Interrupts                                           ' Enable all interrupts.



'************************** Main ***********************************************

Do
Reset Watchdog                                             ' Reset watchdog.
If Flaginputtermo = 1 Then                                 ' Needs to read data from the sensor DS18B20.
     Flaginputtermo = 0
     If Read_thermo(1wire_array(1)) = 1 Then                ' Successful reading of data from the sensor DS18B20.
       If Thermo_mode = 0 Then
         Call Thermo_lcd(currenttermo)                      ' The output of the current temperature display.
       End If
       Call Thermocontrol(currenttermo , Thermo_setting)    ' Comparison of current and set temperature and load management.
       Error_thermo_counter = 0                             ' Reset error counter is read from the sensor DS18B20.
     Else                                                   ' An error occurred while reading data from the sensor.
       If Error_thermo_counter >= 2 Then
         #if Error_sound_state = 1
           Sound Sreaker , 2000 , 80                        ' Alarm.
           Sreaker = 0
         #endif
         Sreaker = 0
         Error_thermo_counter = 0
         Cls : Lcd "Sensor error!"
         Thermo_mode = 0
       Else
        Incr Error_thermo_counter                           ' If an error occurred reading from DS18B20, but do not exceed the allowable threshold of errors - errors increase the value of the counter.
       End If
     End If
End If

Call Selectmode()                                          ' Poll button and switch modes.

If Thermo_mode = 2 Then                                    ' Settings mode.
   Call Modify_setting_button()
End If

Loop
End


' ***************************** Interrupts *************************************

' Interrupt Timer1 (interrupt occurs approximately once per second).
Timer1_interrupts:
   Flaginputtermo = 1                                       ' Necessary to interrogate the sensor DS18B20.
   If Thermo_mode = 0 And Thermo_mode_state = 1 Then        ' Button is pressed and held the entrance to the settings.
     If Thermo_mode_counter < 200 Then Incr Thermo_mode_counter       ' Counting the time interval required to enter settings.
   Elseif Thermo_mode = 2 Then                              ' Active mode settings.
     If Thermo_mode_save_counter < 200 Then Incr Thermo_mode_save_counter       ' Counter time before saving settings.
     If Button_force_counter < 200 Then Incr Button_force_counter       ' Counter times out quickly change the desired temperature for prolonged holding down the button.
   End If
Return



' **************************** Subroutine **************************************

' Initialization program.
Sub Mk_init()
Out_thermostat = 0
Sreaker = 0
Error_thermo_counter = 0
Thermo_mode = 0
Thermo_mode_state = 0
Thermo_mode_counter = 0
Thermo_mode_save_counter = 0
Thermo_setting = Ee_thermosetting                          ' Reading a given temperature from EEPROM memory.

Cursor Off
Deflcdchar 1 , 228 , 234 , 228 , 224 , 224 , 224 , 224 , 224       ' Symbol "°"
Cls
Lcd "Thermostat v 1.2"
Lowerline
'Lcd "BASCOM v 2.0.1.0"
Lcd "Lev-hik@yandex.ru"

If Thermo_setting < -880 Or Thermo_setting > 2000 Then     ' These temperatures are not supported.
   #if Error_sound_state = 1
     Sound Sreaker , 2000 , 80                              ' Alarm.
     Sreaker = 0
   #endif
   Cls
   Lcd "Error EEPROM"
   Thermo_setting = 0                                       ' Set of the temperature of 0 ° C.
   Ee_thermosetting = Thermo_setting                        ' Save the data in the EEPROM.
End If

1wreset                                                    ' Reset sensor.
1wwrite &HCC                                               ' Command "Skip ROM".
1wwrite &H44                                               ' Command "Convert  T"

Wait 2
Shiftlcd Left
Wait 1
Timer1 = 0
Flaginputtermo = 0
Enable Timer1
Start Timer1
Start Watchdog
End Sub



' Subroutine mode selection.
Sub Selectmode()
  If Thermo_mode = 0 Then                                   ' Standard mode.
     If Button_minus = 0 Then

       #if Button_beep_state = 1
         If Button_minus_state = 0 Then
           Waitms Button_delay
           If Button_minus = 0 Then
             Button_minus_state = 1
             Sound Sreaker , 80 , 400
             Sreaker = 0
           Else
            Button_minus_state = 0
           End If
         End If
       #endif

       If Thermo_mode_state = 0 Then
         Thermo_mode_counter = 0
         Thermo_mode_state = 1
       Else
         If Thermo_mode_counter >= Button_mode_time Then Thermo_mode = 1       ' Long-term (defined in a constant Button_mode_time) holding down button "- / settings" - preparing to move into the service mode.
       End If
     Else
       Thermo_mode_counter = 0
       Thermo_mode_state = 0
       Button_minus_state = 0
     End If
  Else                                                      ' Mode settings.

     If Thermo_mode_state = 1 Then
       Thermo_mode_counter = 0
       Thermo_mode_state = 0
       Cls
       Lcd Spc(4) ; "Setting"
     End If

     If Thermo_mode = 1 Then                                ' Preparing to move into the service mode (standby button is released "- / settings").
       If Button_minus = 1 Then
         Waitms Button_delay
         If Button_minus = 1 Then
           Thermo_mode = 2                                  ' Button "- / settings" is released - go to service mode.
           Modify_thermo_setting = Thermo_setting
           Thermo_mode_save_counter = 0
           Button_plus_state = 0
           Button_minus_state = 0
           Call Modify_setting_lcd(modify_thermo_setting)
         End If
       End If
     Elseif Thermo_mode > 2 Then                            ' BUG!
       Thermo_mode = 0
       Thermo_mode_counter = 0
       Thermo_mode_state = 0
       Button_plus_state = 0
       Button_minus_state = 0
     End If

  End If
End Sub




' Subroutine service keys in selection of the temperature.
Sub Modify_setting_button()
   Local Temp_shift As Byte
   Local Temp_1 As Byte

   If Button_plus = 0 And Button_minus = 1 Then             ' Press "+ / current temperature".
       Waitms Button_delay
       If Button_plus = 0 Then
         Thermo_mode_save_counter = 0
         If Button_force_counter >= Button_force_time Then
               If Modify_thermo_setting < 1980 Then
                 Modify_thermo_setting = Modify_thermo_setting + 16
                 Call Modify_setting_lcd(modify_thermo_setting)
                 Waitms Button_force_delay
               End If
         Else
               If Button_plus_state = 0 Then
                 Button_plus_state = 1
                 #if Button_beep_state = 1
                   Sound Sreaker , 80 , 400
                   Sreaker = 0
                 #endif
                 If Modify_thermo_setting < 2000 Then       ' + 125°C
                   Temp_shift = Modify_thermo_setting And 15
                   Temp_1 = Lookup(temp_shift , Button_modify_label)
                   Modify_thermo_setting = Modify_thermo_setting + Temp_1
                   Call Modify_setting_lcd(modify_thermo_setting)
                 End If
               End If
         End If

       Else
        Button_plus_state = 0
       End If

   Elseif Button_minus = 0 And Button_plus = 1 Then         ' Button is pressed "- / settings".
       Waitms Button_delay
       If Button_minus = 0 Then
         Thermo_mode_save_counter = 0
         If Button_force_counter >= Button_force_time Then
             If Modify_thermo_setting > -860 Then
               Modify_thermo_setting = Modify_thermo_setting - 16
               Call Modify_setting_lcd(modify_thermo_setting)
               Waitms Button_force_delay
             End If
         Else
             If Button_minus_state = 0 Then
               Button_minus_state = 1
               #if Button_beep_state = 1
                 Sound Sreaker , 80 , 400
                 Sreaker = 0
               #endif
               If Modify_thermo_setting > -880 Then         ' - 55°C
                 Temp_shift = Modify_thermo_setting And 15
                 Temp_1 = Lookup(temp_shift , Button_modify_label)
                 Modify_thermo_setting = Modify_thermo_setting - Temp_1
                 Call Modify_setting_lcd(modify_thermo_setting)
               End If
             End If
         End If
       Else
        Button_minus_state = 0
       End If
   Else                                                     ' The buttons are not pressed or pressed just two.
    Button_plus_state = 0
    Button_minus_state = 0
    Button_force_counter = 0
   End If


   If Thermo_mode_save_counter >= Thermo_mode_save_time Then       ' If the button is never pressed for a preset constant Thermo_mode_save_Time number of seconds, save the settings and exit to standart mode.
     If Modify_thermo_setting <> Thermo_setting Then        ' If supported by the temperature change
       Ee_thermosetting = Modify_thermo_setting             ' save the settings in the EEPROM.
       Thermo_setting = Modify_thermo_setting
     End If
     Thermo_mode_save_counter = 0
     Thermo_mode = 0
     Thermo_mode_counter = 0
     Thermo_mode_state = 0
     Button_plus_state = 0
     Button_minus_state = 0
   End If

End Sub



' Subroutine LCD display data on the selection mode of the temperature.
Sub Modify_setting_lcd(thermo As Integer)
Local Lcd_out As Single
Lcd_out = Thermo / 16
Cls
Lcd Spc(4) ; "Setting"
Lowerline
Lcd "set t" ; Chr(1) ; ": " ; Fusing(lcd_out , "#.#") ; Chr(1) ; "C"
End Sub



' Data output on the display.
Sub Thermo_lcd(thermo As Integer)
  Local Lcd_out As Single
  Cls
  Lcd_out = Thermo / 16
  Lcd "Thermo: " ; Fusing(lcd_out , "#.#") ; Chr(1) ; "C"

  If Button_plus = 0 Then
   Waitms Button_delay
   If Button_plus = 0 Then
       Lcd_out = Thermo_setting / 16
       Lowerline
       Lcd "set t" ; Chr(1) ; ": " ; Fusing(lcd_out , "#.#") ; Chr(1) ; "C"
       #if Button_beep_state = 1
         If Button_plus_state = 0 Then
           Button_plus_state = 1
           Sound Sreaker , 80 , 400
           Sreaker = 0
         End If
       #endif
   Else
     Button_plus_state = 0
   End If
  Else
   Button_plus_state = 0
  End If

End Sub



' Temperature control for load management.
Sub Thermocontrol(thermo As Integer , Thermosetting As Integer)
If Thermo <= Thermosetting Then
   #if Thermostat_type = 0
     Out_thermostat = 1
   #else
     Out_thermostat = 0
   #endif
Else
   #if Thermostat_type = 0
     Out_thermostat = 0
   #else
     Out_thermostat = 1
   #endif
End If
End Sub




' ***************************** Function ***************************************

' Reading data from a temperature sensor.
Function Read_thermo(thermo As Byte) As Byte
Local Temp As Byte
Temp = 0                                                   ' Set tag read errors.
   Disable Interrupts
   Led_read_1wire = 1
   1wreset                                                  ' Reset sensor.
   If Err = 0 Then
       1wwrite &HCC                                         ' Command "Skip ROM"
       1wwrite &HBE                                         ' Command "Read Scratchpad".
       Temp_1wirearray(1) = 1wread(9)                       ' ×òåíèå äàííûõ ñ äàò÷èêà.
       1wreset                                              ' Reset sensor.
       1wwrite &HCC                                         ' Command "Skip ROM".
       1wwrite &H44                                         ' Command "Convert  T"
       If Temp_1wirearray(9) = Crc8(temp_1wirearray(1) , 8) Then       ' Checksum.
         For Temp = 1 To 8
           Thermo(temp) = Temp_1wirearray(temp)
         Next Temp
         Temp = 1                                           ' Reset tag read errors.
         Led_read_1wire = 0
       End If
   End If
   Enable Interrupts
Read_thermo = Temp
End Function

' ******************************* Data ***************************************

Button_modify_label:
Data 2 , 1 , 1 , 2 , 1 , 2 , 1 , 1 , 2 , 1 , 1 , 2 , 1 , 2 , 1 , 1
۲۲-آبان-۱۳۹۳, ۱۸:۱۳:۰۷
ارسال‌ها
پاسخ
a.mehran آفلاین
مدیر بخش
*****

ارسال‌ها: 1,029
موضوع‌ها: 93
تاریخ عضویت: فروردین ۱۳۹۲

تشکرها : 5125
( 4490 تشکر در 1882 ارسال )
ارسال: #6
RE: مشكل در اندازه گيري دما توسط سنسور ds18b20
حسین جان شبیه ساز درسته .
برنامه هم اصولی نوشته شده جوری نیست که میکرو هنگ کنه.
کد:
[php]
Do
Reset Watchdog                                             ' Reset watchdog.
If Flaginputtermo = 1 Then                                 ' Needs to read data from the sensor DS18B20.
     Flaginputtermo = 0
     If Read_thermo(1wire_array(1)) = 1 Then                ' Successful reading of data from the sensor DS18B20.
       If Thermo_mode = 0 Then
         Call Thermo_lcd(currenttermo)                      ' The output of the current temperature display.
       End If
       Call Thermocontrol(currenttermo , Thermo_setting)    ' Comparison of current and set temperature and load management.
       Error_thermo_counter = 0                             ' Reset error counter is read from the sensor DS18B20.
     Else                                                   ' An error occurred while reading data from the sensor.
       If Error_thermo_counter >= 2 Then
         #if Error_sound_state = 1
           Sound Sreaker , 2000 , 80                        ' Alarm.
           Sreaker = 0
         #endif
         Sreaker = 0
         Error_thermo_counter = 0
         Cls : Lcd "Sensor error!"
         Thermo_mode = 0
       Else
        Incr Error_thermo_counter                           ' If an error occurred reading from DS18B20, but do not exceed the allowable threshold of errors - errors increase the value of the counter.
       End If
     End If
End If

Call Selectmode()                                          ' Poll button and switch modes.

If Thermo_mode = 2 Then                                    ' Settings mode.
   Call Modify_setting_button()
End If

Loop
End
[/php]
هرچیه تو این تیکه اتفاق میفته
---------
شما چرا از برنامه و مدار دیگه ای استفاده نمیکنین ؟
---------
سنسورتون سالمه ؟؟؟!

silent people have the loudest minds شادی − بهینه شده برای ورژن جدید شادی − بهینه شده برای ورژن جدید
سایت من Abrdade.com
(آخرین ویرایش در این ارسال: ۲۲-آبان-۱۳۹۳, ۱۸:۴۶:۱۸، توسط a.mehran.)
۲۲-آبان-۱۳۹۳, ۱۸:۴۵:۳۸
ارسال‌ها
پاسخ
تشکر شده توسط : omid_phoenix
moham9d آفلاین
تازه وارد

ارسال‌ها: 7
موضوع‌ها: 1
تاریخ عضویت: آبان ۱۳۹۳

تشکرها : 1
( 0 تشکر در 0 ارسال )
ارسال: #7
RE: مشكل در اندازه گيري دما توسط سنسور ds18b20
اره داداش سنسور هم عوض كردم
بازم همون نتيجه
آخه عملكرد مدار همونيه كه من ميخوام
مدار مشابه ديگه كه همين عملكردو داشته باشه پيدا نكردم
۲۲-آبان-۱۳۹۳, ۲۲:۰۰:۴۹
ارسال‌ها
پاسخ
aKaReZa75 آفلاین
حسین باقری
*****

ارسال‌ها: 1,488
موضوع‌ها: 23
تاریخ عضویت: مرداد ۱۳۹۱

تشکرها : 4898
( 4581 تشکر در 1478 ارسال )
ارسال: #8
RE: مشكل در اندازه گيري دما توسط سنسور ds18b20
نقل قول: حسین جان شبیه ساز درسته .
برنامه هم اصولی نوشته شده جوری نیست که میکرو هنگ کنه.
تو دما رو ببر 55 ببینم چجوری سالمه :|
کسی هم نگفته که میکرو هنگ میکنه یا نمیکنه :|

سلام، من حسین باقری هستم، طراح الکترونیک و برنامه نویس میکروکنترلر.
توی کانال یوتیوب من قراراه طراحی انواع بردهای الکترونیکی مثل بردهای تک لایه، دو لایه یا به طور کلی بردهای چند لایه، بردهای مبتنی بر میکروکنترلر، بردهای صنعتی، بردهای الکترونیک قدرت و بردهای فرکانس بالارو یاد بگیریم.
همینطور کدنویسی انواع میکروکنترلرهای 8 بینی مثل میکروکنترلرهای خانواده AVR-STM8، میکروکنترلرهای میبتی بر معماری ARM مثل STM32 و پردازنده های مخصوص اینترنت اشیاء مثل ESP32-ESP8266 و DSPها یاد میگیریم.
در کنار مباحث گفت شده، اصول اندازه الکترونیکی، نحوه صحیح مونتاژ و عیب‌یابی بردهای الکترونیکی، شبیه سازی مدارات مختلف رو هم یاد میگیریم.
اگر علاقه مند به یادگیری موضوعات عنوان شده هستید، به کانال یوتیوب من با آدرس زیر سر بزنید.
https://www.youtube.com/@aKaReZa75
۲۳-آبان-۱۳۹۳, ۰۱:۰۵:۲۰
وب سایت ارسال‌ها
پاسخ
moham9d آفلاین
تازه وارد

ارسال‌ها: 7
موضوع‌ها: 1
تاریخ عضویت: آبان ۱۳۹۳

تشکرها : 1
( 0 تشکر در 0 ارسال )
ارسال: #9
RE: مشكل در اندازه گيري دما توسط سنسور ds18b20
برادر حسين من ولتاژم رگوله نبود رگوله كه كردم تا حدود 60 ميرفت
بين 55 تا 60 بازي ميكنه
۲۳-آبان-۱۳۹۳, ۱۰:۱۶:۲۴
ارسال‌ها
پاسخ
aKaReZa75 آفلاین
حسین باقری
*****

ارسال‌ها: 1,488
موضوع‌ها: 23
تاریخ عضویت: مرداد ۱۳۹۱

تشکرها : 4898
( 4581 تشکر در 1478 ارسال )
ارسال: #10
RE: مشكل در اندازه گيري دما توسط سنسور ds18b20
شما اون برنامه که من بت دادم رو دست کاری کن برای پروژه خودت استفاده کن .
بعد این قابیلهارو خودت بش اضافه کن.

سلام، من حسین باقری هستم، طراح الکترونیک و برنامه نویس میکروکنترلر.
توی کانال یوتیوب من قراراه طراحی انواع بردهای الکترونیکی مثل بردهای تک لایه، دو لایه یا به طور کلی بردهای چند لایه، بردهای مبتنی بر میکروکنترلر، بردهای صنعتی، بردهای الکترونیک قدرت و بردهای فرکانس بالارو یاد بگیریم.
همینطور کدنویسی انواع میکروکنترلرهای 8 بینی مثل میکروکنترلرهای خانواده AVR-STM8، میکروکنترلرهای میبتی بر معماری ARM مثل STM32 و پردازنده های مخصوص اینترنت اشیاء مثل ESP32-ESP8266 و DSPها یاد میگیریم.
در کنار مباحث گفت شده، اصول اندازه الکترونیکی، نحوه صحیح مونتاژ و عیب‌یابی بردهای الکترونیکی، شبیه سازی مدارات مختلف رو هم یاد میگیریم.
اگر علاقه مند به یادگیری موضوعات عنوان شده هستید، به کانال یوتیوب من با آدرس زیر سر بزنید.
https://www.youtube.com/@aKaReZa75
۲۳-آبان-۱۳۹۳, ۱۱:۰۱:۲۷
وب سایت ارسال‌ها
پاسخ
moham9d آفلاین
تازه وارد

ارسال‌ها: 7
موضوع‌ها: 1
تاریخ عضویت: آبان ۱۳۹۳

تشکرها : 1
( 0 تشکر در 0 ارسال )
ارسال: #11
RE: مشكل در اندازه گيري دما توسط سنسور ds18b20
(۲۳-آبان-۱۳۹۳, ۱۱:۰۱:۲۷)h.unique نوشته است: شما اون برنامه که من بت دادم رو دست کاری کن برای پروژه خودت استفاده کن .
بعد این قابیلهارو خودت بش اضافه کن.

داداش اگه من ميتونستم انجام ميدادم
مشكل من اينه كه اين برنامه پيچيدست
فقط محدوديتشو ميخوام حذف كنم
۲۴-آبان-۱۳۹۳, ۱۳:۲۴:۳۴
ارسال‌ها
پاسخ


موضوعات مرتبط با این موضوع...
موضوع نویسنده پاسخ بازدید آخرین ارسال
  معرفی یک سنسور جریان برای اتصال به میکرو ؟ mega16 6 1,738 ۲۷-اردیبهشت-۱۳۹۹, ۱۷:۳۸:۳۲
آخرین ارسال: Ambassador
  اتصال سنسور lm35 در فاصله 12 متری به میکرو ؟ mega16 3 1,643 ۲۷-بهمن-۱۳۹۸, ۱۸:۴۳:۲۸
آخرین ارسال: aKaReZa75
  [فوری] عدم شناسایی میکرو توسط پروگرامر منیره مرادی 1 2,525 ۲۹-مرداد-۱۳۹۷, ۲۰:۵۷:۳۰
آخرین ارسال: 1نفر
  اندازه گیر سلف و خازن با میکروکنترلر AVR baharbahari 33 27,119 ۱۴-دى-۱۳۹۶, ۰۰:۴۳:۵۹
آخرین ارسال: 1نفر
  ربات مسیریاب ۲۴ سنسور Erfanbeigi 3 2,650 ۰۷-آبان-۱۳۹۶, ۰۰:۴۲:۴۱
آخرین ارسال: 1نفر
  راه اندازی سنسور sht11 blackstar368 10 10,511 ۲۶-دى-۱۳۹۵, ۱۲:۲۲:۴۷
آخرین ارسال: ehsan1082
  دماسنج DS18b20 rezamajdi 5 3,524 ۰۳-دى-۱۳۹۵, ۰۱:۲۰:۲۰
آخرین ارسال: omid_phoenix
  مشكل با پورت سريال در متلب leila.66 8 11,927 ۱۲-شهریور-۱۳۹۵, ۲۰:۳۹:۳۴
آخرین ارسال: 36taregh
  درخواست مدار محاسبه سرعت با سنسور مادون قرمز maxell2500 8 6,690 ۲۸-اردیبهشت-۱۳۹۵, ۰۰:۱۰:۴۱
آخرین ارسال: maxell2500
  [سوال] سنسور فرستنده و گیرنده مادون قرمز rezamajdi 2 3,082 ۰۸-بهمن-۱۳۹۴, ۰۰:۱۰:۴۸
آخرین ارسال: rezamajdi

پرش به انجمن:


کاربرانِ درحال بازدید از این موضوع: 5 مهمان

صفحه‌ی تماس | IranVig | بازگشت به بالا | | بایگانی | پیوند سایتی RSS