数字温湿度传感器 SHT 10 SHT 10 请以英文为准 译文仅供参考 相对湿度和温度测量 兼有露点 全部校准 数字输出 卓越的长期稳定性 无需额外部件 超低能耗 表面贴片或4 引脚安装 完全互换 超小尺寸 自动休眠 SHT10 系列为贴片型温湿度传感器芯片 SHT10 全量程标定 两线数字输出 湿度测量范围 0 100%RH 湿度测 量范围 -40 +123.8 湿度测量精度 ±4.5%RH 温度测量精度 ±0.5 响应时间 <8s 低功耗 (typ. 30µW) 可完全浸没 SHT10 产品概述 SHTxx 系列单芯片传感器是一款含有已校准数字信号输出的温湿度复合传感器 它应用专利的工 业 COMS 过程微加工技术 CMOSens 确保产品具 有极高的可靠性与卓越的长期稳定性 传感器包括一个电 容式聚合体测湿元件和一个能隙式测温元件 并与一个 14 位的 A/D 转换器以及串行接口电路在同一芯片上实 现无缝连接 因此 该产品具有品质卓越 超快响应 抗 干扰能力强 性价比极高等优点 每个 SHTxx 传感器都 在极为精确的湿度校验室中进行校准 校准系数以程序的 形式储存在 OTP 内存中 传感器内部在检测信号的处理 过程中要调用这些校准系数 两线制串行接口和内部基准 电压 使系统集成变得简易快捷 超小的体积 极低的功 耗 使其成为各类应用甚至最为苛刻的应用场合的最佳选 则 产品提供表面贴片 LCC 无铅芯片 或 4 针单排引脚封装 特殊封装形式可根据用户需求而 提供 应用领域:数据采集器 变送器 自动化过程控制 汽车行业 楼宇控制&暖通空调 电力 计量测试 医药业 第1页
传感芯片订货信息: 防护型温湿度传感器及插针型产品订货信息 (以下产品由我司根据用户要求订制生产 用户特殊要求可订制) 订货型号 名称 SHT10-P 防护型温湿度传感器 SHT11-P 防护型温湿度传感器 SHT15-P 防护型温湿度传感器 SHT10-D 插针型温湿度传感器 SHT15- D 插针型温湿度传感器 SHT15- D 插针型温湿度传感器 系列仪器订货信息 SLIH1-1 壁挂智能温湿度测试仪 SLIH1-1/I 一体化智能温湿度测试仪 (内置温湿度传感器) SLIH1-1/R 组网型智能温湿度测试仪 (带 RS485 接口) SLMT2-2 智能温湿度数据采集模块 SLMT2-2/I 一体化智能温湿度数据采集模块 (内置温湿度传感器) 第1页
第2页
第3页
第4页
外形尺寸 焊接说明 1 说明 SHT1X 温湿度传感器在焊接过程中和焊接之后需要作特殊处理 以避免对温湿度敏感元件 造成损坏 SHT1X 温湿度传感器可以在 260 温度下 30 秒之内进行标准回流焊接 包括无铅焊接 2 焊接规程 2.1 焊锡膏 请使用免清洗焊锡膏 2.2 建议焊接条件 注 以上所有温度均指传感器封装顶部温度 测量时请测传感器件的上表面 2.3 PCB 清洗 传感器焊接之后请不要清洗PCB 印刷电路板 由于使用免清洗焊锡膏 清洗不是必需步 第5页
骤 2.4 焊接后的处理 传感器焊接之后 湿度显示会出现暂时性改变 这是由于焊接时极高的温度引起的 因此 焊接之后的传感器需要在湿度>74%RH 温度>20 的条件下放置至少48 小时 促使其快速 地恢复到正常状态 2.5 手工焊接 手工焊接限制最高温度为350 接触时间不得超过5 秒 2.6 焊接质量 为保证传感器与PCB 板连接牢固 焊锡应填满至顶部 2.7 注意 焊接过程中电容性湿敏元件与挥发性溶剂接触 可能会导致湿度暂时性漂移 只需将传感器加热到100 保持一天 可使其恢复到校准状态 1 编号为144 之前的产品 2004 年14 周 峰值为235 2 编号为 144 之前的产品 2004 年 14 周 峰值为 219 温湿度传感器 SHT 系列功耗的正确测量方法 以下方法由总部 测试工程师 梁书成提供 正确的功耗测量方法是传感器在正确的工作状态下的测量 我们传感器的正确接法如下 在这个基础上我们的功耗测试的连接应该如下 但这只是硬件的基本连接 这并不能代表我们的传感器就已经在正确的工作状态了 第6页
根据下图我们知道 传感器只有在sck 保持低电平 data 保持高电平 传感器才会进入正确的工作 状态 在无读取时进入休眠状态 测量到的功耗才是正确的 我们知道 传感器只有在sck 保持低电平 data 保持高电平 传感器才会进入正确的工作 状态 在无读取时进入休眠状态 测量到的功耗才是正确的 SHTxx 驱动程序 本程序由我司检测无误 并已用在我司 SLSH1-1 温湿度仪上 请放心使用 /*********************************************************************************** Project: SHTxx 驱动程序 工作在 22.1184M 下 ***********************************************************************************/ #include <AT89s53.h> //Microcontroller specific library, e.g. port definitions #include <intrins.h> //Keil library (is used for nop() operation) #include <math.h> //Keil library #include <stdio.h> //Keil library typedef union unsigned int i; float f; value; 第7页
//---------------------------------------------------------------------------------// modul-var //---------------------------------------------------------------------------------enum TEMP,HUMI; #define DATA #define SCK P11 P10 #define noack 0 #define ACK 1 //adr command r/w #define STATUSREGW 0x06 //000 0011 0 #define STATUSREGR 0x07 //000 0011 1 #define MEASURETEMP 0x03 //000 0001 1 #define MEASUREHUMI 0x05 //000 0010 1 #define RESET 0x1e //000 1111 0 //---------------------------------------------------------------------------------char swritebyte(unsigned char value) //---------------------------------------------------------------------------------// writes a byte on the Sensibus and checks the acknowledge unsigned char i,error=0; for (i=0x80;i>0;i/=2) //shift bit for masking if (i & value) DATA=1; //masking value with i, write to SENSI-BUS else DATA=0; SCK=1; //clk for SENSI-BUS nop();nop();nop(); //pulswith approx. 5 us SCK=0; DATA=1; //release DATA-line SCK=1; //clk #9 for ack error=data; //check ack (DATA will be pulled down by SHT11) SCK=0; return error; //error=1 in case of no acknowledge //---------------------------------------------------------------------------------char sreadbyte(unsigned char ack) //---------------------------------------------------------------------------------// reads a byte form the Sensibus and gives an acknowledge in case of "ack=1" 第8页
unsigned char i,val=0; DATA=1; for (i=0x80;i>0;i/=2) SCK=1; if (DATA) val=(val i); SCK=0; DATA=!ack; SCK=1; nop();nop();nop(); SCK=0; DATA=1; return val; //release DATA-line //shift bit for masking //clk for SENSI-BUS //read bit //in case of "ack==1" pull down DATA-Line //clk #9 for ack //pulswith approx. 5 us //release DATA-line //---------------------------------------------------------------------------------void stransstart(void) //---------------------------------------------------------------------------------// generates a transmission start // // DATA: // // SCK : DATA=1; SCK=0; //Initial state nop(); SCK=1; nop(); DATA=0; nop(); SCK=0; nop();nop();nop(); SCK=1; nop(); DATA=1; nop(); SCK=0; //---------------------------------------------------------------------------------void sconnectionreset(void) //---------------------------------------------------------------------------------// communication reset: DATA-line=1 and at least 9 SCK cycles followed by transstart 第9页
// // DATA: // // SCK : unsigned char i; DATA=1; SCK=0; //Initial state for(i=0;i<9;i++) //9 SCK cycles SCK=1; SCK=0; stransstart(); //transmission start //---------------------------------------------------------------------------------char ssoftreset(void) //---------------------------------------------------------------------------------// resets the sensor by a softreset unsigned char error=0; sconnectionreset(); //reset communication error+=swritebyte(reset); //send RESET-command to sensor return error; //error=1 in case of no response form the sensor //---------------------------------------------------------------------------------char sreadstatusreg(unsigned char *pvalue, unsigned char *pchecksum) //---------------------------------------------------------------------------------// reads the status register with checksum (8-bit) unsigned char error=0; stransstart(); //transmission start error=swritebyte(statusregr); //send command to sensor *pvalue=sreadbyte(ack); //read status register (8-bit) *pchecksum=sreadbyte(noack); //read checksum (8-bit) return error; //error=1 in case of no response form the sensor //---------------------------------------------------------------------------------char swritestatusreg(unsigned char *pvalue) //---------------------------------------------------------------------------------// writes the status register with checksum (8-bit) 第 10 页
unsigned char error=0; stransstart(); //transmission start error+=swritebyte(statusregw);//send command to sensor error+=swritebyte(*pvalue); //send value of status register return error; //error>=1 in case of no response form the sensor //---------------------------------------------------------------------------------char smeasure(unsigned char *pvalue, unsigned char *pchecksum, unsigned char mode) //---------------------------------------------------------------------------------// makes a measurement (humidity/temperature) with checksum unsigned error=0; unsigned int i; stransstart(); //transmission start switch(mode) //send command to sensor case TEMP : error+=swritebyte(measuretemp); break; case HUMI : error+=swritebyte(measurehumi); break; default : break; for (i=0;i<65535;i++) if(data==0) break; //wait until sensor has finished the measurement if(data) error+=1; // or timeout (~2 sec.) is reached *(pvalue) =sreadbyte(ack); //read the first byte (MSB) *(pvalue+1)=sreadbyte(ack); //read the second byte (LSB) *pchecksum =sreadbyte(noack); //read checksum return error; //---------------------------------------------------------------------------------void inituart() //---------------------------------------------------------------------------------//9600 bps @ 11.059 MHz SCON = 0x52; TMOD = 0x20; TCON = 0x69; TH1 = 0xfd; //---------------------------------------------------------------------------------------void calcsth11(float *phumidity,float *ptemperature) //---------------------------------------------------------------------------------------// calculates temperature [度] and humidity [%RH] 第 11 页
// input : humi [Ticks] (12 bit) // temp [Ticks] (14 bit) // output: humi [%RH] // temp [度] const float C1=-4.0; const float C2=+0.0405; const float C3=-0.0000028; const float T1=+0.01; const float T2=+0.00008; float rh=*phumidity; float t=*ptemperature; float rhlin; float rhtrue; float tc; // for 12 Bit // for 12 Bit // for 12 Bit // for 14 Bit @ 5V // for 14 Bit @ 5V // rh: Humidity [Ticks] 12 Bit // t: Temperature [Ticks] 14 Bit // rhlin: Humidity linear // rhtrue: Temperature compensated humidity // tc : Temperature tc=t*0.01-40; //calc. temperature from ticks rhlin=c3*rh*rh + C2*rh + C1; //calc. humidity from ticks to [%RH] rhtrue=(tc-25)*(t1+t2*rh)+rhlin; //calc. temperature compensated humidity [%RH] if(rhtrue>100)rhtrue=100; //cut if the value is outside of if(rhtrue<0.1)rhtrue=0.1; //the physical possible range *ptemperature=tc; *phumidity=rhtrue; //return temperature //return humidity[%rh] //-------------------------------------------------------------------float calcdewpoint(float h,float t) //-------------------------------------------------------------------// calculates dew point // input: humidity [%RH], temperature [度] // output: dew point float logex,dewpoint; logex=0.66077+7.5*t/(237.3+t)+(log10(h)-2); dewpoint = (logex - 0.66077)*237.3/(0.66077+7.5-logEx); return dewpoint; //---------------------------------------------------------------------------------void main() //---------------------------------------------------------------------------------// sample program that shows how to use SHT11 functions // 1. connection reset 第 12 页
// 2. measure humidity [ticks](12 bit) and temperature [ticks](14 bit) // 3. calculate humidity [%RH] and temperature // 4. calculate dew point // 5. print temperature, humidity, dew point value humival,tempval; float dewpoint; unsigned char error,checksum; unsigned int i; inituart(); sconnectionreset(); while(1) error=0; error+=smeasure((unsigned char*) &humival.i,&checksum,humi); //measure humidity error+=smeasure((unsigned char*) &tempval.i,&checksum,temp); //measure temperature if(error!=0) sconnectionreset(); //in case of an error: connection reset else humival.f=(float)humival.i; //converts integer to float tempval.f=(float)tempval.i; //converts integer to float calcsth11(&humival.f,&tempval.f); //calculate humidity, temperature dewpoint=calcdewpoint(humival.f,tempval.f); //calculate dew point printf("temp:%5.1fc humi:%5.1f%% dew point:%5.1fc\n",tempval.f,humival.f,dewpoint); //----------wait approx. 0.8s to avoid heating up SHTxx-----------------------------for (i=0;i<40000;i++); //(be sure that the compiler doesn't eliminate this line!) //---------------------------------------------------------------------------------- 本公司专业代理销售 SENSIRION 盛世瑞恩 系列传感器 联系电话 021-51083595 网址 http://www.sonbest.com 地址 上海市黄浦区广西北路 668 号 1604 室 展销部地址 展销部电话 021-61209285 网址: http://www.dwn.com.cn 地址 上海市北京东路 668 号上海赛格电子市场 G537 室 第 13 页