在本文中,我將解釋如何通過紅外線測量表面溫度。使用這項技術,我們可以簡單地通過向表面發送紅外波并分析返回傳感器的波來收集溫度信息。
有許多不同類型的傳感器可用于測量溫度。 LM35或DS18B20溫度傳感器根據直接施加在傳感器設備表面的熱量提供輸出。但是,對于極熱的情況(例如明火),您無法使用基于接觸的傳感器來檢測準確的溫度。
如果你想用非接觸式方法(我們為這個項目做)檢測溫度,紅外線溫度計傳感器是最好的解決方案。因此,我們將使用Melexis的MLX90614紅外測溫儀進行此項目。 MLX90614傳感器使用非接觸式溫度傳感來收集溫度信息,而不會觸及任何特定表面。
紅外線溫度計的工作原理
雖然人眼看不到,但所有物體都會發出紅外光線,濃度會因溫度而異。通過檢測紅外線,我們可以感知溫度范圍。 MLX90614溫度計傳感器使用這一原理。
MLX90614是一款功能強大的紅外傳感器件,具有極低噪聲放大器和17位ADC。它可以為溫度計提供高精度和高分辨率。關于MLX90614的最佳部分是它使用工廠的數字SMBus進行校準。這意味著它將提供0.02°C的高分辨率輸出,并可連續傳輸-20至120°C的測量溫度。
現在我們了解傳感器的工作原理,讓我們深入了解項目!
必需材料
字符LCD 16x2
MLX90614
LCD屏蔽(可選)
接線
MLX 90614溫度計具有I2C通信線路,因此我們可以將此傳感器與Arduino連接,無需任何額外電路。如下圖所示連接所有內容。您可以使用LCD 16X2屏蔽或連接獨立LCD,如Fritzing圖中所述。
適用于Arduino LCD Shield
上傳源代碼
將以下源代碼復制并粘貼到Arduino IDE。仔細檢查連接后,上傳代碼。
/*
* Non-contact Thermometer with GY - 906 module
* Support for the MLX90614 sensor on the I2C bus
* SDA line = A4
* SCL line = A5
* Sensor supply with 5V
*/
#include
#include
LiquidCrystal lcd (8, 9, 4, 5, 6, 7);
int address = 0xb4; // Sensor address MLX90614
int erc = 0; // Variable holding the PEC value
int dataH = 0; // The second byte of data
int dataL = 0; // The first byte of data
double tempnalsb = 0.02; // Variable by which the digital value will be multiplied
double temperature = 0; // Variable holding the temperature
void setup () {
i2c_init (); // Initialization of the I2C bus
lcd.begin (16, 2); // Initialize the display
}
void loop () {
i2c_start_wait (address + I2C_WRITE); // Start I2C communication in write mode
i2c_write (0x07); // Write the value 0x07 (select the register Tobj1)
i2c_rep_start (address + I2C_READ); // Restart I2C communication at the read address
dataL = i2c_readAck (); // Read the first byte of data
dataH = i2c_readAck (); // Read the second byte of data
erc = i2c_readNak (); // Read the third (unimportant) data byte
i2c_stop (); // End of I2C transmission
temperature = (double) (((dataH & 0x007F) 《《 8) + dataL); // Create a 16-bit variable consisting of two one-byte variables
temperature = temperature * tempnalsb; // For one bit 0.02 K, the result of this operation is the temperature in Kelvin
temperature = temperature - 273.15; // Conversion to Celsius degrees
lcd.setCursor (0,0); // Display (first LCD line)
lcd.print (“Object =”);
lcd.print (temperature);
lcd.print (“”);
lcd.write (0xDF); // Degree sign
lcd.print (“C”);
i2c_start_wait (address + I2C_WRITE);
i2c_write (0x06); // Select the ambient temperature register
i2c_rep_start (address + I2C_READ);
dataL = i2c_readAck ();
dataH = i2c_readAck ();
erc = i2c_readNak ();
i2c_stop ();
temperature = (double) (((dataH & 0x007F) 《《 8) + dataL);
temperature = temperature * tempnalsb;
temperature = temperature - 273.15;
lcd.setCursor(0,1); // Display (second LCD line)
lcd.print (“Ambient =”);
lcd.print (temperature);
lcd.print (“”);
lcd.write (0xDF);
lcd.print (“C”);
delay (200); // Delay 200ms
}
有很多項目可以派上紅外溫度傳感器,例如測量液體或熱觸摸表面。因為它不需要直接接觸,所以在這些情況下MLX90614將是一個很好的選擇。
-
紅外測溫儀
+關注
關注
3文章
248瀏覽量
28053 -
Arduino
+關注
關注
188文章
6478瀏覽量
188295 -
MLX90614
+關注
關注
3文章
28瀏覽量
18495
發布評論請先 登錄
相關推薦
紅外線測溫儀使用事項
紅外線測溫儀如何校準
紅外線測溫儀常見故障及解決辦法
紅外線測溫儀使用注意事項
紅外線測溫儀測溫原理
如何選擇紅外線測溫儀
紅外線測溫儀與傳統測溫儀比較
紅外線測溫儀適用范圍
紅外線測溫儀精度怎么樣
紅外線測溫儀使用方法
高溫紅外測溫儀原理及選型

3分鐘搞懂紅外測溫儀測溫原理及選型!

評論