toothache

[Training Camp_Advanced Class] EMW3060+STC8G guide rail multi-way switch

 
Overview
Main circuit and selection
AC220V step down to DC5V1.3A:

Coupled with a self-restoring insurance to prevent short circuits caused by welding, etc., and an NTC resistor to prevent startup surge current, DK1203 does not require auxiliary windings. The transformer has dual windings, which is simple and reliable. 431 and two precision low-temperature drift resistors obtain a 5V output. (In batches, 3.9V voltage regulator tubes should be used, eliminating the need for 431 and a few peripherals; 5V should be used for relays)

DC5V-DC3.3V1.2A:

LP6498AB6F, 600KHz, 4.5~30V wide input, outputs 0.8~12V voltage through resistor feedback, and with a 22uH 1040 inductor, it can be loaded. Enable the added switch to reset the main control and WIFI module after power off.

WIFI module:

The EMW3060 module has built-in ILOP-A232 firmware and has high industrial-grade reliability. No need to burn, no BOOT is triggered. Unused pins should be left unconnected as required by the manual. Compared with EMW3080V2, this module cannot be developed twice, but it is cheap and the cost saved can be used in a single-chip microcomputer to achieve a combination of cost and simplicity.

USB-TTL:

TYPE-C interface, CH340C chip, simple peripherals, 3-wire serial port for downloading programs and debugging. No welding required, external three-wire serial port debugging is required.

Main control:

The main control adopts STC's new product STC8G1K17-38I-TSSOP20, which has a wide power supply voltage and a built-in IRC. The general frequency value can be adjusted to less than ±0.3%. When powered on, other pins except the serial port are high impedance to prevent malfunction.

temperature:

LM75AD temperature sensor, IIC interface, with temperature alarm;

Output:

Three-way relay switch normally open and normally closed output, with indicator light.

shell:

http://www.shell-mould.com/view.asp?id=220


--------------------------------2020/08/10------------- -------------------------------------------------- -------------------

I had the transformer wound today
EE16 2+2

    Open an air gap around the primary Around the elementary level.jpg     and secondary     , and finally measure the 1Khz inductance and 10Khz leakage inductance     for the final product.   Around the secondary.jpgGrinding air gap.jpgPrimary inductor.jpgLeakage inductance.jpgFinished product.png


--------------------------------2020/08/11------------- -------------------------------------------------- -------------------

The board has arrived

Comparing the BOM and silk screen, there are some materials in the welding part.BOM table and bit number.jpgPartial welding.jpg


--------------------------------2020/08/12------------- -------------------------------------------------- -------------------

Welded out the hardware last night
partial error

The internal resistance of the 1mH inductor is too large and the rated current is too small. As a result, the front of the inductor is 5V and the back of the inductor is about 4V (0.2A load). The short circuit needs to be solved by removing the wires and rewinding. Grinding the air gap on the transformer doesn't work, just replace the core paper and open the air gap.

5V power supply test (the voltages in this article were measured by a multimeter purchased at Lichuang Mall at your own expense)

During the test phase, light bulbs are connected in series. If possible, an isolation transformer, autotransformer, or oscilloscope can be used to make the measurement more accurate and safer. No-load 5.01V, 1.3A loaded, 4.96V, load regulation rate 1.01%, loaded for a period of time, Basically not hot (can touch it) 5V1.3A with load.jpg

3.3V power supply test

No-load 3.285V, chip rated 1.2A, loaded 3.244V, load regulation rate 1.26%, light touch switch enable has effect 3.3V1.2A loaded.jpg

The power supply is normal and everything is welded. It can be seen that the space utilization rate is not high. . Heat dissipation is basically no problem.

Previous PCBA diagram PCBA.jpg

Install the case to test the USB-TTL circuit

Double-head typec, the mobile phone recognizes CH340C, and the hardware is successful. Finished product.jpgserial port.jpg


hardware test

Relay testing

! I wrote a test program but nothing happened. . Check the code. The port is powered to high impedance and configured as push-pull. The test is successful. image.png

Key test

! After configuring it as open drain and configuring an internal pull-up, the port appears to be floating. After reading the manual carefully, I found that it must be pulled up externally and configured to be quasi-bidirectional. The test was successful. image.png

LM75A test

The IIC pin is configured as quasi-bidirectional, the internal 4.1K pull-up is enabled, and the hardware IIC has no problem with timing and data, and no problem with data conversion. But the temperature returned is a temperature of .37.87 with a resolution of 0.5 degrees. I once wondered how the resolution of 0.125 degrees and the accuracy of ±0.5 degrees were done .


--------------------------------2020/08/14------------- -------------------------------------------------- -------------------

The program was written until 2 o'clock in the morning. The hardware can be operated independently, but there are a lot of bugs when splicing it together. The company held a team building in Fenghuang Ancient City on 14-16. I didn't bring my computer, so the program is probably out of date.


--------------------------------2020/08/17------------- -------------------------------------------------- -------------------

When I came back last night, I wrote from 19 to 2 a.m., and I was able to achieve basic operations: reporting the temperature to the cloud every minute, and controlling the three-way relay switch with my mobile phone.

! The serial port sending crashed. Finally, it was found that the serial port interrupt needed to be turned off when the serial port was sending. The interrupt conflicted with the query.


I wrote the configuration network at night and controlled it with the cloud public version APP, but failed to connect to Tmall Elf (the identifier did not use the socket routine)

Optimized the serial port reception and transmission. Previously, the reception would fail to receive the instructions issued by the cloud. Now it can be received as long as there are no multiple operations within 1 second. The triplet is still burned in by default (it is not transferred and burned through the serial port).


APP

APP page.jpg


Code compilation of the final demonstration video. image.png The 2G clip of the video was compressed to more than 100 MB, but it still could not be uploaded. I uploaded it to Station B https://www.bilibili.com/video/BV1Mk4y127Qt/



参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-24 14:32:24

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号