张三叔

#The7thLiChuangElectricityContest#Dual-channel USB power meter

 
Overview

1. Project function introduction:
Use the National Technology N32G430C8L7 chip and acquisition circuit to make a dual-channel USB power meter, which can display the current USB power usage and support power detection of mobile phone fast charging.
2. Project attributes:
This project refers to the USB power meter of the LiChuang open source platform to modify and add functions, and has not won awards in other competitions. 
3. The open source agreement
uses the GPL3.0 open source agreement; the reference project source link: https://oshwhub.com/limengmeng12345/ji-chu-ying-usb-dian-ya-biao
 
4. Hardware part: The main
control
uses the National Technology N32G430C8L7 chip as the main control chip. It should be noted that each power pin of the chip needs to be connected to an additional 100nF external filter capacitor, and the 1st pin of the chip needs to be connected to an additional 4.7uf filter capacitor.
Reset circuit, BOOT circuit:
The reset circuit and BOOT circuit are designed with buttons. The
burning interface
chip supports a variety of burning methods, such as the common ST-Link, USB-TTL, Jlink and other burners on the market. The corresponding interface has been led out with a 2.54 pitch pin header for burning.
Voltage conversion
Although the MCU used in this case supports a maximum voltage of 5V, considering the possible unstable voltage factors on the USB voltage or other voltages, a LDO with a maximum conversion of 18V to 3.3V (so it supports the voltage of fast charging) is used to power the chip. Even in the case of unstable power supply, the MCU can work normally. It should be noted that the LDO input and output must be connected to 22uF and 100nF capacitors (it is recommended that components such as capacitors should be selected with a withstand voltage of more than 25V).
Current sampling, USB input/output
USB input/output
The USB input end uses a Type-A male connector, and the USB output end uses a 4P sink board female connector.
Current sampling
The current sampling part is the INA199B1DCKR current sensing amplifier, (also known as a current sensing amplifier) ​​which is commonly used for overcurrent protection, precision current measurement for system optimization, or closed-loop feedback circuits. This series of devices can sense the voltage drop across the shunt resistor at a common-mode voltage of –0.3V to 26V independent of the power supply voltage. There are three fixed gains to choose from: 50V/V, 100V/V, and 200V/V. This series of devices uses a zero-drift architecture with low offset, so the maximum voltage drop across the shunt resistor can be kept to a minimum of 10mV full-scale when sensing current. The parameters are as follows:
· Common-mode range: –0.3V to 26V
· Offset voltage: ±150μV (maximum)
· Supports 10mV full-scale shunt voltage drop
· Quiescent current: 100μA (maximum)
Sampling resistor selection
Inserting a low-resistance detection resistor in series in the current path will form a small voltage drop, which can be amplified and treated as a signal proportional to the current. However, depending on the specific application environment and the location of the detection resistor, this technology will pose different challenges to the detection amplifier. Generally, the resistance value of the sampling resistor is below 1 ohm, which is a milliohm-level non-inductive resistor, but some resistors have sampling voltage requirements, so large resistance value resistors must be selected, but the resistance base is large and the error is large. In this case, it is necessary to select high-precision non-inductive resistors (which can reach 0.01% accuracy, i.e., one ten-thousandth accuracy) to make the sampled data very reliable. The temperature coefficient of the ultra-low resistance value resistors (0.0005 ohms, 2 milliohms, 3 milliohms, 10 milliohms, etc.), chip alloy resistors, high-power resistors (20W, 30W, 35W, 50W, 100W) and other products of the chip is plus or minus 5PPM.
Sampling method
This sampling uses the low-side sampling method, that is, the sampling resistor is connected to the GND loop. This design can calculate the complete differential, follow, amplify, and output when the differential signal is sent to the operational amplifier. If high-side sampling is used, that is, the sampling resistor is placed at a high position between the power supply and the load, although this placement method not only eliminates the ground interference generated in the low-side detection scheme, but also detects the accidental short circuit from the battery to the system ground, but the high-side detection requires the detection amplifier to handle the common-mode voltage close to the power supply voltage. This common-mode voltage value ranges widely, from the level required to monitor the processor core voltage (about 1V) to hundreds of volts commonly seen in industrial, automotive and telecommunications applications. Application examples include the battery voltage of a typical laptop (17 to 20V), 12V, 24V or 48V batteries in automotive applications, 48V telecommunications applications, high-voltage motor control applications, current detection for avalanche diodes and PIN diodes, and high-voltage LED backlights. Therefore, an important advantage of high-side current detection is that the detection amplifier has the ability to handle large common-mode voltages. Therefore, the current sampling method of sampling resistor plus op amp is best performed at the low end. Although, low-end sampling will affect the ripple of the signal due to common ground interference. But compared to the high end, the solution is simple, low cost and high reliability.
Voltage sampling
The voltage sampling part consists of a voltage divider circuit composed of two resistors, and its principle is the knowledge of resistor series voltage division.
Display part
The display part uses a 0.96-inch 4P blue OELD screen module, using IIC communication, and the display effect is clear.
5.
Compilation parameters for the software part
· Compiler: ARM Compiler version 5 (-O0)
· MDK version: 5.31
· Debugger: ST-Link V2 
6.
Check the BOM list in the project or see the table below.
7. Notes
1. Because one of the USB ports supports fast charging, when using USB1 for fast charging, do not connect other devices to USB2, otherwise it may be damaged. When using non-fast charging devices on USB1, both USB output ports can be used at the same time. 2. For
the crystal oscillator part (X1, C12, C13), you can choose not to install it and leave it empty. If you install it, you need to change the content of the program.
3. There is currently no casing designed for this hardware. You can design it yourself if necessary.
8. Picture appreciation
 
 
 
 
 
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-24 12:59:00

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号