I. Design Background
The digital voltmeter and ammeter combines ADC technology with circuit measurement principles, accurately converting analog voltage and current signals into digital displays for easy reading and analysis by electronic engineers. This device not only improves the accuracy and efficiency of circuit measurements but also helps engineers better understand circuit behavior, making it a powerful tool for electronic design and troubleshooting, and playing a significant supporting role in the work of electronic engineers. In product applications, the digital voltmeter and ammeter ensures the accuracy and safety of circuit design, while also providing strong support for product quality control and subsequent maintenance.
II. Hardware Design
1. Power Supply Design

A diode is used to prevent reverse connection damage to subsequent circuits. A step-down chip is selected to obtain a 5V voltage. A diode is added as a power indicator for easy identification.
2. Sampling Circuit Design
:

The maximum voltage to be measured is 30V;
the ADC reference voltage is 1.5V, which can be configured through the program;
based on experience, the low-side resistor (R7) is selected as 10K;
the high-side resistance of the voltage divider is calculated using the above parameters;
the required voltage division ratio is calculated, i.e., the ADC reference voltage is the design input voltage, which can be calculated using known parameters as 1.5V/30V=0.05
; the high-side resistance is calculated as the low-side resistance/voltage division ratio, which can be calculated using known parameters as 10K/0.05=200K;
a standard resistor is selected: a resistor slightly higher than the calculated value is chosen, which is 200K, and an E24 series 220K resistor is selected.
The voltage divider resistors are 220K+10K, therefore the voltage division ratio is 22:1 (ADC_IN11).
The

maximum pre-designed current measurement value is 3A
, which is the voltage difference caused by the current sensing resistor. It is generally not recommended to exceed 0.5V
of the current sensing resistor's power consumption. A suitable package should be selected based on this parameter. Considering the power consumption (temperature) issue under high current, a 1W packaged metal wire-wound resistor was selected in this
project. The voltage amplification factor of the current sensing resistor: No op-amp is used to build the amplification circuit in this project, so the factor is 1.3
.

An additional TL431 circuit is added to provide a 2.5V reference voltage, which can be used to provide an external voltage reference for the chip to calibrate the AD.
Physical verification diagrams

and detailed project information are available in the CW32 Digital Voltage and Current Meter Training Camp Project Tutorial Document | LCSC Development Board Technical Document Center (lckfb.com).