太白金星

[Tuya Smart] SmartHome Environmental Monitoring System

 
Overview

       I am very happy to participate in this event. This is also my first time to participate in Lichuang EDA activities. I have been studying 32 for a while, but I always struggle with the ability to draw the board and the purchase of components and it is difficult to achieve the design I need. , but luckily I met Lichuang during this winter vacation. Lichuang EDA solved the problems I was worried about. It not only provided a convenient PCB drawing platform, but also provided a wide range of components in the mall for purchase. (referring to free prostitution), so that we poor student parties can easily realize a fully designed dream.


Project function description:
1. Use APM32F030C8T6 as the microcontroller and MDK5+HAL library as the development platform

2. Use Tuya smart module WB3S to connect to Tuya platform, and the APP adopts custom template configuration

3. Use SHT30 as the temperature and humidity sensor to sample the temperature and humidity.

4. OLED serves as a display screen to display the current ambient temperature and humidity.

5. Use 555 timer circuit to output infrared carrier wave to control air conditioners and other home appliances.

6. Use the photoresistor to detect the ambient light intensity to adjust the brightness of the OLED.

7. Use a relay to drive the USB port to control external USB devices

 

Design ideas:

       I am also a circuit geek, and I planned to follow the tutorials from the beginning. Therefore, most of the circuit references are based on the development-free solution and the circuits used on the punctual atomic development board. I still need to learn from everyone in many places, and there are no problems. I hope you guys can help point it out.

 

Schematic analysis:

 

The power circuit refers to the development-free solution. I thought that the driver power consumption was not enough, but after a simple calculation, although there is a relay, because it only needs to control some small USB power-consuming devices such as desk lamps, the power consumption is generally around 200mA. Tuya WIFI module The power consumption is also 324mA, and the power consumption of other circuits is very small, so the overall power consumption does not exceed 1A.

 

The MCU uses APM32030C8T6. I originally planned to use STM32, but the price is too high, especially during the Chinese New Year period when it is out of stock. In addition, with the rise of domestic 32-bit microcontrollers, I used an APM32 microcontroller that is pin-compatible with STM32, and the price is also very high. Cheap, supports domestic production!

 

The temperature and humidity sensor uses an SHT30 module, and the module is in a QFN-8 package. Thanks to a certain heating table recommended by a friend in the group, the successful welding was achieved.

 

r6gtRY1iAQE1JNKZfOKjC9ByyBpcgBVbiynkLNDy.png

The relay circuit uses a 5V relay module, which can realize most 5V powered USB drives.

nOiqfpEYWKvluBOD131r44FwlWuHqqKplsbFcZAM.png

The infrared control circuit uses NE555 with a potentiometer to output a 38khz carrier wave. The carrier wave adjustment and infrared decoding are sampled and observed through the SignalTap function of the FPGA.

HhpkfHyXiT2y94KrZqo6i3KvqPISM7L6KhurB0j2.png

After finishing the board, I discovered that the Tuya module has infrared control and learning functions, and I plan to try it next time.

Lis33eajK8PIHnvM1xPkuvJ5tiwBLdzruPapPqEr.png

The photosensitive sensor circuit is implemented by connecting a photosensitive transistor and a 47k resistor in series. When there is light, the transistor is turned on and generates a collector current. We only need to obtain the corresponding voltage value through the ADC pin.

 

The 3D preview is as follows:

uUCPgDCHoBDMgvWjUgeHrFQX9IV34v9pSdRtKHQs.png

 

In addition, I painted two acrylic shells, which made it look much more beautiful instantly. As expected, people rely on clothes and horses rely on saddles.

7bCt6nlsSy4Ne0Xllpd3plh52ZeqVZcwgaDh2Z78.png

 

As expected, the car overturned, and I could only cut the board + flying wires. I didn't pay much attention to the drawing board for the first time. One was because the infrared emission pin was not connected to the microcontroller pin, and the other was because the relay power supply was connected to 3.3V. Cannot drive 5V relay.

 

The final picture of the completed welding is as follows:

 

 

Tuya APP function configuration:

uXaZJ1jz22bnb2TIKf8t6hIlrcjysuSDuzWjO7pV.png

Since there are many functions, the APP uses custom templates

 

Instructions:

       Connect the external power supply and control the access mode of the Tuya WiFi module through the indicator lights and buttons. After connecting to the WIFI, the environmental parameters will be reported to the APP. Users can use the parameters on the APP

Settings to set alarm parameters. If the environmental parameters reach the alarm value and the alarm module changes, the user can use the alarm parameters to turn on and off home appliances and USB devices. The user can also press the WK_UP button.

keys to control the device to enter and exit standby mode.

 

Physical display:

       see attached

 

Summarize:

      After experiencing this event, it was not too long because there was a Spring Festival in between, but I truly experienced the joy of being a maker. From the beginning, drawing boards, welding, program programming, and module debugging were all done at the same time. Everyone in the group came together. Among them, the most grateful ones are the engineers of Lichuang and the study committee members in the group. I would like to thank them for their help and confusion. Finally, I am also very grateful to Lichuang and the Tuya platform for providing components and technical support. , I hope that the platform will get better and better. At the same time, I would like to wish everyone a happy old age. I wish everyone who participated in the event will become more and more sophisticated in technology and have more hair in the new year (laughs)!

 

 

 

 

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-22 15:40:16

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号