containsmachine

2021 National Competition H Question Electrical Appliance Identification Device

 
Overview
### Video link The video is too large and cannot be uploaded directly. The video in the attachment has low definition. Here is the high-definition video link: [https://www.bilibili.com/video/BV1eq4y1q7XU?share_source=copy_web](https ://www.bilibili.com/video/BV1eq4y1q7XU?share_source=copy_web) ### Project Introduction This project was done by our team during the 2021 National Competition. Question H used an electrical measuring device to commemorate the first time our team , is also the last time to compete in e-sports, and now it is open source and shared. ### Introduction to the topic requirements and project functions![~1EA`87WALX9HK5T_9EX2V.png] ![3`J6)_S8H@U8L}TO%CE9I.png]

This system takes the STM32 microcontroller as the core and realizes the function of analyzing and identifying electrical appliances. , with two functions: learning and analysis and recognition. In the learning mode, the characteristic parameters used to identify each single electrical appliance can be tested and stored; in the analysis and recognition mode, the category of the electrical appliance in use can be indicated in real time. This system uses the transformer as the monitoring center, uses ADS8688 to achieve digital-to-analog conversion, and uses STM32 as the control center to perform logical operations to process data, thereby realizing electrical appliance analysis and monitoring.




When there are electrical appliances working in the circuit, the current transformer generates mutual inductance voltage, and the amplified analog signal is transferred to the microcontroller for processing, and the final result is displayed on the display screen.



The test results show that the circuit design of this system is clear and the human-computer interaction interface is friendly, and it basically meets the basic and performance requirements of the question .

![image.png] - - -This question requires the design and production of a device that analyzes the category of electrical appliances in use based on the electrical parameter information of the power line current. The device has two working modes: learning and analysis and recognition. In the learning mode, the characteristic parameters used to identify each single electrical appliance are tested and stored; in the analysis and recognition mode, the category of the electrical appliance in use is indicated in real time. The key points and difficulties are as follows: (1) Real-time reading and storage of relevant electrical parameters flowing through the circuit. (2) How to design the fluctuation range of the read parameters when the mains power is unstable. (3) How to effectively identify some electrical appliances with the same characteristics. (4) Combination identification. ### Circuit explains

the design of synchronous sampling circuit

After the 220V mains power is stepped down by the transformer, the subsequent stage is connected to a zero-crossing comparator designed using TLV3501 . The output level changes at the zero-crossing point of the voltage signal and is sent to the STM32 IO port. The rising edge is used as the starting point for current signal sampling. In order to meet the conditions for sending the signal to the IO port, it must be less than 3.3Vpp and greater than 0V , so the peak-to-peak value of the rectangular wave of the output comparison must be controlled between 0~3.3V . After actual measurement, after replacing different types of comparators, it was determined to use the high-speed zero-crossing comparator TLV3501 . The rising edge rising time is at the ns level, and the microcontroller capture effect is the best.  Design of current detection circuit for power frequency current transformer The variation range of the grid-side current for current detection is 5mA~10A. Use the DL-CT1010A series current transformer. If the input is 10A, the output will be 10mA. It has high input range, low noise sensitivity, good linearity, and adjustable output range. Large enough to meet the requirements.  Amplified voltage test design In order to amplify the weak voltage to a suitable amplitude for microcontroller acquisition and suppress common-mode interference as much as possible, AD620 is used to make a differential amplifier. The essence of a differential amplifier is a subtractor, which can effectively amplify AC signals and effectively reduce zero-point drift caused by power supply fluctuations and changes in transistor temperature. If there is an interference signal, it will cause the same interference to the two input signals. Through the difference between the two, the effective output of the interference signal is zero, which achieves the purpose of resisting common mode interference. After the synchronous sampling circuit obtains a voltage of 16Vpp from the mains 220V through a transformer, it first passes through the attenuation circuit to attenuate the signal to 4Vpp, and then inputs it into the comparator to generate a 2.6Vpp rectangular wave whose phase does not change with the input amplitude, and then inputs it into STM32 The IO port of the microcontroller can capture the rising edge to obtain the reference phase information. The actual circuit is shown in the figure. Attenuation circuit schematic diagram ! [image.png] TLV3501 comparator circuit schematic diagram The current detection circuit is connected in series with a power frequency current transformer on the live wire of the plug strip. The current transformer has a current conversion ratio of 1:1000, and its two ends are connected in parallel with 150Ω. The sampling resistor has a current of 5mA~10A and converts the current into a voltage corresponding to 0.15 times. In order to amplify the weak voltage to a suitable amplitude for microcontroller collection and suppress common mode interference as much as possible, an amplification factor of 5 times is used. The differential amplifier AD620 has an output voltage range of 3.75mV~7.5V. The first-order RC low-pass filtering at the input end of the amplifier retains 50Hz and its fifth harmonic while filtering out high-frequency components. The AD sampling circuit chooses 16  -bit, 8  -channel ADS8688 , with a sampling rate of 500Ksps , an input range of ±10V , a fast conversion speed, and good accuracy, which can meet the design requirements.

