3001 TEMP AND RH EN:修订间差异

来自Mcuzone Wiki
(创建页面,内容为“== '''关键词''' == 树莓派、 Raspberry Pi、树莓派5、Raspberry Pi 5、CM4、USB转串口、SHT20、STM32F030、CH340G、温湿度采集 == '''一、简介''' == 树莓派是一个通用的创客平台,不少创客在使用树莓派的时候需要一些温湿度数据,但是市面上的一些平价温湿度模块(如DHT2x)的精度和一致性实在太差,为此我们设计了一款性价比适中,精度较高的温湿度模块。我们在…”)
 
无编辑摘要
 
(未显示同一用户的1个中间版本)
第1行: 第1行:
== '''关键词''' ==
[[3001 TEMP AND RH(树莓派专用温湿度模块)|切换语言为中文]]
树莓派、 Raspberry Pi、树莓派5、Raspberry Pi 5、CM4、USB转串口、SHT20、STM32F030、CH340G、温湿度采集


== '''一、简介''' ==
== '''Keywords''' ==
树莓派是一个通用的创客平台,不少创客在使用树莓派的时候需要一些温湿度数据,但是市面上的一些平价温湿度模块(如DHT2x)的精度和一致性实在太差,为此我们设计了一款性价比适中,精度较高的温湿度模块。我们在模块上设置了一款单片机,用来读取温湿度数据,然后通过TTL串口或者通过USB转串口的形式将温湿度数据发送给主控。温湿度传感器采用盛世瑞恩的SHT20,其湿度的典型精度是±3%RH,温度的典型精度是±0.3℃。我们做过一致性测试,同一环境下5个模块的温度差在0.3℃范围内,湿度差在3%RH内。整个模块可采用USB-C接口供电和通讯,也可以通过插针供电。可以挂靠在树莓派上测量树莓派附近的温湿度,也可以通过长达2米的USB-C线放至到目标环境进行温湿度测量。
Raspberry Pi, Raspberry Pi 5, CM4, USB to serial, SHT20, STM32F030, CH340G, Temperature and humidity collection


== '''二、硬件资源''' ==
== '''I. Introduction''' ==
1. 主控采用STM32F030,用于采集温湿度,并通过TTL串口或者USB串口将数据发送给上位机;
The Raspberry Pi is a versatile maker platform, and many makers require temperature and humidity data when using the Raspberry Pi. However, the accuracy and consistency of some affordable temperature and humidity modules on the market (such as the DHT2x series) are often quite poor. So we have designed a temperature and humidity module that offers better precision at a reasonable cost. We have set up a microcontroller on the module to read temperature and humidity data, which sends data to the main controller via a TTL serial port or through a USB-to-serial adapter. The temperature and humidity sensor used is the SHT20 from Sensirion, with a typical humidity accuracy of ±3%RH and a typical temperature accuracy of ±0.3°C. We have conducted consistency tests, and in the same environment, the temperature difference among five modules is within 0.3°C, and the humidity difference is within 3%RH. The entire module can be powered and communicated with through a USB-C interface, or it can be powered via pin connectors. The module can measure the temperature and humidity near the Raspberry Pi or can be placed in the target environment for measurement using a USB-C cable up to 2 meters long.


2. USB接口采用当下流行的USB Type-C接口,既用于供电,也用于USB转串口通讯;
== '''II. Hardware Resources''' ==
1. The main controller uses STM32F030 to collect temperature and humidity data, which sends data to the host computer via a TTL serial port or a USB serial port.


3. USB转串口芯片采用CH340G,经过十几年的发展,南京沁恒的USB转串口芯片已经相当成熟,稳定性和性价比都还不错;
2. The USB interface uses the popular USB Type-C connector, which is utilized for both power supply and USB-to-serial communication.


4. 温湿度芯片采用SHT20,湿度典型值±3%RH,温度典型值±0.3℃;
3. The USB-to-serial conversion chip used is the CH340G. After more than a decade of development, Nanjing Qinheng's USB-to-serial chips have become quite mature, with good stability and cost-effectiveness.


5. 预留TTL串口,预留SWD接口,预留富余的GPIO;
4. The temperature and humidity sensor chip used is the SHT20, with a typical humidity accuracy of ±3%RH and a typical temperature accuracy of ±0.3°C.


6. 焊接一个按键,用于切换数据从TTL串口还是USB转串口输出。预留一个未焊接的按键位;
5. Reserve TTL serial ports/SWD interfaces/extra GPIO pins.


7. 一个用户LED,默认关闭状态,上电后亮起。用户可以修改为其它指示用途;
6. Solder a button for switching the output of data from the TTL serial port to the USB-to-serial port. Reserve a position for an unsoldered button.


