张三叔

#the4thLichuangcompetition#Multifunctional power consumption analyzer

 
Overview

Note: * is required.

[Please fill in during the registration stage↓] * Brief introduction to the work: Currently there are few devices on the market for measuring low-power dynamic current. Professional current analyzers are generally used, but the price is very expensive. The multifunctional power consumption analyzer I designed and produced can measure the real-time current of the line using the current detection method of the access test. It can also measure the real-time voltage at both ends of the current equipment. Although the performance is not as good as that of professional current analyzers, it can meet the dynamic current measurement requirements of commonly used low-power products. This work can perform various functions such as instantaneous (current) power consumption analysis and average (current) power consumption analysis over a period of time on the current device, and provide a good human-computer interaction interface.

[Please fill in ↓ during the competition stage]   1. Details of the work; With the development of the Internet of Things, various low-power products emerge in endlessly, but measuring the power consumption of the products is a troublesome task. Currently, professional current analysis instruments with high precision, high dynamic range and high speed are used to analyze dynamic current on the market, but they are expensive and cannot be purchased. The multifunctional power consumption analyzer I designed converts the current signal into a voltage signal through an access-type current detection method. After a series of signal conditioning circuits and multiple high-speed AD sampling circuits, the MCU stores the sampled dynamic current data in the SD card in real time. At the same time, the size of the dynamic current can be displayed in a curve on the LCD screen of the work in real time. After the sampling is completed, the dynamic current data in the SD card can be read out and displayed on the screen in the form of a curve, and the average (current) power consumption in any time period can be calculated. The current sampling rate of this work is 200K, the real-time dynamic range can reach more than 120dB, and the dynamic current of 1uA-1A can be measured in real time, with a measurement error within +-5%.   2. Describe the challenges faced by the work and the problems it solves; 1. Problems solved: Cost and price issues. This is an issue that must be considered for any product. If the cost of designing a product is high, the price will naturally be expensive. In the professional field, more emphasis is placed on performance and perhaps less concern about cost. At present, there are more and more low-power products on the market, but the power consumption evaluation of the products has become a troublesome task. If measured with a multimeter, it is inaccurate. The multimeter can only measure steady current and cannot measure rapid changes and large dynamic range. of current. Or use a professional current analyzer, but such a high price prohibits many start-up companies. The total cost of a set of this multifunctional power consumption analyzer is about 400 yuan. The larger the number of electronic components, the cheaper it will be. It is expected to be reduced to less than 200 yuan through chip selection and optimization in the future. The performance can meet the dynamic operating current analysis of most low-power products, and it is cost-effective. 2. Challenges faced: All are technical problems. At present, the real-time sampling rate of this work is designed to be 200K, the dynamic range can reach more than 120dB, and the dynamic current between 1uA-1A can be measured. Compared with professional current analyzers, the sampling rate is too low. From the hardware level of this work, the sampling rate can be up to 2.8M. However, the real-time data collected needs to be processed by the MCU before being stored in the SD card. Because the program is not completely perfect, the calculation and storage take a long time, so the sampling rate has to be reduced to ensure the accuracy of the data and the real-time nature of the sampling. . The front-end current sampling circuit is also a problem. If only sampling resistors are used for sampling, such a large dynamic range cannot be achieved. The front-end sampling circuit of this work uses a series of combinations of linear components and non-linear components to achieve good accuracy within the dynamic range of 1uA-1A. Not all functions have been completed yet. In the future, hardware and software performance will be optimized, the real-time sampling rate will be increased, and more functions will be added so that it can be used as both a current analyzer and a simple oscilloscope, making it truly multi-functional. Improve cost performance.

  3. Describe the key points involved in the hardware and software parts of the work; image.png the picture above shows the hardware design of this work. 1. Front-end current sampling circuit: Common current sampling methods include a. Electromagnetic induction - usually used in large current measurement occasions, such as energy, power supply, and power system ampere (A) level current measurement. It is difficult to distinguish and measure low-voltage circuits such as IoT. mA, uA current of the power consuming device. b. Ohm's law - connect a sampling resistor in series with the line, and measure the voltage on the sampling resistor to calculate the line current I = V /Rshunt.             It is worth noting that the current measurement accuracy depends on the voltage measurement accuracy and the accuracy of the sampling resistor: ✔ The voltage measurement resolution remains unchanged. The smaller the measured current, the greater the sampling resistor resistance Rshunt required. ✔ Keep the sampling resistance Rshunt unchanged. The smaller the measured current, the higher the voltage measurement resolution requirement.

