Service hotline
+86 0755-83044319
release time:2024-12-13Author source:SlkorBrowse:747
SLKOR is a high-tech enterprise integrating the design, development, production and sales of electronic products. It provides customers with reliable products and corresponding technical services. The brand "SLKOR" has gradually developed into an internationally renowned one, offering products and solutions to more than 10,000 customers worldwide.
In an effort to strive to provide customers with a full range of complementary products, SLKOR has launched a series of user manuals for the demo boards of digital infrared thermopile non-contact temperature measurement application designs.
1.1 Name: User Manual for SLKOR Digital Infrared Thermopile Non-contact Temperature Measurement Application Design Demo Board
1.2 Applications: Smart wearable devices, smart phones, industrial temperature monitoring, non-contact human body surface temperature measurement, intelligent temperature sensing and control and other small-sized devices for short-range temperature measurement.
1.3 SL-W-TRS-5.5Dx Series Demo Board:
It is used for evaluation and testing of various types of sensors. The measurement results will be displayed on the screen and can be printed to the serial port debugging software on the PC via USB to serial port. Button description: The left button is for reset, and the right button can control the start and pause of the program.
2. Hardware Design of SL-W-TRS-5.5Dx Series
The chip pins include power supply and I2C bus, with a total of 4 pins. The allowable range of supply voltage is 2.3 - 3.6V. The sensor itself has very low power consumption. A 0.1uF capacitor between the power supply ground is sufficient. If the sensor is relatively far from the power supply part, an additional 10uF capacitor can be considered to ensure stable power supply and reduce noise.
3. Description of SL-W-TRS-5.5Dx Series Demo Board
3.1 The demo board is powered by a Type-C socket, and the power supply voltage for the demo board is 5V. When in use, connect the demo board to the PC via Type-C, and then you can view the results on the screen. If you need to display data through the serial port, you are required to install the WCH CH340 driver program and then use serial port debugging software to operate. The serial port communication settings are as follows: Baud rate: 9600, Data bits: 8, Stop bits: 1, and no parity check.
3.2 The screen display of the demo board from top to bottom is as follows: ambient temperature (tamb), sensor output voltage (vtp_cor), object (surface) temperature (tobj), and human body temperature (tbdy). The unit of the above temperature values is °C, and the unit of voltage is μV. Among them, the first three values are the original outputs of the device. The body temperature value is calculated based on the original values using our company's algorithm and is for reference only. Users can process the data using their own body temperature algorithms according to their needs.
Serial port display effect
2. Demo board program example of SL-W-TRS-5.5Dx series
//////////////////////////////////////////////////////////////////////////////////////////////////////
// main.c
//////
#define FOR_CUSTOMER
#ifdef FOR_CUSTOMER
#include "drv_uart.h"
#include "drv_i2c.h"
#include "drv_key.h"
#include "oled/oled.h"
#include "trs55d.h"
extern void SystemCoreClockUpdate(void);
extern void delay_ms(int cnt);
int main(void)
{
uint8_t key;
uint8_t run = 0x01;
SystemCoreClockUpdate();
if (SysTick_Config(SystemCoreClock / 1000))
while(1);
uartInit();
drv_i2c_init();
drv_key_init();
OLED_Init();
OLED_Refresh();
OLED_Clear();
OLED_ShowString(8,0,"Tamb:",16,1);
OLED_ShowString(8,16,"Vtp:",16,1);
OLED_ShowChinese(8,32,0,16,1);
OLED_ShowChinese(24,32,2,16,1);
OLED_ShowChinese(40,32,3,16,1);
OLED_ShowChinese(8,48,1,16,1);
OLED_ShowChinese(24,48,2,16,1);
OLED_ShowChinese(40,48,3,16,1);
OLED_Refresh();
uartSendString("SL-W-TRS-5.5Dx Demo program\r\n");
while(1) {
key = drv_key_read();
while(drv_key_read());
if (key) {
run = (run)?0:1;
}
if (run) {
TRS55D_read();
OLED_Refresh();
}
delay_ms(20);
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
//trs55d.h
//////
#ifndef _TRS55D_H_
#define _TRS55D_H_
#include
#define TRS55D_NORMAL_Tobj_MSB_R 0x10
#define TRS55D_NORMAL_Tobj_CSB_R 0x11
#define TRS55D_NORMAL_Tobj_LSB_R 0x12
#define TRS55D_NORMAL_TEMP_MSB_R 0x16
#define TRS55D_NORMAL_TEMP_CSB_R 0x17
#define TRS55D_NORMAL_TEMP_LSB_R 0x18
#define TRS55D_NORMAL_DATA1_MSB_R 0x19
#define TRS55D_NORMAL_DATA1_CSB_R 0x1A
#define TRS55D_NORMAL_DATA1_LSB_R 0x1B
#define TRS55D_NORMAL_DATA2_MSB_R 0x1C
#define TRS55D_NORMAL_DATA2_CSB_R 0x1D
#define TRS55D_NORMAL_DATA2_LSB_R 0x1E
#define TRS55D_RAW_DATA1_MSB_R 0x22
#define TRS55D_RAW_DATA1_CSB_R 0x23
#define TRS55D_RAW_DATA1_LSB_R 0x24
#define TRS55D_RAW_DATA2_MSB_R 0x25
#define TRS55D_RAW_DATA2_CSB_R 0x26
#define TRS55D_RAW_DATA2_LSB_R 0x27
#define TRS55D_RAW_TEMP_MSB_R 0x28
#define TRS55D_RAW_TEMP_CSB_R 0x29
#define TRS55D_RAW_TEMP_LSB_R 0x2A
#define ADDR_TRS55D 0xFE //(0x7F << 1)
#define _STATUS_DRDY_ 0x01 void TRS55D_read(void);
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////
// trs55d.c
//////
#include
#include "drv_i2c.h"
#include "trs55d.h"
#include "body_temp.h"
extern uint8_t uartSendString(const char* buf);
extern void OLED_ShowString(uint8_t x,uint8_t y, const char *chr,uint8_t size1,uint8_t mode);
extern void OLED_ShowBNum(uint8_t x,uint8_t y,float num,uint8_t len,
uint8_t size2,uint8_t mode); uint8_t TRS55D_IIC_Read(uint8_t addr_dev, uint8_t addr_reg,
uint8_t *buf, uint16_t count)
{
uint8_t ret;
uint8_t ackflag;
uint16_t i = 0;
drv_i2c_start();
drv_i2c_select_dev(addr_dev,DRV_I2C_OPWR);
drv_i2c_writebyte(addr_reg);
drv_i2c_start();
drv_i2c_select_dev(addr_dev,DRV_I2C_OPRD);
for(i = 0; i < count; i ++) { ackflag = (i < (count-1)) ? 1:0; buf[i]
= drv_i2c_readbyte(ackflag);
}
drv_i2c_stop();
return ret;
}
void TRS55D_IIC_Write(uint8_t addr_dev, uint8_t addr_reg, uint8_t *buf, uint16_t count)
{
uint16_t i = 0;
drv_i2c_start();
drv_i2c_select_dev(addr_dev,DRV_I2C_OPWR);
drv_i2c_writebyte(addr_reg);
for (i = 0; i < count; i ++)
{ drv_i2c_writebyte(buf[i]);
}
drv_i2c_stop();
}
typedef union{
int16_t i16;
uint16_t u16;
struct {
uint8_t u8l;
uint8_t u8h;
}un;
}uu16_t;
typedef union{
int32_t i32;
struct {
uint8_t u8b0;
uint8_t u8b1;
uint8_t u8b2;
uint8_t u8b3;
}un;
}uu32_t;
static char buffer[264];
uu32_t tobj, tamb_cal;
uu32_t vtp_cor;
float vtp_uv_f = 0.0;
float vtp_cor_f = 0.0;
float tambf = 0.0; float tobjf = 0.0;
float tbdyf = 0.0;
void TRS55D_read(void)
{
uint8_t rbuf[4];
uint8_t raddr,rdat;
uint8_t waddr = 0x0, wdat = 0x0;
int timeout=0;
waddr = 0x30;
wdat = 0x09;
TRS55D_IIC_Write(ADDR_TRS55D, waddr, &wdat,1);
//start conversion delay_ms(100);
// waite for conversion over
raddr = 0x03;
do {
TRS55D_IIC_Read (ADDR_TRS55D, raddr, &rdat,1);
} while(((rdat == 0xFF) || (!(rdat & 0x30))) && timeout++ < 200);
raddr = 0x02;
do {
TRS55D_IIC_Read (ADDR_TRS55D, raddr, &rdat,1);
} while(((rdat == 0xFF) || (!(rdat & 0x0B))) && timeout++ < 200);
// voltage value after calibration
raddr = TRS55D_NORMAL_DATA1_MSB_R;
TRS55D_IIC_Read (ADDR_TRS55D, raddr,&rbuf[0],3);
vtp_cor.un.u8b2 = rbuf[0];
vtp_cor.un.u8b1 = rbuf[1];
vtp_cor.un.u8b0 =rbuf[2];
if (vtp_cor.un.u8b2 & 0x80) { vtp_cor.un.u8b3 = 0xFF;
}else {
vtp_cor.un.u8b3 = 0x00;
// vtp after corrected
}
vtp_cor_f = (float)vtp_cor.i32/524288.0;
vtp_cor_f *= 1000;
// ambient temperature value after calibration
raddr = TRS55D_NORMAL_TEMP_MSB_R;
TRS55D_IIC_Read (ADDR_TRS55D,raddr,&rbuf[0],3);
tamb_cal.un.u8b2 = rbuf[0];
tamb_cal.un.u8b1 =rbuf[1];
tamb_cal.un.u8b0 =rbuf[2];
tambf = (float)tamb_cal.i32 / 16384.0; // ambient temperature
// object(surface) temperature after calibration
raddr = TRS55D_NORMAL_Tobj_MSB_R;
TRS55D_IIC_Read (ADDR_TRS55D,raddr,&rbuf[0],3);
tobj.un.u8b2 = rbuf[0]; tobj.un.u8b1 = rbuf[1];
tobj.un.u8b0 =rbuf[2]; tobjf = (float)tobj.i32 / 16384.0;
// object(surface) temperature
// get bodytemp
tbdyf = get_body_temp(tambf,tobjf); // get bodytemp
// display on uart sprintf(buffer, "tamb = %.2f, vtp_cor = %.2f, tobj = %.2f, tbdy = %.2f\r\n",\ tambf, vtp_cor_f, tobjf, tbdyf); uartSendString(buffer);
// display on oled
float vals[4] = {tambf, vtp_cor_f, tobjf, tbdyf+0.05};
OLED_ShowBNum (64, 0, vals[0], 4, 16, 1); // Tamb
OLED_ShowBNum (48, 16, vals[1], 6, 16, 1); // vtp
OLED_ShowString(112,16, "uv",16, 1);
OLED_ShowBNum (64, 32, vals[2], 4, 16, 1); // Tobj
OLED_ShowBNum (64, 48, vals[3], 4, 16, 1); // Tbdy
}
Site Map | 萨科微 | 金航标 | Slkor | Kinghelm
RU | FR | DE | IT | ES | PT | JA | KO | AR | TR | TH | MS | VI | MG | FA | ZH-TW | HR | BG | SD| GD | SN | SM | PS | LB | KY | KU | HAW | CO | AM | UZ | TG | SU | ST | ML | KK | NY | ZU | YO | TE | TA | SO| PA| NE | MN | MI | LA | LO | KM | KN
| JW | IG | HMN | HA | EO | CEB | BS | BN | UR | HT | KA | EU | AZ | HY | YI |MK | IS | BE | CY | GA | SW | SV | AF | FA | TR | TH | MT | HU | GL | ET | NL | DA | CS | FI | EL | HI | NO | PL | RO | CA | TL | IW | LV | ID | LT | SR | SQ | SL | UK
Copyright ©2015-2022 Shenzhen Slkor Micro Semicon Co., Ltd