宋元浩

Temperature and humidity monitoring based on Tuya Smart

 
Overview

The engineering power supply interface adopts TYPE-C interface, and a high-current voltage regulator chip AMS1117-3.3 is used to ensure that the WIFI module has sufficient current. The MCU part uses APM32F103C8T6, which is cheap and can directly replace STM32. Most of the pins of the MCU are tapped out to facilitate access to other peripherals.



Circuit aspect

This circuit does not have a serial port to TTL circuit, but only provides a downloader interface for downloading programs, and the USB interface is only used for power supply. There is a green LED light on the power supply. If the light is on, it means that the power supply part is working normally.QQ screenshot 20210227111630.png

Next is the Tuya module. This part is relatively simple. Because it uses an MCU development solution, the Tuya module only functions to communicate with the cloud, so it only needs the IO port of the serial port. However, for convenience, I additionally add RST The port is led into the button to facilitate resetting the Tuya module. The serial port first passes through a horn connector, which is convenient for debugging after soldering the circuit. When communicating with the MCU, it only needs to be short-circuited. The two 100 ohm resistors on RX and TX are used to unify the levels to prevent errors caused by inconsistent levels during communication between the MCU and Tuya (this error should not occur often).QQ screenshot 20210227111813.png

I won’t go into details about the MCU part. It is actually the core circuit of STM32, but the MCU is replaced by AMP32. I personally tested the two and they can be directly replaced. There may be some differences in advanced functions. For example, when others use it, it seems to read and write FLASH. There is a little difference, but it is not used in this project, so we use it as STM32. Both the standard library and the HAL library can be used.QQ screenshot 20210227112253.png

QQ screenshot 20210227112302.pngQQ screenshot 20210227112311.pngQQ screenshot 20210227112327.png

The last is the circuit of the SHT30 temperature and humidity sensor. It is actually more convenient to design here, just make slight modifications according to the chip manual.QQ screenshot 20210227112709.png


The resistors and capacitors on the circuit are all in 0603 packages. On the one hand, I can exercise my welding skills, but on the other hand, if they are too large, the board will become larger.




Procedural aspects

I have already written all the programs for the HAL library, and I just need to connect to the Tuya module. However, there is a problem with the configuration of the serial port. I really can’t figure out where to put the uart_receive_input() function. For the sake of convenience, I just changed it. It has become a standard library, and it is actually easier to convert between the two. After using the standard library, it is easier. Following Tuya's transplant tutorial (although it is based on the HAL library), the MCU and Tuya modules are quickly connected together.



参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-24 05:43:42
  • Talk about the use of TI MSP-EXP430FR5739 group purchase board
  • 【R7F0C809】DIY Chapter 7--LCD1602 lighting
  • Variable storage problem after exiting the system
  • TLV2553
  • This week's highlights
  • Pulsonix compatible eda software

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号