MartinFowler

[Training Camp_Advanced Class] Alibaba Cloud Smart Socket

 
Overview

Product physical

WeChat picture_20200818155748.jpg

Design principle selection

1. 220V design: The front-end input uses safety capacitors to filter the power supply and filter common mode and differential mode interference respectively, which can effectively improve EMC. 2. The common mode inductor suppresses the common mode signal, and the varistor plays an overvoltage protection role to prevent lightning strikes. 3. ACDC module (mainly simple and convenient) rear-end 5V output: 4. TVS overvoltage protection to prevent burning of the subsequent circuit, 5. Electrolytic capacitor filtering, voltage stabilization to prevent voltage fluctuations. 6. The STC main control is simple and easy to use, and is suitable for beginners. 7. EMW3080 has mature AT firmware, which can effectively shorten the development cycle. 8. AMS1117 has sufficient output current, is cheap, and has simple circuit design. 9. ME6215C33M5G has an enable control pin to facilitate MCU download and reset. 10. SN74LVC1G04DBVR inverter facilitates power-on initialization. The default output of MCU IO is high, causing the relay to open. 11. NUD3124LT1G improves the output capability to effectively drive the relay. 12. CH340C has a built-in crystal oscillator, which is cheaper and has a simple circuit design.

working status

1. When powered on, the rightmost red LED lights up by default, indicating that the MCU is powered. LED2 flashes green to indicate that the WIFI module is connecting to the cloud. LED3 small blue light flashes to indicate that WIFI is waiting for network distribution. LED4 small light lights up and goes out. Indicates the on and off status of the relay. 2. Cloud Smart APP displays the current temperature

Operation guide

1. Connect the jumper cap according to the instructions on the board to switch the working states of MCU download, WIFI firmware update, and WIFI and MCU communication. 2. The RST_MCU and RST_WIFI buttons are used to reset during downloading. After the entire download is completed, the MCU is reset to facilitate synchronization of MCU and WIFI work. 3. Long press the Clear Distribution Network button to clear the AP information connected to WIFI for network reconfiguration. Short press the button to switch the status of the relay and report the temperature data. 4. The relay switch can be remotely controlled through Tmall Genie voice or mobile APP. WeChat picture_20200818155943.jpg

At present, the basic functions of the test version have been implemented, and the mobile phone and Tmall Genie have been able to control the socket switch and report the temperature and over-temperature warning. The 220v to 5v conversion has been successfully debugged and can be used directly as a power supply. Overall, some minor changes have been made to the original sample. The CH340C can be conveniently used through jumpers, but the disadvantage is that debugging is a bit complicated.

Follow-up transplant operation guide

Subsequent proofing needs to be modified based on the shared source code. The specific steps are as follows: 1. Modify the engineering code as follows image.png 2. Open the Alibaba Cloud Living IoT platform https://iot.aliyun.com/products/livinglink to register yourself Account, image.png create your own project, image.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.png use the default panel to image.pngimage.pngimage.pngimage.pngimage.pngcomplete the above steps and basically realize the function. If you are still unclear, you can refer to Lichuang EDA Summer Course and solve it by yourself https://www.bilibili.com/video/BV1v54y1U7P3

3. If you are not using the Alibaba Cloud Feiyan version of the 3080 firmware, you can refer to it. The attachment can be burned by yourself. For specific burning steps, please refer to : https://www.mxchip.com/documents image.png

Problems encountered during debugging

Let me briefly introduce some minor issues during the debugging process: 1. The network distribution cloud panel setting used to default to one-click network distribution, but now the default is changed to ap network configuration, and you need to configure the network manually. (No wonder after half a day of testing, I could only scan the QR code to configure the network by sending the AT command for ap distribution network. I always thought there was a problem with the program.) 2. The relay did not respond at first. I used tweezers to manually pull down the control foot and found a slight sound. , and later found that the 3.3v connected when drawing did not work properly. 3. When testing the switch of the Tmall Elf relay, there was no response at first. I always thought that there was something wrong with the program part when I changed the AT sending serial port from UART2 to UART1. Later, through the use of LED lights for testing, it was found that the data was parsed, and it was discovered that the powerstate set in the cloud was different from the reference powerswitch shared by Song Gong. In the future, friends need to pay special attention to whether these similar parameters are consistent.

To summarize my experience:

When debugging, you need to do it part by part, whether it is software or hardware. It is convenient to find and solve problems in time, and it can also avoid burning the back-end load due to problems with some circuits. At the same time, before powering on the test, pay attention to using a multimeter to measure whether there is an obvious short circuit problem. In terms of software debugging skills, it is a good debugging method for MCU IO lighting and printf functions that cannot be simulated, and can accurately determine the program execution status.

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-22 09:34:28

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号