完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好。我有湿度测量的问题。尽管温度适当,但湿度总是超过100%。我正在使用官方的ST软件。我想知道这是硬件问题吗?
初始化如下: ... HTS221_Init_st cfg_struct; cfg_struct.avg_h = HTS221_AVGH_4; cfg_struct.avg_t = HTS221_AVGT_2; cfg_struct.odr = HTS221_ODR_1HZ; cfg_struct.bdu_status = HTS221_ENABLE; cfg_struct.heater_status = HTS221_DISABLE; cfg_struct.irq_level = HTS221_LOW_LVL; cfg_struct.irq_output_type = HTS221_PUSHPULL; cfg_struct.irq_enable = HTS221_DISABLE; HTS221_Get_DeviceID(& deviceID); HTS221_Set_InitConfig(& cfg_struct); / *它实际上是激活函数!!! * / HTS221_DeActivate(); while(true) { HTS221_Get_Measurement(&湿度,温度); ...一些延迟和读取数据 } #humid#hts221 #humidity #sensor 以上来自于谷歌翻译 以下为原文 Hello. I have a problem with humidity measurement. Despite the proper value of temperature, te humidity is always over 100%. I'm using the official ST software. I'm wondering if it is a hardware problem ? The initialization is as following: ... HTS221_Init_st cfg_struct; cfg_struct.avg_h = HTS221_AVGH_4; cfg_struct.avg_t = HTS221_AVGT_2; cfg_struct.odr = HTS221_ODR_1HZ; cfg_struct.bdu_status = HTS221_ENABLE; cfg_struct.heater_status = HTS221_DISABLE; cfg_struct.irq_level = HTS221_LOW_LVL; cfg_struct.irq_output_type = HTS221_PUSHPULL; cfg_struct.irq_enable = HTS221_DISABLE;HTS221_Get_DeviceID(&deviceID); HTS221_Set_InitConfig(&cfg_struct);/* it is activation function in fact !!! */ HTS221_DeActivate();while (true) { HTS221_Get_Measurement(&humidity, &temperature); ... some delay and read data } #humid #hts221 #humidity #sensor |
|
相关推荐
9个回答
|
|
你好,
如果粘贴设备的寄存器内容,则更容易提供帮助。 我们可以快速排除故障设备。 大卫 以上来自于谷歌翻译 以下为原文 Hello, it is easier to help if you paste the device's register contents. We can quickly rule out a faulty device. David |
|
|
|
如果以下注册内容就足够了?
AV_CONF(10h) CTRL_REG1(20h) CTRL_REG2(21h) CTRL_REG3(22h) 以上来自于谷歌翻译 以下为原文 If the following register contents will be sufficient ? AV_CONF (10h) CTRL_REG1 (20h) CTRL_REG2 (21h) CTRL_REG3 (22h) |
|
|
|
为了能够计算输出,需要输出值+校准值。
请粘贴以下所有寄存器的内容: 以上来自于谷歌翻译 以下为原文 To be able to count the output, output values + calibration values are needed. Please paste the content of all the registers below: |
|
|
|
|
|
|
|
写入0x20寄存器时的I2C分析器日志:
以上来自于谷歌翻译 以下为原文 I2C analyzer's log when writting 0x20 register: |
|
|
|
根据提供的公式
http://www.st.com/resource/en/technical_note/dm00208001.pdf 是和你的H_OUT值是湿度143,3%rH。我相信H_OUT = 0x8000是一个默认值被第一次测量覆盖(我已经看到与其他传感器相同)。 确保您的传感器从掉电模式切换到活动模式。打开它的唯一方法是将正确的值写入CTRL_REG1(20h)。 您是否可以将代码跟踪到结构中的常量组合(ORed)在一起以及将哪些值写入该寄存器? 或者甚至更好,你能通过连接总线分析仪看到写入该寄存器的内容吗? 以上来自于谷歌翻译 以下为原文 According to the formula provided in http://www.st.com/resource/en/technical_note/dm00208001.pdf is and your H_OUT value is the humidity 143,3 % rH.I believe H_OUT = 0x8000 is some default value to be overwritten by a first measurement (I have seen the same with other sensors). Make sure your sensor is switched to active mode from power-down mode. The only thing to turn it on is to write a correct value to CTRL_REG1 (20h). Can you trace your code to the point where the constants in the struct are combined (ORed) together and what value is written to that register? Or even better, can you see what is written to that register by connecting a bus analyzer? |
|
|
|
配置似乎还可以,主动模式,BDU和1 Hz输出数据速率。
几秒钟之后H_OUT是否保持不变并且测量样品?你是否看到温度测量的相同行为? 以上来自于谷歌翻译 以下为原文 The configuration also seems to be OK, active mode, BDU and 1 Hz output data rate. Does the the H_OUT remain the same even after a few seconds and samples measured? Do you see the same behaviour with temperature measurement? |
|
|
|
我会尽快检查,但温度测量没有问题。
以上来自于谷歌翻译 以下为原文 I will check it as soon as possible, but there is no problem with temperature measurement. |
|
|
|
有意思......你还有其他传感器需要测试吗?
如果该值完全没有变化,我会怀疑ESD /焊接损坏。事实是,用于测量湿度的材料是暴露的,并且比其他材料更容易损坏。 老实说,我的想法已经不多了。 以上来自于谷歌翻译 以下为原文 Interesting... Do you have any other sensor to test? If the value doesn't change at all, I would be suspicious about ESD / soldering damage. The fact is, that the material for measuring humidity is exposed and can be damaged easier than the rest. Honestly, I am running out of ideas. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2578 浏览 1 评论
3194 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1763 浏览 1 评论
3589 浏览 6 评论
5967 浏览 21 评论
924浏览 4评论
1300浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
563浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1286浏览 3评论
1338浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-5 17:30 , Processed in 1.830147 second(s), Total 94, Slave 77 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号