使用欧姆定律方法时,串联到回路的取样电阻Rshunt可能对电路造成潜在的影响,而且很难准确的评估影响大小。如测量一个Zigbee模块动态电流时,需要考虑以下因素的影响:             ✔ 取样电阻限制了电路的峰值电流电源或电池的输出阻抗的影响。             ✔ 线路中等效寄生电容和电阻的影响。             举个例子,当Zigbee模块处于休眠状态时,其工作电流为1uA,那么我用采样电阻为100欧姆,采样电阻上产生的电压降为0.1mV。当Zigbee突然工作时,其峰值电流上升到了100mA,那么采样电阻上的压降变为了10V,显然模块根本无法工作。            因此,本作品的前端采样电路采用了一系列线性元件和非线性元件的组合,使其在小电流状态具有大的等效电阻,在大电流状态具有很小的等效电阻,后级使用极高精度低漂移仪表放大器将微小的电压信号放大,再使用ADC采样。           下图显示的是本作品实际测量在多个动态工作电流下时采样电路产生的电压降和采样电路的等效电阻。 image.png           2.信号放大电路          前端采样电路得到的电压值是非常小的,需要经过后级放大才可以进行AD采集。这边使用的是高精度低漂移的仪表放大器AD8421,此款仪表放大器在放大倍数为100倍时,还拥有2MHz的带宽,压摆率为35V/us,0.2uV/℃的输入偏置电压漂移和最大500pA的输入偏置电流,对于放大微安级的动态电流再好不过了。           3.电源电路              本作品使用12V直流供电,电源部分可分为四部分:              1. 通过一个12V转+-9V的DC-DC隔离模块,再通过线性稳压芯片将电压稳到+-5V给电流测量模拟电路供电。              2. 通过一个12V转+5V的DC-DC隔离模块,再通过线性稳压芯片将电压稳到+5V,+3.3V给数字电路供电。              3. 通过一个12V转+-9V的DC-DC隔离模块,再通过线性稳压芯片将电压稳到+-5V给电压测量模拟电路供电,通过线性稳压芯片稳压到3.3V,给数字隔离器供电。              4.USB接口使用电脑USB端口供电,通过两个USB口,可以与电脑进行串口通信和USB通信,且通信实现电气隔离。             总的来说,电流测量部分的电路,电压测量部分电路,数字电路,接口通信电路都有各自的电源,互不干扰,从而使测量精度达到最高。电流采样可以高端采样,低端采样,同时也可以进行电压采样,同时可以接在电脑上进行数据传输,就算三者电位不相等也没关系,和供电电源电位不相等也没关系。            4.PCB布线              对于精密模拟小信号和高速数字信号共存的电路,PCB布线布局尤为重要。采样前端模拟小信号布线路径尽量短,周围要覆地,要远离数字信号线,若无法远离则上下层走线,避免平行走线,去耦电容尽可能靠近芯片的引脚。数字电路部分主要是SD卡电路,USB通信电路速率较高,SD卡的布线尽量要短,时钟线周围要覆地,USB数据线得走差分线,控制阻抗。整板覆地,功率大的地方线宽要宽,多加过孔以保证电源完整性和地平面完整性。

软件部分的关键点在于ADC实时采样,采回的数据实时处理并存入SD卡,而且还要在LCD上显示电流曲线。             1.从硬件设计方案中可以看到,我用的三路ADC是STM32F407ZGT6自带的三路ADC。STM32F407ZGT6自带3路12位逐次趋近型ADC,在MCU主频168M的情况下,单路ADC最高能达到2.8M的采样率。因为我需要三路ADC同步采样,所以程序上配置为三重ADC模式。ADC实时采回的数据量非常大,同时还要进行处理,所以需要在三重ADC模式下配置DMA双缓冲数据存储模式。在此模式下,三路ADC采回的数据先存放在数组buf1中,等buf1存满了,ADC会自动切换存储地址,开始向buf2存数据。这时便可以将buf1的数据读出来处理并存入SD卡中。等到buf2的数据存满了,ADC再切换存储地址为buf1,这时又可以处理buf2的数据了。这种方法得保证数据处理和存储的时间比ADC填满buf的时间短,就可以实现连续不间断的ADC采样和数据储存,200K采样率是没问题的。然而,由于SD卡底层库程序上还没有完善,储存速率比较低,最终导致了整体采样速率上不去。后面会对硬件和软件都进行修改,将采样率提上去。

*  四、作品材料清单;

