Robofun 機器人論壇

 找回密碼
 申請會員
搜索
熱搜: 活動 交友 discuz
查看: 5027|回復: 6
打印 上一主題 下一主題

請問溫度探頭的使用方法?

[複製鏈接]
跳轉到指定樓層
1#
發表於 2014-3-22 14:44:27 | 只看該作者 |只看大圖 回帖獎勵 |倒序瀏覽 |閱讀模式
本帖最後由 pizg 於 2014-3-22 16:27 編輯

我購買了一條1M長金屬溫度探頭
http://goods.ruten.com.tw/item/qa?21110142916581

因為規格不詳
試過很多方式都無法顯示溫度,
有請高人解救.

測試時使用的代碼如下:
  1. #include <OneWire.h>
  2. #include <DallasTemperature.h>

  3. // Data wire is plugged into port 2 on the Arduino
  4. #define ONE_WIRE_BUS 2

  5. // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
  6. OneWire oneWire(ONE_WIRE_BUS);

  7. // Pass our oneWire reference to Dallas Temperature.
  8. DallasTemperature sensors(&oneWire);

  9. void setup(void)
  10. {
  11.   // start serial port
  12.   Serial.begin(9600);
  13.   Serial.println("Dallas Temperature IC Control Library Demo");

  14.   // Start up the library
  15.   sensors.begin();
  16. }

  17. void loop(void)
  18. {
  19.   // call sensors.requestTemperatures() to issue a global temperature
  20.   // request to all devices on the bus
  21.   Serial.print("Requesting temperatures...");
  22.   sensors.requestTemperatures(); // Send the command to get temperatures
  23.   Serial.println("DONE");
  24.   
  25.   Serial.print("Temperature for the device 1 (index 0) is: ");
  26.   Serial.println(sensors.getTempCByIndex(0));  
  27.   delay(500);
  28. }
複製代碼


如下圖接法若使用DS18B20元件可以正常顯示溫度

但如果接上我買的溫度探頭則無法正常工作.


另外, 我在這兒
http://blog.lampugnani.org/arduino/ds18b20-sensore-di-temperatura-digitale/
找到如下圖接法:





也在這兒

https://www.pjrc.com/tech/8051/board5/temperature.html
找到如下圖接法:





但不知Arduino程式該如何寫?



2#
發表於 2014-3-23 02:57:28 | 只看該作者
回復 1# pizg
BZ水冷 溫度傳感器應該是一種 NTC溫度傳感器,

by
NTC熱敏電阻、探頭組(合)件.一種用熱敏電阻外殼,延長引線,有時還用了一個接頭組合而成的成品熱敏電阻組(合)件。
利用NTC熱敏電阻在一定的測量功率下,電阻值隨著溫度上升而迅速下降。利用這一特性,
可將NTC熱敏電阻通過測量其電阻值來確定相應的溫度,從而達到檢測和控制溫度的目的。

這是電壓值的變化, 所以接 Arduino的Analog Input,
試試如下網頁所作:
Arduino: Analog Input NTC Thermistor 用熱敏電阻量度溫度.
http://miraigajettokenkyujo.blogspot.tw/2013/06/arduino-analog-input-ntc-thermistor.html
注意接法:
3#
 樓主| 發表於 2014-3-23 09:23:50 | 只看該作者
本帖最後由 pizg 於 2014-3-23 16:08 編輯
回復  pizg
BZ水冷 溫度傳感器應該是一種 NTC溫度傳感器,

by
NTC熱敏電阻、探頭組(合)件.一種用熱敏 ...
vegewell 發表於 2014-3-23 02:57


感謝V大, 您真是神人.OK了.
在還沒解決這個問題之前,我還DIY了一條DS18B20的溫感線.
只讓他露出一隻腳來感測溫度,
其餘地方用熱熔膠"封裝"起來.

另提出一個問題,
DHT11溫濕度傳感器也是內建類似熱敏電阻的元件嗎?
請問有辦法讓他傳回的溫度值至少到小數1位嗎?
   
