Pada kesempatan yang berbahagia kali ini akan dibahas mengenai bagaimana cara mengakses sensor non-contact yang digunakan untuk mengukur suhu ruangan atau suhu suatu benda, sensor ini sangat bagus sekali jika digunakan untuk mengukur suhu karena tingkat sensitivitasnya sangat tinggi dan bisa mendeteksi suhu benda hingga 360 derajat cecius. berikut fitur lengkapnya dari sensor ini
- Small size, low cost
- Easy to integrate
-
Factory calibrated in wide temperature range:
- -40 to +85°C for sensor temperature
- -70 to +380°C for object temperature
- SMBus compatible digital interface
- Customizable PWM output for continuous reading
- High accuracy of 0.5°C over wide temperature range (0 to +50°C for both Ta and To)
- Measurement resolution of 0.02°C
- Single and dual zone versions
- Simple adaptation for 8 to 16V applications
- Power saving mode
- Different package options for applications and measurements versatility
- Automotive grade
Yang perlu diperhatikan yaitu sensor ini menggunakan SMbus untuk komunikasinya jadi tidak seperti komunikasi I2C biasa namun ada pengulangan pengiriman address dan adanya stop, untuk skematik rangkaian modul MLX90614 seperti gambar berikut
PROGRAM BASCOM AVR
$regfile = "m16def.dat"
$crystal = 11059200
$baud = 9600
$hwstack = 32
$swstack = 10
$framesize = 40
$lib "i2c_twi.lbx"
Config Scl = Portc.0 ' we need to provide the SCL pin name
Config Sda = Portc.1 ' we need to provide the SDA pin name
I2cinit
Config Twi = 50000
Twcr = &B00000100
Wait 2
Dim Value As Byte , Temp As Single , Tempword As Word , U As Single
Dim Suhu As String * 8
Do
Tempword = 0
I2cstart 'generate start
I2cwbyte &B10110100 'slave adsress(write)
I2cwbyte &B00000110 'address of EEPROM or commend
I2cstart 'repeated start
I2cwbyte &B10110101 'slave address (read)
I2crbyte Value , Ack
Tempword = Value
Shift Tempword , Left , 8
I2crbyte Value , Ack
Tempword = Tempword Or Value
I2crbyte Value , Nack 'read byte
I2cstop 'generate stop
Rotate Tempword , Left , 8
Temp = Tempword * 0.02
Temp = Temp - 273.15
Suhu = Fusing(temp , "##.##")
Print "suhu = " ; Suhu
Waitms 100
Loop
VIDEO HASILNYA
No comments:
Post a Comment