8. 尺寸:40*55mm,和树莓派cm4核心板尺寸完全吻合;M2.5定位孔。
7. A user LED, which is off by default and lights up after power-on. Users can modify it for other indicator purposes.
 
8. Size: 40*55mm, perfectly matching the dimensions of the Raspberry Pi CM4's core board; M2.5 mounting holes.


http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_12.jpg
http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_12.jpg


== '''三、树莓派OS测试''' ==
== '''III. Test in Raspberry Pi OS''' ==
硬件平台:我们采用树莓派CM4核心板搭配我们的扩展板来测试,其他树莓派5/4B/3/zero系列等的操作方法也一样。硬件连接见下图:
Hardware Platform: We use the Raspberry Pi CM4's core board paired with our expansion board for testing. The operation methods for other Raspberry Pi models such as the 5/4B/3/Zero series are the same. Please refer to the following picture for hardware connections:http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_10.jpg
 
We use the official Raspberry Pi OS for test. 版本为2024-07-04-raspios-bookworm-arm64.img.xz


http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_10.jpg
The Raspberry Pi OS used in this document is: 2024-07-04-raspios-bookworm-arm64.img.xz(Raspberry Pi OS with desktop).


软件平台:我们用树莓派官方OS测试,版本为2024-07-04-raspios-bookworm-arm64.img.xz
You can download the Raspberry Pi OS in:


树莓派OS下载地址:https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit
https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit


树莓派系统系统下我们使用串口工具来读取温湿度数据。
In the Raspberry Pi system, We use a serial port tool to read the temperature and humidity data in the Raspberry Pi system.


在终端中执行下列命令,安装串口工具CuteCom:
Execute the following command in the terminal to install the serial port tool CuteCom:


<code>sudo apt install cutecom</code>
<code>sudo apt install cutecom</code>
第41行: 第45行:
http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_04.jpg
http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_04.jpg


安装完毕后,点击左上角的树莓派标志,进入System Tools,点击CuteCom图标:
After installation, click on the Raspberry Pi logo in the upper left corner, go to System Tools, and click on the CuteCom icon:


http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_05.jpg
http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_05.jpg


打开软件后,软件自动认到温湿度模块的串口号ttyUSB0,串口参数使用默认的115200@8-N-1即可:
After opening, the software automatically detects the serial port number ttyUSB0 of the temperature and humidity module. The default serial port parameters of 115200@8-N-1 can be used:


http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_06.jpg
http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_06.jpg


点击”Open“,打开串口,下方的输出框即会输出当前的温湿度数据:
Click "Open" to open the serial port; the output box below will then display the current temperature and humidity data:


http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_07.jpg
http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_07.jpg


板子上预留了I2C接口,可以接OLED,如果用户有需求,可以自己写应用程序,将温湿度信息显示在液晶屏上。
The board reserves I2C interface, which can be used to connect OLED display. If you have the requirement, you can write your own application to display the temperature and humidity information on the LCD screen.


== '''四、Windows 10系统测试''' ==
== '''IV. . Test in Windows''' ==
Windows 10下本模块被认成一个USB转串口,首先需要安装CH340驱动,驱动下载地址:
Under Windows 10, this module is recognized as a USB-to-serial converter. You need to install the CH340 driver first. The driver download link is:


http://www.mcuzone.com/down/Software.asp?ID=10000607
http://www.mcuzone.com/down/Software.asp?ID=10000607


安装驱动完毕后,使用USB A-C线,将温湿度模块连接到电脑的USB A口,模块会自动启动。
After installing the driver, use a USB A-C cable to connect the temperature and humidity module to the USB-A port on the computer, and the module will start automatically.


连接成功后,我们可以在设备管理器中看到一个USB转串口(本例子中为COM6):
After a successful connection, we can see a USB-to-serial port (COM6 in this example) in the Device Manager:


http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_01.jpg
http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_01.jpg


接下来下载温湿度测量软件:
Next, download the temperature and humidity measurement software:


http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/THTB.zip
http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/THTB.zip


解压压缩包,运行THTB.exe,打开软件,软件会自动检测到那个USB转串口,此时点击”打开串口“,即可显示当前的温湿度:
Unzip the compressed file, run TH TB.exe, open the software, and it will automatically detect the USB-to-serial port. Then click "Open Serial Port" to display the current temperature and humidity:


http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_03.jpg
http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_03.jpg
第76行: 第80行:
http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_02.jpg
http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/3001_TEMP_AND_RH_02.jpg


{{联系我们_图标}}
{{Contact_Us_icon}}

2024年10月18日 (五) 17:32的最新版本

切换语言为中文

Keywords

Raspberry Pi, Raspberry Pi 5, CM4, USB to serial, SHT20, STM32F030, CH340G, Temperature and humidity collection

I. Introduction