Comment Pattern Quantity Components
1N4148 SOD123 6 D1,D2,D3,D4,D5,D6
12MHz 贴片晶振 1 Y2 Crystal Oscillator
8MHz 贴片晶振 1 Y1 Crystal Oscillator
A1212XS-2W SIP7-5 2 U19, U20
AD7276 TSOP-6N 1 U8
AD8421 SOIC8 3 U2, U3, U5
AD8422 SOIC8 1 U12
ADuM1201 SOIC8 3 U10, U11, U17
ADUM3160 SOIC_W-16N 1 U15
AMS1117 SOT223 2 U21, U26
B1205XS-2W SIP7-4 1 U18
Cap 0603-C 85 C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18,

C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C34, C35, C36, C37, C38, C39, C40, C41, C42, C43, C44, C45, C46, ​​C47, C48, C49, C50, C51, C52, C53, C54, C55, C56, C57, C58, C59, C61, C62, C63, C64, C65, C66, C68, C69, C70, C71, C72, C73, C74, C75, C76, C78, ​​C79, C80, C81, C82, C83, C84, C85, C86, C87, C88, C89, C124, C125 | Capacitor | | Cap | 0603-R | 20 | C91 , C93, C94, C97, C98, C101, C102, C104, C107, C108, C109, C110, C111, C113, C117, C118, C119, C120, C122, C123 | Capacitor | | Cap2 | TC3216 | 20 | C1, C2, C33, C60, C67, C77, C90, C92, C95, C96, C99, C100, C103, C105, C106, C112, C114, C115, C116, C121 | Capacitor | | CH340G | SOP-16M | 1 | U16 | | | DC-005B | DC-005B | 1 | P11 | | | Header 10X2 | HDR2X10 | 1 | P8 | Header, 10-Pin, Dual row | | Header 3X2 | HDR2X3 | 1 | , Dual row | | Header 4 | HDR1X4 | 1 | P6 | Header, 4-Pin | | IRLML2502 | SOT23 | 4 | Q1, Q2, Q3, Q4 | N-Channel Power MOSFET | | U22, U23 | | | L7909 | TO-263 D2PAK | 2 | U24, U25 | | | | | | | | OP07 | SOIC8 | 3 | U4, U6, U9 | | | | REF5020 | SOIC8 | 1 | U1 | | | Res1 | 0603-R | 68 | R23, R24, R25, R28, R29, R30, R31, R32, R33, R34, R35, R36, R38, R39, R40, R41, R42, R43, R44, R45, R46, R47, R49, R50, R51, R52, R53, R54, R56, R57, R58, R59, R60, R61, R62, R63, R64, R65, R66, R67, R68, R69, R70, R71, R72, R73, R74, R75, R76, R77, R78, R79, R80 | Resistor | | Res1 | 0805-R | 3 | R4, R6, R8 | Resistor | | STM32F407ZGT6 | LQFP-144N | 1 | | TFTLCD-2.8 inch | HDR2X17 | 1 | U13 | | | TF card slot | TF card slot | 1 | P7 | | | USB-MINI | USB-MINI | 2 | P9, P10 | | R | 5 | B1, B2, B3, B4, B5 | Inductor | | Single pole three throw switch | Single pole three throw switch | 1 | S1 | | | Relay-HFD3 | HFD3/5/L2 | 2 | | Terminal block_2P_5.08 | Terminal block 5.08*2 | 2 | P1, P2 | | | Precision resistor | 0603-R | 4 | R20, R26, R37, R55 | Resistor | | Precision resistor | 0805-R | 3 | R1, R2, R5 | Resistor | | Adjustable Resistor-100R | Adjustable Resistor | 1 | R48 | | | Adjustable Resistor-200R | Adjustable Resistor | 1 | R27 | | | Adjustable Cap | HDR1X2 | 1 | P3 | Header, 2-Pin | | Jump Cap | HDR1X2 | 1 | P4 | Header, 2-Pin |

  5. Upload pictures of your work; (the PCB must have the contest logo on it and take a photo and upload it, otherwise it will be deemed as giving up the competition) image.pngimage.png   6. Demonstrate your work and record it as a video for upload; (The video content must include: work introduction; function demonstration; performance test ; Close-up of the competition logo on the PCB, if not seen, it will be deemed as giving up the competition) Multifunctional power consumption analyzer: https://v.youku.com/v_show/id_XNDM3MDQ4NTY0NA==.html?spm=a2h3j.8428770.3416059.1 7. Open source document. see attached.

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-21 11:11:41

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号