桂花蒸

[Tuya Smart] Temperature and Humidity Sensor

 
Overview

General description

You can connect to WIFI and upload temperature, humidity and brightness information to the Tuya IoT platform. The microcontroller uses the domestic CKS 32F031K6T6 , which is low-priced and has many pins. It is fully compatible with the same model of ST microcontroller. The temperature and humidity sensor uses SHT30 , and the brightness information is collected through a photoresistor. The infrared sensor can be matched with the OLED screen for low power consumption management. The OLED will only display when someone walks by or waves in front of the module. OLED uses a pin header + female header connection method, which is more convenient for DIY. The battery power supply uses a high-current, low-voltage drop chip. The external lithium battery can be equipped with an integrated charging and discharging module, supporting up to 6V. The lithium battery pack can be placed under the OLED screen. OLED screens can display various information, such as temperature, humidity, brightness, etc.

Instructions for use

After welding and burning are completed, power on, information can be displayed on the OLED, and the network is automatically configured in the Tuya APP. After the network configuration is completed according to the prompts, the values ​​can be viewed in the APP.

Project progress

2021-01-19
  • After listening to the evening class, I started drawing schematic diagrams
  • CKS32F031F4P6 for main control
2021-01-20
  • The PCB was finished. When I placed the order, I found it was out of stock and had to redraw the PCB.
  • To prevent insufficient FLASH, the chip is switched to CKS32F031K6T6
  • Moderated
2021-01-21
  • The review said the layout can be optimized and the PCB redrawn.
  • Continue to wait for review
2021-01-22
  • After approval, start placing orders
  • CKS32F031K6T6 is out of stock. I went to Taobao and bought a grind-marked STM32F030K6T6, which is compatible.
2021-01-23
  • Purchased Tuya module and waiting for delivery
2021-01-25
  • The PCB modification is completed and the order is placed.
  • Components were also ordered
2021-01-28
  • The PCB has been shipped, but the module has not yet been shipped. After urging the module, the module has also been shipped.
  • Lichuang Mall components arrive
  • Grinding standard MCU arrives
2021-01-29
  • Although the WBR3 module was shipped late, it was fast and arrived in one day.
  • The PCB board has also arrived
2021-01-30
  • Most of the patch welding is completed, but the SHT30 is soldered, so let’s debug the OLED and MCU first.
  • Purchased heating table and solder paste on Taobao
2021-02-03
  • Solder paste and heating table arrive for soldering
2021-02-04
  • Debugging code, SHT30 cannot read temperature and humidity
  • The Tuya module keeps sending heartbeats, but the response is invalid.
2021-02-06
  • SHT30 problem solved and can be read normally
  • The Tuya module cannot be initialized due to MCU serial port interference. After the MCU code is cleared, the assistant can be used to debug. Data can be reported using the MCU, but the network cannot be configured.
2021-02-07
  • The reception was interrupted and I forgot to remove the debugging code. The network distribution problem was solved and the project was basically completed.
2021-02-11
  • Added time display and online proofreading time
2021-02-13
  • Added a timer to check the time every ten minutes
  • Optimized OLED display layout
  • Added battery voltage display. The cover picture forgot to multiply the voltage by voltage. The actual program has been changed.
  • Optimize the configuration of DMA and ADC to achieve the fastest update speed, and configure ADC to 12bit
  • Add infrared sensor and automatically switch the screen when your hand brushes it
  • Add a watchdog to prevent the program from getting stuck

Project summary

At present, the code has completed reporting the temperature, humidity, and brightness information. Because there is no lithium battery for the time being, there is no battery information to report. The interface and location have been reserved, and the lithium battery can be reported directly. The OLED library encapsulates some functions. Currently, the values ​​of each sensor are displayed. Users can directly modify the format they want in while(1). An additional set of IIC and serial ports are introduced, which can add other things and facilitate debugging.However, the infrared sensor is a bit insufficient, because the ADC and DMA acquisition and channel switching take too long, so the ADC data refreshes every 0.5 seconds, which does not matter for the photosensitive, but it takes a little longer for the infrared sensor.(There were some configuration problems, which have been overcome). This is my first time making a board and doing a project. I have tried my best. The qaq code is written using STM32Cube IDE. Just open .project. Display time_Kantuwang.jpgCover image V4.0.jpgQQ picture 20210207104808.jpgQQ picture 20210207104725.jpg

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-23 11:16:47
  • Infrared reading digital tube display example
  • Good book recommendation! A brief review of Luo's "Basics of Power Supply Design"
  • It’s late at night, how are you doing?
  • PXA310 VS 6410 VS IMX.31
  • Please give me some advice, is this an amplifier impedance issue?
  • Tracking AG-5101A

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号