4#
發表於 2014-3-24 02:03:33 | 只看該作者
回復 3# pizg
我差不多跟一般凡夫一樣,要花時間去搜查資訊,
那沒什麼偉大的,
幫助別人,其實是幫助自己,
關於你另一問題,
憑你的本事,就能得到答案,
所以你該做的是-> 給自己信心.
5#
 樓主| 發表於 2014-3-24 17:33:23 | 只看該作者
本帖最後由 pizg 於 2014-3-24 18:32 編輯
回復  pizg
我差不多跟一般凡夫一樣,要花時間去搜查資訊,
那沒什麼偉大的,
幫助別人,其實是幫助自己,
...
vegewell 發表於 2014-3-24 02:03


我搜尋了不少網路上的資料,沒有人用DHT11做出攝氏溫度精度到小數點1位,
DHT11的溫度每次都是跳1度, 是否他的精度就是如此?哈~~DHT11誤差正負2度C,
難怪唷~~.
底下是DHT11的資料結構:
DHT11 data structure :


1.
Humidity Integer : 8bit
2.

Humidity Fraction : 8bit
3.
Temperature Integer :8bit
4.
Temperature Fraction : 8bit
5.
Check sum : Humidity Integer + Humidity Fraction + Temperature Integer + Temperature Fraction

DHT22好像可以到小數1位.
6#
發表於 2014-3-25 02:23:59 | 只看該作者
回復 5# pizg
數位溫濕度感測器
In comparison with the DHT11, the DHT33 has a wider measurement range and higher accuracy and long term stability than the DHT22.
--------------------------------------
DHT33(RHT04)(解析度最高)
Power supply: 3.3 to 5.5V DC
Output signal: digital signal via MaxDetect 1-wire bus
Sensor type humidity: Polymer humidity capacitor
Sensor type temperature: DS18B20
Operating range: humidity 0 to 100%RH, temperature -40 to 100°C;
Interchangeability: fully interchangeable
Range of meauring humidity: 0% to 100%RH(0-50° temperature compensation)
Range of meauring temperature: -40 to +100°
Resolution or sensitivity: humidity: 0.1%RH, temperature: 0.1°C
Accuracy of measuring humidity: ±2.0%RH
Accuracy of measuring temperature: ±0.5°C
Repeatability: humidity:+-0.5%RH, temperature:+-0.2°C
Supply Current:
Mesurement: 1 to 1.5 mA
Average: 0.2 to 0.5 mA
Stand by: 40 to 50 uA
----------------------------
DHT11
Ultra low cost
3 to 5V power and I/O
2.5mA max current use during conversion (while requesting data)
Good for 20-80% humidity readings with 5% accuracy
Good for 0-50°C temperature readings ±2°C accuracy
No more than 1 Hz sampling rate (once every second)
Body size 15.5mm x 12mm x 5.5mm
4 pins with 0.1" spacing
----------------------------
DHT22
Low cost
3 to 5V power and I/O
2.5mA max current use during conversion (while requesting data)
Good for 0-100% humidity readings with 2-5% accuracy
Good for -40 to 125°C temperature readings ±0.5°C accuracy
No more than 0.5 Hz sampling rate (once every 2 seconds)
Body size 15.1mm x 25mm x 7.7mm
4 pins with 0.1" spacing
7#
 樓主| 發表於 2014-3-25 09:50:49 | 只看該作者
回復  pizg
數位溫濕度感測器
In comparison with the DHT11, the DHT33 has a wider measurement range ...
vegewell 發表於 2014-3-25 02:23



   感謝v大,感謝您花了不少時間找來這些資料.
您需要登錄後才可以回帖 登錄 | 申請會員

本版積分規則

小黑屋|手機版|Archiver|機器人論壇 from 2005.07

GMT+8, 2024-9-30 16:25 , Processed in 0.367598 second(s), 9 queries , Apc On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表