image.png





Because the input impedance of the 16-bit ADS8688 is very large, there is no need for impedance matching after amplification. The chip power supply is selected ±10V considering the size of the output value. The actual circuit is shown in the figure. ![image.png] Differential amplifier circuit schematic ![image.png] ADS8688 module circuit schematic - - - ### Software```` C code link: [https://github.com/2513822054/21- H-](https://github.com/2513822054/21-H-) The following attachment project also has code FFT operation to use the grid-side current direct measurement signal as a characteristic parameter, and use the linear least squares estimation method to obtain the downstream electrical appliances type and working status. The STM32F4 series development boards have DSP libraries and have high computing speed. Use the FFT coordinate algorithm in the time domain to find the phase and amplitude, and use formulas to find: voltage effective value, current effective value, active power, power factor, and apparent power. The frequency domain adopts the least bisection method. Suppose there is a signal s[n] that depends on the unknown parameter θ. Due to noise or model inaccuracy, the observed signal is an interfered signal, represented by observation data x[n]. The least squares estimate of θ is such that the observed data and assumptions The value of θ at which the squared error J(θ) between signals is minimum. Each column of the matrix H represents the full-cycle current waveform sampling value of an electrical appliance, and each row represents the current signals of all electrical appliances at a time. By substituting the time domain sampling value of the total current waveform on the grid side and the matrix H, it can be calculated, thereby obtaining the working status of each electrical appliance in the circuit. Finally, weighted summation is performed to calculate the total loss, and one or more combinations of categories among the seven categories with the lowest total loss value are selected. ``` ![8XS6"IJG2F(({GHY6SD.png] ### Picture circuit diagram (At that time, our power consumption had exceeded the requirements, so we simply used a large color screen to optimize the look and feel. This was also the only indicator among all the indicators that we did not At the place where we arrived, because we didn’t have a power chip with us during the competition, parameters such as power needed to be collected and calculated by ourselves. Parameters that other teams could get immediately would take us two days to come out. The circuit we made is very important for power supply. The requirements have become higher. Problems such as excessive ripple are not acceptable. After working hard for a long time, we still can't reduce the current to 15ma. But we made up for this regret through the free expansion part. I can only say that the electric competition is really good. It is not easy and requires a lot of personal accumulation and skills. I am very grateful to this competition for giving me the opportunity to grow.) ![09ED87ED10D801DA6C22CD6BC6810B97.png] ![IMG_8776.JPG] ![IMG_8777.JPG] Software schematic block diagram! [image.png] Test data! [image.png] Let me share with you the photos of our group’s competition ! [image.png] This is the first test (the retest went to Wuhan University, and the gatekeepers were very good) Strictly, we are participating in the prevention and control of the epidemic)! [image.png] I cut my hand when stripping the wire, and a good friend gave me a simple bandage in the laboratory! [6C475ACBDFB8D470B32D9421E11DCA9E.png] Teammate’s national award-winning women’s clothing flag # ## The demonstration video is too large and cannot be uploaded directly. The video in the attachment has low definition. Here is the high-definition video link: [https://www.bilibili.com/video/BV1eq4y1q7XU?share_source=copy_web](https: //www.bilibili.com/video/BV1eq4y1q7XU?share_source=copy_web) - - - ### Notes: You need to be very careful when welding the actual hardware circuit and selecting the decoupling capacitor (I did not mark any decoupling Capacitors and decoupling power supply boards, because they were made before, and there is nothing to learn from the schematic diagram that is all capacitors. It is also common sense for electronics people to provide capacitors next to the chip power supply)! Once the workmanship is not good and interference is introduced, it will As a result, the large-scale and small-scale tests cannot be carried out!!! The noise must be controlled at about 1mv to ensure that it can deal with random electrical appliances. After learning, large-scale and small-scale tests can be carried out. And we must pay attention to the layout of the circuit, 220v high-voltage power and other lines The distance must be controlled and anti-static!!! During the competition, my AD620 was broken down by static electricity (I checked it on Baidu). There was no major problem with its normal operation. Something happened as soon as I connected it and I replaced it with a new chip. That’ll be great.) To be honest, our plan was the most complicated compared to other groups’ plans due to lack of materials and other reasons, and it was not the optimal solution. We also worked all night to get it out. The open source is only for commemoration, because of the complexity of the algorithm, the importance of circuit anti-interference design, layout, etc. If you want to imitate, you need a solid foundation of software and hardware, and it is a type of getting twice the result with half the effort. - - -











参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-27 05:34:23

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号