This project remodels the T50 meter, so there is no related software. Just to verify the current gear switching.
Foreword:
Generally, the ammeters on the market all have one range (multimeters are not included, and it is useless to count them. What is discussed here is automatic range). For example, various USB meters have ranges from 2A-5A and resolutions of 0.01A-1ma. , even the high-priced USB meter that costs hundreds of dollars, although it uses a high-bit ADC, has limitations in speed and minimum range. For example, the minimum resolution of the duck palm meter is 10uA. If it is used to measure a few ma or more, it is okay, but if it is used to measure the quiescent current of some devices, it is useless.
This article explains a low-cost 2-gear (multiple gears can be achieved by simply adding a sampling unit) large-span ammeter.
design:
Let’s talk about the current first. Generally, measuring the current is to measure the voltage drop generated at both ends of the sampling resistor, and then amplify the ratio and send it to the microcontroller ADC. However, a sample requires at least a 21-bit ADC to resolve the 1ua-2A range. High-speed and high-bit ADCs are expensive, so this article does not use this solution. One sample and one high-bit ADC cannot be used, so there must be multiple samples to switch various ranges, just like a multimeter, but the multimeter is a manual solution. The following is a two-speed automatic range ammeter designed with 1-5000uA, 1-2700ma, and on-chip 12-bit ADC. (5000ma can also be designed. A good 12-bit calibration can basically satisfy the display of 1 ma)
First of all, the sampling resistor is connected in series in the circuit. This is very important. If the sampling resistor is turned on, it does not matter how many pieces are switched. The intermittent time will cause the downstream equipment to lose power and affect the measurement.
As shown above, GNDIN is the input -. GNDOUT is the output -. GND is the analog ground, including the digital ground power supply of the microcontroller, which is also taken from here.
The main event is here.
The picture above shows the sampling amplification of the two gears.
The op amp here uses inverting amplification. That's right. It is to amplify negative voltage into positive voltage. Generally, op amps powered by a single power supply will have a common-mode input of about -0.2V. 0.2V is enough to reflect the voltage drop process of a large current range.
Large current sampling 0.01R uses inverse amplification, and small current uses forward amplification.
The two groups of amplified voltages are sent to the microcontroller respectively.
Let’s talk about the gear recognition part.
The picture above uses the voltage comparison method to determine the shift current point.
Because the two sampling resistors are connected in series. The currents are all equal, so the 6mA current point on the 0.01R sampling resistor is collected as the comparison object. The shift point is slightly higher than the low current range.
When the entire current loop exceeds 6ma, the voltage comparison outputs a high level. Drive Nmos connected in parallel to the 10R sampling resistor to conduct the shift. That is to allow the circuit to withstand greater current.
When the gear shift is completed, the low current gear becomes invalid. . But the high current gear still exists. In other words, the high current gear has always existed. It just adds a few small current ranges.
practical testing.
The picture above shows the input of 5V. Output voltage change when loaded with 2.3A load. There is about a 10ms voltage drop.
The picture above shows the voltage drop when the output port is loaded at 500ma.
Both tests were conducted with automatic shifting.
Use T50 header modification plan.
Actual verification can show 1-5000ua, 1-2700ma. The accuracy is also good
It can basically meet daily testing needs.
Summarize:
Again, I have a record myself.
When measuring current below 5ma, the microcontroller calls the 10R sampled data. When the current exceeds 6ma, it automatically switches to the high current gear.
Because the small current range is actually more than 5ma. Therefore, a margin can be left in the software.
When the small current reaches 5ma, the software switches to large current sampling and continues to display 5ma.
Continue to increase the current to 6ma to complete the switching action. Reduce the internal resistance of the circuit and completely use 0.01R sampling data to display the current.
Okay, the above is the design idea of a long-span ammeter. The software part is beyond my control. I won't get involved.
Extension:
As for the gears that need more subdivisions. Think about it carefully. Just string more samples. Then use the high-current reverse-amplified data to distinguish the gears. Just switch different sampling resistors. However, the third one - the sampling part with more gears requires differential amplification, which is better.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet