Arduino与Proteus仿真实例-SHT10温度传感器驱动仿真

SHT10温度传感器驱动仿真

1、SHT10介绍

SHT10 是一款经过全面校准的湿度和温度传感器。 它在一个微型封装中集成了湿度和温度传感器元件以及信号处理电路。 它使用电容式传感器元件来测量相对湿度。 为了测量温度,它使用带隙传感器。

它具有 14 位 ADC(模数转换器),可将来自传感器元件的模拟数据转换为数字输出。 SHT10 具有 I2C 接口,允许主机微控制器读取湿度和温度数字数据。

它提供分辨率为 12 位的相对湿度数据,精度为 ±4.5% RH(相对湿度)。 工作范围为 0 至 100% RH。 温度数据的分辨率为 14 位,精度为 ±0.5°C。 工作温度范围为 -40 至 123.8°C。

SHT10 使用 2.4 至 5.5V 范围内的电源工作。

可用于数据采集系统、数据记录、气象监测单元等。

SHT10有如下特性:

  • 数字输出
  • 低功耗
  • SMD 型封装 - 可回流焊
  • 卓越的信号质量、快速的响应时间和对外部干扰 (EMC) 的不敏感性。
  • 传感器由 CMOS 芯片制成,传感器外壳由 LCP 帽组成,在 FR4 基板上带有环氧树脂球顶部
  • 符合 RoHS 和 WEEE

在这里插入图片描述

SHT10引脚功能如下:

在这里插入图片描述

在前面的文章对SHT10做了详细的介绍,请参考:

2、仿真电路原理图

在这里插入图片描述

3、仿真代码实现

本次实例使用到如下开源库:

演示代码如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <SHT1x.h>

// Specify data and clock connections and instantiate SHT1x object
#define dataPin 10
#define clockPin 11
SHT1x sht1x(dataPin, clockPin);

void setup()
{
Serial.begin(9600); // Open serial connection to report values to host
Serial.println("Starting up");
}

void loop()
{
float temp_c;
float temp_f;
float humidity;

// Read values from the sensor
temp_c = sht1x.readTemperature(TempUnit::C);
temp_f = sht1x.readTemperature(TempUnit::F);
humidity = sht1x.readHumidity();

// Print the values to the serial port
Serial.print("Temperature: ");
Serial.print(temp_c, DEC);
Serial.println(" \*C");
//Serial.print(temp\_f, DEC);
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println("%");

delay(500);
}

4、仿真结果

在这里插入图片描述

注意,由于是仿真环境,不是真实的物理环境,SHT1x的仿真结果有理论结果有偏差,因为模拟组件没有做校正。

文章来源: https://iotsmart.blog.csdn.net/article/details/121486555