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.
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
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.
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.
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
2. Open the Alibaba Cloud Living IoT platform https://iot.aliyun.com/products/livinglink to register yourself Account,
create your own project,
use the default panel to
complete 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
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.
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.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet