Brief introduction of the work:
This project designs a low-cost dynamic current detection device, which is small in size, easy to carry and use, uses a high-bit ADC to achieve a wide range and high accuracy, and has a curve chart display function, which can be conveniently used to measure the working and sleep currents of low-power devices.
1. Details of the work;
1. Design features:
- Analog front end: Using a professional current detection chip, it overcomes the problem that the traditional op amp current detection can only be performed on the low side of the power supply (that is, the ground), and the structure is simple and accurate. The current detection resistor can be placed on the high side or low side of the power supply, and the current detection can be performed at the common mode voltage of -0.3V to 26V; at the same time, the concept of bidirectional current detection is introduced. Whether the current flows through the current detection resistor from left to right or from right to left, the measurement results of equal accuracy and range can be obtained, which fully utilizes the performance of the differential ADC and improves the applicability of the measurement application.
- Analog-to-digital conversion chip: A high-precision, low-power analog-to-digital conversion chip is used. Its architecture is a two-order Sigma-Delta ADC with 24-bit differential input without missing codes, and the periphery is very simple. The noise-free accuracy can reach more than 20 bits, ensuring the possibility of wide-range precision measurement of the system.
- Processing and display system: A single-chip microcomputer with an ARM cortex-m0 core is used to ensure the data processing capability and provide sufficient computing performance support for the current curve refresh display. The display uses a 240*320 resolution IPS screen produced by LG, which has the characteristics of high viewing angle and bright colors. There are three user buttons, and pads are reserved for external 25Q storage and 24C storage chips to provide space for future function expansion.
- Low cost: After testing and comparison, domestic ADC and MCU were selected. While ensuring that the performance meets the standards, there are extremely simple peripheral component requirements and very low BOM cost (less than tens of yuan). It is a low-cost, moderate-performance dynamic current detection device solution.
2. Technical parameters:
- Range: -125mA ~ +125mA
- Common mode voltage range: -0.3V ~ +26V
- ADC bit number: 24 bits
- Measurement accuracy: 0.02‰ +-10 digits @ 10Hz; 0.05‰ +-25 digits @ 40Hz
- Reference voltage: 2.5V
- Display refresh rate: 10Hz/40Hz
- Power supply: 5V 50mA
3. Application scenarios:
- Working current and sleep current monitoring of low-power devices;
- Power consumption analysis of a single chip/active component in the system;
- MCU IO push-pull (leakage) current analysis;
4. Functional introduction
- Introduction to on-board components
- Introduction to related human-machine interfaces
- Introduction to screen display content
- Measurement wiring method The red line is the power input, the yellow line is connected to the target power supply, and the black line is the common ground.
2. Describe the challenges faced by the work and the problems solved;
1. Analog part: A good measurement system can obtain high-performance measurement results only if it has an excellent analog front end. In this system, there are two main difficulties in sampling current signals. The first difficulty is the collection of micro-currents. When low-power devices are in sleep mode, the operating current is often at the level of tens of uA or even a few uA. For this level of weak current, there are two traditional solutions.
If you use a multimeter or the like for measurement, ordinary multimeters often cannot collect or can only read one or two digits, and need to connect a large current sampling resistor in series. For example, in common multimeters, for the measurement of the 2ma range, a 100-ohm sampling resistor is used for measurement. This resistance value is very large for devices with dynamic power consumption. If such a large resistance is connected in series to the circuit, the device can hardly work in a non-sleep state, so the power consumption of the system cannot be correctly calculated.
The figure shows a classic multimeter circuit diagram. It can be seen that the 2mA range loop uses a combination of 90+9+0.9+0.1, and the synthetic resistance value is 100 ohms.
Another common solution is to use two current-sensing resistors in series, such as 0.1 ohms and 100 ohms in series, and then use two sets of amplification circuits and ADCs to detect separately. When the system to be tested is dormant, the 100 ohm loop is used to measure the current. When the system is working, the 100 ohm resistor is short-circuited with a manual/electronic switch, and the 0.1 ohm loop is used for detection. However, this solution has two problems. First, the system is complex and costly, requiring two sets of analog front ends, two sets of ADCs and matching electronic switching circuits. Second, when the target system to be tested wakes up, if the switch is not switched fast enough, the target voltage will still be too low due to insufficient power supply, and the wake-up failure may even trigger a low voltage reset.
The structure of the current measurement system of the dual resistor is shown in the figure .
In this design, the high-precision current monitoring chip INA214 produced by Texas Instruments, also known as the current sensing amplifier, is selected. This chip provides 100 times the power amplifier gain, and uses a zero-drift architecture, ±0.02% gain error and ±0.01% nonlinear error, making it possible to accurately measure weak current signals.
In power consumption measurement, if it can display positive and negative measurements like a multimeter, it can provide a large measurement space, so there is no need to worry about connecting the wiring in reverse. Fortunately, the INA214 chip selected in this design can provide this function.
On the other hand, because of the introduction of a mature current monitoring solution, while being able to meet the bidirectional current detection, it can also provide the function of current detection on the high side or low side of the power supply, overcoming the problem that the current detection of traditional op amps can usually only be performed on the low side of the power supply (that is, ground). The chip provides a common mode rejection ratio of up to 140dB, which greatly ensures that there will be no significant deviation in the measurement results due to changes in the common mode voltage.
2. ADC part: The second difficulty of low-power current sampling is the adaptability to a large dynamic range while ensuring measurement accuracy. This is due to the use of high-bit ADC. Using a 24-bit ADC, after deducting the noise bit interference, it can also provide 20-bit noise-free resolution, and has ±15ppm integral linearity, and an internal low-noise amplifier with a temperature drift of 20nV/degree Celsius. This makes it easy and accurate to measure 100+ma to a few uA, eliminating the delay caused by range switching, the difficulty of accuracy, uneven errors, and complex peripheral circuits.
During the prototype verification of this design, after trying more than ten 24-bit adcs produced by different manufacturers at home and abroad, a domestic ADC with high cost performance, simple periphery, and excellent performance was selected, model CS1237
3. Curve display: In program design, high-speed display curves are involved, which requires very high processing speed. Therefore, the 8-bit microcontroller is definitely not available, so the ARM core microcontroller is selected. In this design, the unique selection of Nuvoton's NUC029 microcontroller has an EBI interface that can be easily connected to the screen, and has a higher communication speed than software simulation, ensuring the curve refresh speed of the screen.
In the program, a variety of optimization methods are used to ensure the efficiency of curve calculation and refresh display. The detailed optimization methods are shown in the attached program package and will not be repeated here.
At the same time, in the UI design, an adaptive range-adaptive curve display solution is proposed, which can display more effective information in the curve box.
3. Describe the key points involved in the hardware and software parts of the work;
In a precision measurement system, all determined errors can be quantitatively measured by software and hardware, and finally compensated or eliminated; However, temperature drift and noise are two major enemies that cannot be eliminated by compensation and must be faced by all measurement systems. In this system, there are three parts that will introduce temperature drift and noise. Current sampling resistor, current sensing amplifier and ADC (including reference).
For resistors, the main thing introduced is temperature drift. When current passes, temperature rises, and the resistance value drifts. Therefore, the larger the package resistor, the smaller the temperature rise under the same power consumption, and the smaller the drift resistance value. Therefore, a large package resistor of 2512 is selected here, and a model with a smaller temperature drift coefficient is selected. In addition, the current in this design is not large, only 125ma, so the temperature drift introduced here can meet the requirements.
For current monitoring chips, it is the key to temperature drift and noise control. From the manual, we can see that the INA214 chip selected in this work has a typical value of 3ppm per degree Celsius for gain change and a maximum value of 10ppm for temperature drift. For noise, the effective number of bits sampled is determined. The voltage noise of the chip is 25nV/√Hz. Compared with the common high-precision instrument op amp AD620, the gain change drift for temperature is a typical value of 10ppm per degree Celsius, a maximum value of 95ppm, and a voltage noise of 72nV/√Hz. It can be seen that the drift and noise of INA214 are small.
For the reference chip, the MC1403 reference is selected here, which can provide a typical value of 10ppm per degree Celsius temperature drift.
For the ADC chip, the PP noise is 180nV, the effective noise-free accuracy is 20 bits, and the offset error temperature drift is 20nV per degree Celsius.
It can be seen that the above sufficiently strong performance guarantees the small current detection measurement accuracy of the measurement system.
In order to perform bidirectional current measurement, the following circuit is used to effectively suppress the common mode error and improve the common mode rejection ratio.
The wiring of the current detection resistor needs to follow the principle of equal length to ensure the minimum influence of voltage and current bias. In the
physical wiring
software design, two speeds are provided to easily observe the current curve of the device in sleep and work. On the other hand, the maximum and minimum current values in the current icon are calculated and displayed to facilitate qualitative analysis.
The curve display uses block refresh technology to reduce flicker.
The introduction of real-time automatic measurement of the display range allows the waveform to fill the screen as much as possible and increase observable information.
For details, see the open source attachment
IV. List of materials for the work;
the screen was purchased from Taobao
V. Pictures of the work;
the power-on display interface
completed image
completed image front
completed image back
close-up of the competition icon
to measure the static resistance load (compared with the multimeter)
and measure the low-power working and sleep currents of the N76E003 chip
using two different speeds
. The N76E003 code used in the test:
The manual states that the typical power consumption in power-down mode is 6ua, which is basically consistent with the measured 5.5ua
VI. Open source documentation.
Open source PCB Direct LCEDA can open
all open source codes and attached executable files can be directly burned and run for download. See attachment
VII. Demonstration video: