BCtyN0wD7y

86 type five-hole metering socket 10A

 
Overview

86-type five-hole metering socket 10A
In response to the comments, the mature intelligent socket metering circuit is integrated into the 86-type concealed socket. Use the 86-type national standard five-hole socket shell, which can fit perfectly. And it has the following features: magnetic latching relay, energy metering, stable counting, OTA firmware upgrade.
 
 
Disclaimer:
This socket uses 220V AC power. There may be risks of electric shock, high temperature burns, etc. that may cause injury, disability, and death during DIY and use. Please operate in strict accordance with safety regulations and take adequate protection. Minors should operate with the assistance of their guardians. Using this solution means that you have sufficient knowledge of safety risks. Please make sure that you have sufficient knowledge reserves before operating. Any losses and consequences caused are at your own risk, and I do not bear any legal responsibility.
 
I am a software enthusiast, not an electronic hardware major. Therefore, I may not know a lot of basic hardware knowledge. If there is anything wrong with the circuit diagram, I hope you will give me some advice and thank you.
 
 
Hardware description:
1. This project actually requires two boards, namely the socket body (PCB thickness 1.2mm) and the MCU plug-in module (PCB thickness 1mm). 2. The power metering chip uses BL0942, which has the advantage of not requiring calibration and slightly more metering functions.
3. No isolated power supply is used, and the 220V AC L line is directly connected to GND, so the entire PCB is charged with strong electricity. During debugging, it must be plugged into the plug board with the shell for testing. Please cherish your life.
4. The key resistor accuracy needs to be 1%, pay attention to the BOM table. 390kΩ accuracy ±1%, 510Ω accuracy ±1%
5. If the manufacturer prompts during the PCB boarding process: the middle milling slot connection position is too small, the board will break, etc., please reply: I have been fully aware of and can accept the risks brought by this reason, please produce directly according to the Gerber file, thank you!
 
 
Software description:
1. The compilation environment is VScode+PlatformIO2. Using the open source MQTT solution, you can get a cloud server with unlimited device quantity and service life without spending a penny.
3. In actual use, it is found that although public and free MQTT servers can be used, the delay is relatively large. If the real-time requirements are relatively high, it is recommended to build a MQTT server on a cloud server or router (EMQX software is recommended, which is free and powerful).
4. The mobile phone uses the IoT MQTT Panel_0.45.18_Apkpure.apk in the attachment. The interface of this APP is OK, it is also convenient to use, and it also fully supports JSON, but it has advertisements. (If you have a more suitable mobile APP, please leave a message in the comment area)
 
 
The main functions of the software:
1. Support web page network configuration 2. Support WeChat QR code scanning network configuration (not recommended, not 100% successful) 3. Support network automatic time synchronization NTP 4. Support MQTT, which helps to understand the working mechanism of the Internet of Things more thoroughly. Use the switch, countdown timer, timer, etc. on the MQTT mobile phone APP to turn on or off the socket.
5. The timer program is implemented locally on the socket, not in the cloud. As long as the parameters are submitted and saved, even if the network is disconnected later, the socket can still be turned on or off regularly. Therefore, it is possible to physically restart the optical modem or router with this socket. 6. Support OTA online firmware upgrade, you can upgrade the firmware through the network. No need to painfully remove the board and re-flash the firmware. 7. Support LittleFS file system, various parameters can be saved when the power is off. Even if the socket is powered off and restarted, the original parameters are still there.
8. Support power metering, can display real-time voltage V/current mA/power W, and total power consumption kWh, and can also display the grid frequency (50Hz or 60Hz).
9. Web network configuration page, support uploading firmware and file system through the web. Used for firmware flashing brick recovery. 10. Support HomeAssistant MQTT automatic discovery, MQTT integration can be used for convenient control.
 
 
Related component sources:
1. Socket shell (including various springs, screws, copper pillars, etc.) -> Buy more than 2 at a time on Alibaba for cheaper.
2. AC220V TO DC5V switching power supply module I have bought all the links on the right (note: buy the 5V with pins) -> Link 1 Link 2 Link 3
4. ESP-12S module You can buy ESP12E/F/S, all three models are compatible. F is the cheapest and I often buy it -> Buy this, less than 5 yuan and free shipping.
5. Magnetic latching relay (note: buy FH44L-1AT-L1-DC5V (5V4-pin single coil)) -> Buy link
6. Magnetic latching relay driver chip CN8023B (note to buy SOT-23, 6-pin) -> Buy link
7. Electricity metering chip BL0942 (note to buy SSOP10, 10-pin) -> Buy link   
8. 6×6 touch switch height 21mm -> Buy link, note to buy 21mm.
9. Apart from these, I basically bought other components (including resistors, capacitors, AMS1117, light-emitting diodes LED, etc.) at Youxin Electronics -> Youxin Electronics Taobao Store. Later, I found that there is also a company called Jixin Electronics. Whether it is product introduction, internal and external packaging, label printing, or free shipping amount, they are very similar to Youxin, but the prices are different. You can compare the two when purchasing components.
10.ESP8266 development test stand/burner (only needed by beginners), I bought this one-> Purchase link
 
 
Software and hardware installation steps:
1. First flash the firmware for ESP12S, reference: https://oshwhub.com/article/ci-bao-chi-WIFIzhi-neng-cha-zuo-ruan-jian-gong-cheng-dao-ru-VSCODE-yi-ji-bian-yi-shuo-ming 
2. Set the MQTT parameters for ESP12S network configuration, reference: https://oshwhub.com/article/ci-bao-chi-WIFIzhi-neng-cha-zuo-ruan-jian-diao-shi-shuo-ming
3. Install the MQTT APP on your mobile phone and set the MQTT server parameters. Tutorial: https://oshwhub.com/article/xin-guo-biao-wu-kong-ji-liang-cha-zuo-10A-pei-tao-shou-ji-APPan-zhuang-ji-she-zhi-shuo-ming
4. Solder the ESP12S with the firmware flashed to the PCB
5. Solder the main PCB
When soldering the copper contact piece, the contact piece opening should face the direction of the arrow.
 
