Preface:
This project is a replica of the voltmeter and ammeter project from the 2024 summer camp. I (the author) participated in this training camp during my summer vacation when I had some free time. Having only recently entered university, I know very little about hardware and lack the skills to modify the hardware schematics and PCB designs myself. Therefore, I can only replicate this project using a copy-paste method to enrich my knowledge of hardware design.
I. Project Introduction
This project is a voltmeter and ammeter based on the LCSC CW32F030C8T6 development board. It utilizes the CW32's internal ADC 1.5V reference to acquire voltage and current data. The acquired results are averaged and filtered before being displayed on a digital tube, completing a simple voltage and current measurement. Five modes can be used to calibrate the voltage and current for more accurate measurements.
II. Hardware Circuit
1. Overall Schematic Diagram
2. Main Control Chip and ADC Voltage and
Current Meter Acquisition Project directly utilizes LCSC's Diwenxing chip. The Diwenxing main control chip is the CW32F030C8T6 chip, which integrates a true 12-bit ADC successive approximation digital-to-analog converter with a resolution of 2^12. The ADC can use four channels: power supply voltage (VDDA), internal 1.5V reference, internal 2.5V reference, and external PB00 pin reference voltage (provided by TL431).

Voltage acquisition utilizes voltage and current division to measure voltage and current (acquisition range 0~30V).


Different voltage division ratios can change the measurement range, but higher voltage division ratios often lead to decreased accuracy. Therefore, selecting an appropriate voltage division ratio is essential.
Current acquisition uses a low-side current sampling circuit (acquisition range 0~3A).

The ADC cannot directly measure the current magnitude and can only sample it through a sampling resistor. The maximum current design is 3A. As for why it's 100mΩ... The author can only briefly explain that a 100 milliohm resistor has a small resistance and a small voltage drop. V = I * R = 3A * 0.1Ω = 0.3V, providing a sufficiently large voltage signal input to the ADC_IN12 for voltage detection, thus indirectly calculating the current. Furthermore, P = 3A² * 0.1Ω = 0.9W, indicating relatively low power consumption and preventing overheating. Regarding
circuit board soldering and BOM materials
: since most components are through-hole, although the author lacks extensive soldering experience, the existing soldering iron was sufficient for soldering this circuit board. However, due to the small spacing between the TL431 holes, solder bridging was easy, resulting in one damaged board. A larger package of TL431 could be used; the author will not modify it further. Special reminder: Do not solder resistor R0 during the soldering process; solder it only after the experiment is complete.

The white digital tube is a 0.28-inch common anode white digital tube purchased from Taobao, but the BOM specifies a common cathode digital tube. Why would a mouse buy a common anode seven-segment display? Of course, it's to learn how to use a common anode seven-segment display (not really). The 2mm banana plug is a K2A33, which can be found by searching keywords. The rest were ordered from LCSC Mall based on the BOM. For detailed materials, please see the attached BOM.
Due to limited energy, I won't go into detail about other hardware circuits. If needed, you can refer to the official documents and videos below.
III. Software Program
The software used is Keil5. The software code is based on the program learning reference in the official training camp document (link). Based on the experimental case, the common cathode seven-segment display was changed to a common anode seven-segment display.
Common anode modification content. According to the principle of seven-segment displays, it is easy to know the difference between common anode and common cathode seven-segment displays (the common anode seven-segment display lights up when the anode is high and the cathode pin is low, while the common cathode is the opposite). We only need to change the encoding in Seg_Table[21] to the required common anode encoding table. Of course, you can also invert the original, but it is easy to get garbled characters. It is recommended to modify it according to the following figure. Then we set the GPIO pin of the digital tube's switch function to a high level, and finally set the GPIO of the common terminal initialization function Close_Com() to a low level, thus completing the modification of the common anode digital tube.

Regarding the modification of voltage and current calibration values, refer to the training camp video to modify or add a few common calibration values; I won't elaborate further.
IV. Simple Assembly
After the PCB has been tested and found to be functional, you can use an extra circuit board as the bottom surface, connecting it with M3-5mm plastic copper pillars. On the front, use M3-10mm plastic copper pillars to connect the printed panel and secure it with screws and nuts.
The buttons cannot be directly pressed through the acrylic panel; you can modify them to 12mm or larger through-hole buttons. Alternatively, you can leave them as is and use a pen or similar object to press the buttons.
Finally, I'm glad you've patiently read this far, thank you for browsing. The above content is based on my personal understanding during my learning process. If there are any errors or inaccuracies, please point them out, and I will correct them promptly.
The demonstration video
is only a rough test and has a rough result because I don't have a multimeter right now. I can't verify its accuracy. I will complete the full test in a while.