The Raspberry Pi is a versatile maker platform, and many makers require temperature and humidity data when using the Raspberry Pi. However, the accuracy and consistency of some affordable temperature and humidity modules on the market (such as the DHT2x series) are often quite poor. So we have designed a temperature and humidity module that offers better precision at a reasonable cost. We have set up a microcontroller on the module to read temperature and humidity data, which sends data to the main controller via a TTL serial port or through a USB-to-serial adapter. The temperature and humidity sensor used is the SHT20 from Sensirion, with a typical humidity accuracy of ±3%RH and a typical temperature accuracy of ±0.3°C. We have conducted consistency tests, and in the same environment, the temperature difference among five modules is within 0.3°C, and the humidity difference is within 3%RH. The entire module can be powered and communicated with through a USB-C interface, or it can be powered via pin connectors. The module can measure the temperature and humidity near the Raspberry Pi or can be placed in the target environment for measurement using a USB-C cable up to 2 meters long.

II. Hardware Resources

1. The main controller uses STM32F030 to collect temperature and humidity data, which sends data to the host computer via a TTL serial port or a USB serial port.

2. The USB interface uses the popular USB Type-C connector, which is utilized for both power supply and USB-to-serial communication.

3. The USB-to-serial conversion chip used is the CH340G. After more than a decade of development, Nanjing Qinheng's USB-to-serial chips have become quite mature, with good stability and cost-effectiveness.

4. The temperature and humidity sensor chip used is the SHT20, with a typical humidity accuracy of ±3%RH and a typical temperature accuracy of ±0.3°C.

5. Reserve TTL serial ports/SWD interfaces/extra GPIO pins.

6. Solder a button for switching the output of data from the TTL serial port to the USB-to-serial port. Reserve a position for an unsoldered button.

7. A user LED, which is off by default and lights up after power-on. Users can modify it for other indicator purposes.

8. Size: 40*55mm, perfectly matching the dimensions of the Raspberry Pi CM4's core board; M2.5 mounting holes.

3001_TEMP_AND_RH_12.jpg

III. Test in Raspberry Pi OS

Hardware Platform: We use the Raspberry Pi CM4's core board paired with our expansion board for testing. The operation methods for other Raspberry Pi models such as the 5/4B/3/Zero series are the same. Please refer to the following picture for hardware connections:3001_TEMP_AND_RH_10.jpg

We use the official Raspberry Pi OS for test. 版本为2024-07-04-raspios-bookworm-arm64.img.xz

The Raspberry Pi OS used in this document is: 2024-07-04-raspios-bookworm-arm64.img.xz(Raspberry Pi OS with desktop).

You can download the Raspberry Pi OS in:

https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit

In the Raspberry Pi system, We use a serial port tool to read the temperature and humidity data in the Raspberry Pi system.

Execute the following command in the terminal to install the serial port tool CuteCom:

sudo apt install cutecom

3001_TEMP_AND_RH_04.jpg

After installation, click on the Raspberry Pi logo in the upper left corner, go to System Tools, and click on the CuteCom icon:

3001_TEMP_AND_RH_05.jpg

After opening, the software automatically detects the serial port number ttyUSB0 of the temperature and humidity module. The default serial port parameters of 115200@8-N-1 can be used:

3001_TEMP_AND_RH_06.jpg

Click "Open" to open the serial port; the output box below will then display the current temperature and humidity data:

3001_TEMP_AND_RH_07.jpg

★ The board reserves I2C interface, which can be used to connect OLED display. If you have the requirement, you can write your own application to display the temperature and humidity information on the LCD screen.

IV. . Test in Windows

Under Windows 10, this module is recognized as a USB-to-serial converter. You need to install the CH340 driver first. The driver download link is:

http://www.mcuzone.com/down/Software.asp?ID=10000607

After installing the driver, use a USB A-C cable to connect the temperature and humidity module to the USB-A port on the computer, and the module will start automatically.

After a successful connection, we can see a USB-to-serial port (COM6 in this example) in the Device Manager:

3001_TEMP_AND_RH_01.jpg

Next, download the temperature and humidity measurement software:

http://www.mcuzone.com/wiki/3001_TEMP_AND_RH/THTB.zip

Unzip the compressed file, run TH TB.exe, open the software, and it will automatically detect the USB-to-serial port. Then click "Open Serial Port" to display the current temperature and humidity:

3001_TEMP_AND_RH_03.jpg

3001_TEMP_AND_RH_02.jpg

Contact Us

0001_x.jpg 0002_fb.jpg 0004_ytb.jpg 0003_bb.jpg 0005_qq.jpg QQ:8204136

Email: mcuzone@vip.qq.com

Tel: +86(0)13957118045

If there are any omissions, errors, or infringements on this page, please contact us through the above methods. Thank you!

Copyright 2004-2024 Wildchip