6. Various angles of soldering
Front view
 
Back view
 
7. Install the shell
 
 
8. Power on and debug
(wall crack suggestion: ******Don't debug directly on the wall******)
First install the plug line and debug on the socket. Wait until the debugging function is completely normal, then install it on the wall.
(Software and hardware installation completed)
 
 
 
OTA steps:
1. Compile the firmware in VSCODE2 . Upload the compiled firmware to an HTTP address, which can be a website or your local router. The address is similar to: http://xxxx/data/esp12s.binAfter uploading, be sure to open the browser to test it to see if this firmware address can be downloaded normally.
3. Set up the OTA firmware link in the WEB configuration network, which is the URL similar to: http://xxxx/data/esp12s.bin4. Click Upgrade Firmware in the mobile phone APP During OTA upgrade, the LED will flash quickly with the download progress. It will automatically restart after the upgrade is successful.
 
 
Hardware Update Notes:
2023/7/17
1. Hardware Release (Socket Main Body PCB V0.3, Direct Plug-in Module Minimum System Full Lead V0.1)
 
 
Software Update Notes:
2023/7/17
1. Software Release: BL0942 (2023/7/17 12:10)
 
 
Acknowledgements:
Thanks to Jiali Chuang yyds, who has to make PCB boards for me every month.
Thanks to: @star19997 @wivin @NoneZK @czwyg @shayulei @21568P @squarer @ynf88 @nihaome @amenuo @xywl98 @unanxtg @shjdxhkxn @liang_work @jeromeli @tjdxryx and other big guys who left comments in the comment area. Because of your opinions and suggestions, I got a lot of inspiration and learned more knowledge.
Thank you very much!
 
 
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-19 23:29:19

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号