Note: This version is not recommended to be packaged into a smart socket. Since the space at the bottom of the PCB is extremely small, it is only suitable for welding some chip resistors and capacitors or some lower-height chips. The bottom of this version uses an STM32 chip with an 8M patch. Chip crystal oscillator, so it cannot be installed when it is installed into the socket shell, so version one is suitable for use as a microcontroller board, and then version two was launched (of course, this is not absolute, if you really don’t know how to directly develop ESP8266 , it is recommended that you draw a 3D shell yourself, and then 3D print it for installation and use. The effect of using version one is the same!) (The link for version two is as follows: https://oshwhub.com/414048A/xun-lian-ying_-jin- jie-ban-li-chuangeda-shu-ji-xun-lian-ying-ban-ben-er )
The following is a physical demonstration: 3D renderings of the project /////////////////////************************ *The following are the notes and instructions************************ ![RV}07[]8R~)U%RYP1V3Q[SM.png] 220V purchased online Convert to 5V small size/low power consumption AC-DC regulated isolated power supply module. Of course, it is more recommended to use Lichuang Mall, because the quality is more guaranteed (I bought a sample, it only costs 0.1 yuan) The following link :https://item.taobao.com/item.htm?spm=a1z09.2.0.0.30452e8d4SPe3Z&id=622061165535&_u=c3ucg7ggff41 ![AW~G56_{)UGR4(RZG8X)@Z%4W4EZBSD[%72WDP.png] Purchase online Shell kit, after debugging, you can directly install it using the following link: https://item.taobao.com/item.htm?spm=a1z09.2.0.0.30452e8d4SPe3Z&id=527479647754&_u=c3ucg7ggc78f (They have many other shells of this type. Type, you can choose a cheaper and more suitable one. The one I bought is 8 yuan for a complete set, and the starting price is 5 sets. "We are studying! Of course, the cheaper ones are better")
Then purchase the corresponding components at Lichuang EDA based on the BOM table (as known from the BOM table) Note: Since I still have remaining relays, I drew the package myself. My own relays are from Songle (remember, as long as Possibly small size): Note on welding debugging: (The following are just suggestions, suggestions, suggestions. Please follow the following order, based on your own situation. Here are just some suggestions for friends who have never done strong current work) (If you are from the CH340 plate To start, please solder the socket first, then solder CH340G, and then others, leaving enough space for the chips to be soldered later) 1. Insure first, then (D1, U6, ESP8266, POWER, R7); 2. 220V to 5V power supply module; 3. Solder the 220V interface U9; 4. At this time, please take a multimeter, wear insulating gloves, plug the socket into the plug-in board, adjust the multimeter to AC 400V, measure the AC-AC two pads on the 220V to 5V module, use the multimeter Adjust the DC range to 40V and measure whether the voltages of the "+" and "-" pads on the output terminals of the 220V to 5V module are normal. If normal, unplug the plug and cut off the power and solder the "+" and "-" pads of the module. The disk is short-circuited and "discharges" for 1 second; (Tip: When welding U9, the length of the insulated wire should be about 5cm, not too long, just household wires) 5. Weld the polar capacitor "electrolytic capacitor", 1117 module circuit, as well as the USB to TTL circuit; 6. Test whether each point is normal. If not, please check whether there is a weak solder, missing solder or short circuit, etc.; 7. If everything is normal, please continue to solder. The whole process follows the instructions given by Low Yuan According to the principle of welding from component to high component, follow the principle of power first and then signal, please treat it carefully; 8. Please weld a 4P header at the position of the OLED screen for OLED screen plug-in; 9. Please clean your hands before welding. Maintain personal hygiene, wear anti-static bracelets, goggles, and smokers (if available), do not touch the IC directly with your hands, and do not weld each solder joint for more than 10 seconds, etc.); 10. During debugging: (1) Do not connect to the power supply 220V, please note that the debugging pins SWDIO and SWCLK should not be connected in reverse, and VCC and GND should not be connected in reverse. If the program cannot be recognized when downloading with KEIL5, the power supply may be insufficient. Please be careful not to touch the components directly with your hands. . 11. If you directly use the 32 downloader ST-Link for debugging, it is recommended to only connect GND, SWCLK, and SWDIO to P1, and then plug in a data cable to connect it to the computer (because the relay is powered by 5V, if it is powered directly by 3.3V, The relay will not work, which may affect the debugging effect, and it is more stable.) As shown in the picture: The left side is plugged in with the data cable for separate power supply, and the right side is for ST-LINK3.3V power supply. Remember that ST-LINK must connect GND to the "common ground" ” 12. When welding the two-color plug-in LED lamp, the LED lamp pins must be improved, as shown below ![AK3]Y6}[@CW5G1X@WP[8P@B.png]
PCB design precautions (the following matters are mainly for those who want to modify the PCB): 1. Do not route wires under the capacitors, resistors are OK (because the space in version 1 is too small, the author ignores this point, but then Version 2 is designed, link to version 2:); 2. The wiring should be horizontal, vertical, and horizontal. It is recommended that the shortest wiring is the best; 3. According to the requirements of the electronic technology project of the World Skills Competition: (1) The soldering pad should go out of the signal line or it should be a straight line. Or directly use the diagonal lines. The red box in the picture below indicates the correct wiring, and the basket indicates the wrong wiring (designers should keep this in mind) (2) The power supply of the IC must first pass through the filter capacitor of the IC and then flow into the IC chip. It is dedicated to IC. The filter capacitor should be as close as possible to the IC pin (as shown in the figure below, the four yellow rectangular boxes are filter capacitors, the purple arrow is the direction in which the power flows into the IC, and the 3.3V power supply has been marked as a white trace) (3) The power supply passes through the IC filter capacitor After entering the IC pin, do not lead it out to the next level device (4) The shorter the signal line, the better (5) The positioning hole design is reasonable (6) The size and direction of the silk screen, no silk screen coverage, clutter (7) Components Arrange them in reasonable groups (8) The narrowest part of the GND paving should not be less than 0.254mm (9) The board should be "equal to the ground" (10) The fewer the number of vias, the better (too many vias will result in a certain fee from the board manufacturer) (additional charges) etc....... ![0]3JD0( A@FPBXK4RB6KGYT.png] 4. High-voltage and high-current lines must be kept at a certain distance from signal lines. It is best to isolate or layer them For example, wiring: relay circuit (the purple box in the picture is the isolation area, two wide high-voltage lines are routed in layers and there is a certain safe distance between them and the signal lines) below is the 3D rendering, ![1]9FVA2 } ] As shown by the blue arrow in the figure (C28 and C22 are the filter capacitors next to the VCC output after converting 220V to 5V) ![9X)V3 [A@X.png] Installation and operation: Since the PCB board space is limited, the friends also need Make a small change, as shown below, otherwise your two electrolytic capacitors will get stuck on your buttons and they won’t be able to be pressed. After doing all this, you can fix the screws and use it! ! ! Of course, you have to debug the program! ! ! right! There is also the operation of the networking part. Our microcontroller version sends the corresponding AT commands to the ESP8266 through the serial port of the microcontroller for operation, so below I will give the relevant commands for my networking use, and send them to the ESP8266 in order to connect to the server. (1) The first part is to connect to the server. It is recommended to edit it before use, and then write the program or debug through the serial port debugging assistant using AT+RST AT+RESTORE AT+CWMODE=1 AT+CIPSNTPCFG=1,8,"ntp1. aliyun.com" AT+CWJAP="Your own WIFI name (English recommended)","Your own WIFI password (more than 8 characters)" (AT+CWLAP queries the attachment router) (AT+CIFSR queries the route on the connection) For example: AT+CWJAP="HUAWEI MATE 30","88888888" AT+MQTTUSERCFG=0,1,"NULL","e4ufDyw********************** **********WmQ","3A3EF02C**************************************** ********A3B6E18EE",0,0,"" Note: ("=" corresponds to a total of 8 data following it (each data is separated by ","), as follows: 0, 1, "NULL ", "Username", "Password", 0, 0, "" format) ("Username" and "Password" are encrypted through the triplet of your device on the Alibaba Cloud server. The specific usage method is as follows) 4. Upload your switch information or other microcontroller data information (the author has been struggling with this step for four days. For four days, he has not found a solution. Finally, in (Fu Jieli Maker Editor: 503317A) friend With some guidance, I finally solved this problem, thanks to my friend) AT+MQTTPUB=0,"/sys/a17a************mQ/e4uf************U7I3/ thing/event/property/post","{"method":"thing.service.property.set","id":"1834390959","params":{"PowerSwitch":1},"version":" 1.0.0"}",1,0 Note: (There are 5 data after "=" (each data is separated by " , "). The data is modified according to the data information sent by the server. The first Do not modify the data and the last two data. In the second data, replace the second "/" with the first "." of your own connection domain name."The content in front of it, the third "/the content after it is your own "Username") (Remember in the third data, "PowerSwitch" should be replaced with your own definition of the switch button. Since the data is in JSON format, so Add a "" symbol before commas and double quotes. Friends who don't know much about this data can first use the data I gave above to operate and experience it.)
Mobile phone screen
Since the author recently participated in the "First Vocational Skills Competition of the People's Republic of China - Municipal Selection Competition" and "Sensor Network 1+X Training Training", the whole day was training + assembly and debugging, and I was exhausted every day. I went back to the dormitory at 10 o'clock. I was exhausted, so the program update was too slow. I'm really sorry. I hope my friends can understand. I will eventually give a very detailed tutorial, and I will also open source the finished product. I hope everyone can understand it, thank you! Sorry for the slow update! Version 1 is updated here first, and then I will also update version 2!
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