1. Project Origin:
This project is a replica of the voltammeter bootcamp project. The official documentation is detailed, and I found solutions to many problems I encountered while replicating this project. Documentation link:
https://wiki.lckfb.com/zh-hans/dwx-cw32f030c8t6/training/voltammeter-bootcamp/voltammeter.html
2. Program Burning:
2.1 Installing the CH340 driver and burning software CW32_Programmer_V1.53:
Download from the development tools folder provided by LCSC via Baidu Cloud.
Baidu Cloud link: https://pan.baidu.com/s/1l1PboWaVzdBSqCZ4Fh2-uw?pwd=gub3 Extraction code: gub3.

Extract the folder, then right-click and run as administrator to install.
2.2 Pin Connections
I used the serial port programming method. Before programming, the jumper cap on the development board must be set to position 1. A USB-to-TTL module is required. If its output VCC voltage is 5V, the pin connection is shown in the following diagram:


The USB-to-TTL module I purchased has an output VCC voltage of 3.3V, and the pin connection is shown in the following diagram:

2.3 Programming
Press the reset button on the development board to restart! Right-click and run as administrator to open the CW32_Programmer software. Select the serial port, choosing the COM port corresponding to your USB-to-TTL adapter.

Click on the connection editor

to set the software settings,

then select the HEX file:

Finally, click "Online Programming,"

and the program will automatically reset and run. Afterwards, don't forget to set the jumper cap on the development board to 0!!!
3. Schematic Design Description
The schematic is largely copied from the official design, with only some components that were out of stock on the LCSC online store replaced. Here is the official project link:
https://oshwhub.com/li-chuang-kai-fa-ban/cw32-shu-zi-dian-ya-dian-liu-biao-kai-fa-ban-tao-jian
3.1 Power Supply Circuit
This project uses an LDO as the power supply. Considering that most voltmeter products are used in industrial scenarios with 24V or 36V power supplies, this project selected the SE8550K2, which has a maximum input voltage of up to 40V, as the power supply. The main reason for not using a DC-DC buck converter to handle the large voltage difference is to avoid introducing DC-DC ripple interference during the design process; a secondary reason is to reduce project costs.

3.2 TL431 Circuit Design for Voltage Measurement and Calibration
This project adds an extra TL431 circuit to provide a 2.5V reference voltage, which can be used to provide an external voltage reference for the chip to calibrate the AD. From a product design perspective, due to the inherent ADC performance advantages of the CW32, this circuit is not necessary.

3.3 Voltage Sampling Circuit
Voltage Divider Resistor Selection
and Design: The maximum value of the measured voltage is 30V for safety reasons (the actual maximum display value can be 99.9V or 100V);
the ADC reference voltage is 1.5V in this project, which can be configured through the program;
power consumption, to reduce the power consumption of the sampling circuit, the low-side resistor (R16) is usually selected as 10K based on experience;
then the high-side resistance of the voltage divider resistor can be calculated using the above parameters:
calculate the required voltage division ratio: i.e., the ADC reference voltage: design input voltage, which can be calculated using known parameters as 1.5V/30V=0.05;
calculate the high-side resistance: i.e., low-side resistance/voltage division ratio, which can be calculated using known parameters as 10K/0.05=200K;
select a standard resistor: select a resistor slightly higher than the calculated value, which is 200K. We usually choose E24 series resistors, so in this project, we choose 220K, which is greater than 200K and closest to it.
If, in actual use, the voltage to be measured is lower than 2/3 of the module's design voltage (66V), the voltage divider resistor can be replaced and the program modified to improve measurement accuracy. The following example illustrates this:
Assuming the measured voltage is no higher than 24V and other parameters remain unchanged,
calculations show 1.5V/24V = 0.0625, 10K/0.0625 = 160K. 160K is a standard E24 resistor and can be directly selected, or a higher value 180K can be chosen with some redundancy.
If, in actual use, the voltage to be measured is higher than the module's 99V design voltage, a different resistor can be selected. To achieve a wider voltage measurement range, one can choose to replace the voltage divider resistor or modify the reference voltage. The following example illustrates this:
Assuming the measured voltage is 160V, the solution is to increase the voltage reference to expand the range.
Given that the voltage division ratio of the selected resistor is 0.0145, we can calculate 160V * 0.0145 = 2.32V using the formula. Therefore, we can choose a 2.5V voltage reference to expand the range (increasing the range will reduce accuracy).
Considering the potential fluctuations in the measured power supply, a 10nF filter capacitor is connected in parallel with the low-side voltage divider resistor to improve measurement stability.
Range switching:
In this project, an additional voltage sampling circuit was added. Therefore, we can discuss the significance of range switching for improving measurement accuracy. Multimeters often have multiple range settings for more accurate measurements. By adjusting different ranges, the optimal measurement accuracy of the measured point within the corresponding range can be obtained.
This project requires a combination of hardware and software to achieve this function. When we first use the ADC_IN11 channel mentioned earlier to measure voltages below 30V... If the measured voltage is within 0~3V, then the ADC_IN9 channel is used for measurement. In this case, the measurement accuracy is greatly improved due to the reduced voltage division ratio.
There are many ways to implement gear shifting, and the development board design provides more design possibilities.

3.4 Current Sampling Circuit
The sampling current designed for this project is 3A, and the selected sampling resistor (R0) is 100mΩ.
The following aspects need to be considered when selecting the sampling resistor:
the maximum value of the pre-designed measurement current;
the voltage difference caused by the 3A current sensing resistor in this project; and
the power consumption of the current sensing resistor, which should generally not exceed 0.5V. A suitable package should be selected based on this parameter. Considering the power consumption (temperature) issue under high current, a 1W packaged metal-wound resistor was selected.
The voltage amplification factor of the current sensing resistor: No operational amplifier was used in this project, so the factor is 1.
The current sensing resistor value can then be calculated using the above parameters. Selection:
Since no amplifier circuit was used in this project, a larger sampling resistor was needed to obtain a higher measured voltage for measurement.
Considering that a larger resistor would result in a larger voltage difference and higher power consumption, a larger resistor could not be selected indiscriminately.
A 1W packaged resistor was selected in this project, with a corresponding temperature rise power of 1W.
Based on the above data, a 100mΩ current-sensing resistor was selected for this project. According to the formula, 3A * 100mΩ = 300mV, 900mW.
To handle different operating environments, especially high-current scenarios, the R0 resistor can be replaced with constantan wire or a shunt. The appropriate alternative can be chosen based on the specific application. For safety and educational purposes, this project will not delve into measurements exceeding 3A, although the principle remains the same.
Voltage and Ammeter Project.zip
WeChat_20240822010433.mp4
PDF_Voltage and Ammeter (Replica).zip
Altium_Voltage and Ammeter (Replica).zip
PADS_Voltage and Ammeter (Replica).zip
BOM_Voltage and Ammeter (Replica).xlsx
92950
Replica voltmeter and ammeter
Replica voltmeter and ammeter
Thanks to JLCPCB for providing the learning opportunity.
Thanks to the developers and Engineer Chen.
Thanks to Wuhan Chip Source.
For a simple replication and burning of the official source code,
please refer to https://wiki.lckfb.com/zh-hans/dwx-cw32f030c8t6/training/voltammeter-bootcamp/voltammeter.html
LCPCB CW32 Digital Voltage and Current Meter Expansion Board - LCPCB Open Source Hardware Platform (oshwhub.com)
1. Power Supply Circuit
ADC means converting continuous analog signals into digital signals, providing the possibility for digital processing and analysis. ADCs play an important role in signal conversion, measurement and data acquisition, control system input, and communication and signal processing. Their widespread application promotes the intelligent and precise control of electronic equipment in various industries and is one of the key factors driving modern technological progress.
Voltage and current are calculated through ADC sampling.
This project, like the official project, adopts a core board plus expansion board design concept, using plug-in components to simplify learning and deepen exploration.
The core board uses the domestic Wuhan Xinyuan Semiconductor CW32 as the main controller, while also being compatible with other similar development boards; however, the CW32 has advantages.
The project is highly comprehensive and practical, and after completion, it can be used as a desktop instrument.
For the power supply circuit, we use a DC connector, the same as the official one. However, I added terminal blocks and Type-C input/output to measure the voltage and current of the Type-C connector and the terminal blocks. For the

Type-C input/

output terminal blocks and

LDO (Low Dropout Linear Regulator) selection, this project uses an LDO as the power supply. Considering that most voltmeter products are used in industrial scenarios with 24V or 36V power supplies, this project selected the SE8550K2, which has a maximum input voltage of up to 40V. The main reason for not using a DC-DC buck converter to handle the large voltage drop is to avoid introducing DC-DC ripple interference during the design process; a secondary reason is to reduce project costs.
2. MCU Selection
: Thanks to JLCPCB for the selection; the Diwenxing MCU was purchased for 1 yuan, and it was a replica.
The CW32's key advantages in this project include
: Wide operating temperature range: -40~105℃;
Wide operating voltage: 1.65V~5.5V (STM32 only supports 3.3V systems);
Strong anti-interference: HBM ESD 8KV; All ESD reliability reaches the highest international standard level (STM32 ESD 2KV);
A key focus of this project – Better ADC: 12-bit high-speed ADC, achieving ±1.0LSB INL 11.3ENOB; Multiple Vref reference voltages... (STM32 only supports VDD=Vref);
Stable and reliable eFLASH technology.
3. Voltage Sampling Circuit:

The voltage divider resistors in this project are designed as 220K+10K, therefore the voltage division ratio is 22:1 (ADC_IN11).
The voltage divider resistor selection
is for the maximum measured voltage; for safety reasons, this project uses 30V (the actual maximum display can be 99.9V or 100V).
The ADC reference voltage is 1.5V in this project, and this reference voltage can be configured through the program.
To reduce the power consumption of the sampling circuit, the low-side resistor (R7) is usually chosen as 10K based on experience.
Then, the high-side resistance of the voltage divider resistor can be calculated using the above parameters.
The required voltage division ratio is calculated, i.e., the ADC reference voltage. The input voltage is designed; using known parameters, 1.5V/30V = 0.05 can be calculated.
The high-side resistance is calculated as the low-side resistance/voltage division ratio; using known parameters, 10K/0.05 = 200K can be calculated.
A standard resistor is selected: a resistor slightly higher than the calculated value of 200K is chosen. We usually choose E24 series resistors; therefore, in this project, 220K, which is greater than 200K and closest to the calculated value, is selected.
If, in actual use, the voltage to be measured is lower than 2/3 of the module's design voltage (66V), the voltage divider resistor can be replaced and the program modified to improve measurement accuracy. The following example illustrates this:
Assuming the measured voltage is no higher than 24V and other parameters remain unchanged,
calculations show 1.5V/24V = 0.0625, 10K/0.0625 = 160K. 160K is a standard E24 resistor and can be directly selected, or a higher value 180K can be chosen with some redundancy.
If, in actual use, the voltage to be measured is higher than the module's 99V design voltage, a different resistor can be selected. To achieve a wider voltage measurement range, one can choose to replace the voltage divider resistor or modify the reference voltage. The following example illustrates this:
Assuming the measured voltage is 160V, the solution is to increase the voltage reference to expand the range.
Given that the voltage division ratio of the selected resistor is 0.0145, we can calculate 160V * 0.0145 = 2.32V using the formula. Therefore, we can choose a 2.5V voltage reference to expand the range (increasing the range will reduce accuracy).
Considering the potential fluctuations in the measured power supply, a 10nF filter capacitor is connected in parallel with the low-side voltage divider resistor to improve measurement stability.
Range switching:
In this project, an additional voltage sampling circuit was added. Therefore, we can discuss the significance of range switching for improving measurement accuracy. Multimeters often have multiple range settings for more accurate measurements. By adjusting different ranges, the optimal measurement accuracy of the measured point within the corresponding range can be obtained.
This project requires a combination of hardware and software to achieve this function. When we first use the ADC_IN11 channel mentioned earlier to measure voltages below 30V... If the measured voltage is within 0~3V, use the ADC_IN9 channel for measurement. At this time, due to the reduced voltage division ratio, the measurement accuracy is greatly improved. There are many ways to implement gear shifting, and the development board design provides more design possibilities.
4. Current sampling circuit:

The official design specifies a sampling current of 3A, and the selected sampling resistor (R0) is 100mΩ. I directly replaced it with a 2W resistor, which will have a larger measurable range.
5. Digital tube display:
I used a 0.36-inch digital tube that I had already purchased, which is cheaper. 5 for 2 yuan.

6. LED indicator
: Power-on light ,

program verification light.

7. Button circuit design:
I used an existing surface-mount button to save money.

8. TL431 circuit design for voltage measurement calibration:
They tell us to do experiments, but we didn't! ~~~

9. 3D shell: I didn't post pictures because it failed.
For replication, please choose the official project; there is a link to the official project at the top of the article, which can be modified based on the project. There
are too many experts here; I don't expect to win, but improving my own open-source project is a way to learn again and deepen my understanding.
Thank you, I'm leaving.
d video.mp4
Voltage and Ammeter Project.zip
PDF_Replica Voltage and Current Meter.zip
Altium_replica voltage and current meter.zip
PADS_Replica Voltage and Current Meters.zip
BOM_Replica Voltage and Current Meter.xlsx
92951
Earth Star Voltage and Current Meter
This project is based on the CW32F030C8T6 Earth Star development board and completes the voltage and current meter project for the DC range of 0-30V (current: 0-3A).
I. Design Background
An ADC (Analog-to-Digital Converter) is an indispensable key component in electronic systems. It converts continuous analog signals into digital signals, enabling digital processing and analysis. ADCs play a crucial role in signal conversion, measurement and data acquisition, control system input, and communication and signal processing. Their widespread application promotes the intelligent and precise control of electronic equipment across various industries, and is one of the key factors driving modern technological progress. Digital voltmeters and ammeters combine 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, serving as a powerful tool for electronic design and troubleshooting, and playing a vital supporting role in the work of electronic engineers. In product applications, digital voltmeters ensure the accuracy and safety of circuit design, while also providing strong support for product quality control and subsequent maintenance.
I. Design Background
An ADC (Analog-to-Digital Converter) is an indispensable key component in electronic systems. It converts continuous analog signals into digital signals, enabling digital processing and analysis. ADCs play a crucial role in signal conversion, measurement and data acquisition, control system input, and communication and signal processing. Their widespread application promotes the intelligent and precise control of electronic equipment across various industries, and is one of the key factors driving modern technological progress. Digital voltmeters and ammeters combine 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, serving as a powerful assistant in electronic design and troubleshooting, and playing a vital supporting role in the work of electronic engineers. In product applications, digital voltmeters ensure the accuracy and safety of circuit design, while also providing strong support for product quality control and subsequent maintenance. Learning to design and build a digital voltmeter and ammeter

using a benchtop digital multimeter (Agilent 34401A)
is highly beneficial for improving one's professional skills. This digital voltmeter and ammeter project covers multiple aspects, including microcontroller circuit design and implementation, signal acquisition and processing circuit design, user interface development and optimization, and product appearance design. It integrates knowledge from multiple fields such as electronics, microcontroller programming, circuit design, and industrial design. Considering the learning pace and knowledge absorption capacity of beginners, we have specially launched this introductory-level digital voltmeter and ammeter project, which is very suitable for beginners in electronics and those who want to learn more about microcontroller applications. This project has the following highlights:
it adopts a core board plus expansion board design concept and uses plug-in components, making learning simpler and exploration more in-depth;
the core board uses the domestic Wuhan Xinyuan Semiconductor CW32 as the main controller, while also being compatible with other similar development boards; however, the CW32 has advantages.
The project is highly comprehensive and practical, and after completion, it can be used as a desktop instrument;
the project has abundant learning materials, including circuit design tutorials, PCB design, code programming learning, and training for engineers' debugging skills.
II. Hardware Design
1. Power Supply Circuit

LDO (Low Dropout Linear Regulator) Selection This project uses an LDO as the power supply. Considering that most voltmeter products are used in industrial scenarios with 24V or 36V power supplies, the SE8550K2 with a maximum input voltage of up to 40V was selected as the power supply. The main reason for not using a DC-DC step-down circuit to handle the large voltage drop is to avoid introducing DC-DC ripple interference during the design process, and the secondary reason is to reduce project costs.
2. MCU Selection Analysis
To reduce the learning cost for everyone, this project uses the LCSC CW32F030C8Tx development board (core board) as the main controller, but this does not mean that we will talk less about this section. From the perspective of training engineers, the correct selection of the main controller is very important, as it relates to the overall advantage of the project. Regarding the voltmeter and current meter, the author used STM32/CW32 and some other 32-bit microcontrollers for some debugging and testing. This comparison is only with the STM32F103C8T6 as a reference for device selection, primarily aimed at providing ideas and improving understanding.
Avoid blind selection. When selecting an MCU (Microcontroller Unit) for this project, multiple aspects need to be considered to ensure the chosen MCU meets project requirements.
Clearly define your project needs: Understand the required computing power, including clock speed, processor core type, and whether a floating-point unit is needed.
Identify the required I/O ports and important peripherals, such as ADC peripherals. Since this is a development board project, primarily for debugging and learning, there are no strict limitations on the number of I/O ports: i.e., the associated costs are not considered.
Key advantages of the CW32 in this project
: Wide operating temperature range: -40~105℃;
Wide operating voltage range: 1.65V~5.5V (STM32 only supports 3.3V systems)
; Superior interference immunity: HBM ESD 8KV; All ESD reliability meets the highest international standard (STM32 ESD 2KV)
; Project focus - Better ADC: 12-bit high-speed ADC, achieving ±1.0LSB INL 11.3ENOB; Multiple Vref reference voltages... (STM32 only supports VDD=Vref);
Stable and reliable eFLASH technology.
A detailed explanation of these advantages will be provided in the chapters on ADC sampling and related extensions.
The main characteristics of the CW32 ADC: This project requires a focus on the 4 reference voltage sources. (Content from the "CW32x030 User Manual")

3. Voltage Sampling Circuit:
The voltage divider resistors in this project are designed to be 220K+10K, therefore the voltage division ratio is 22:1 (ADC_IN11).
The voltage divider resistor selection
is designed to measure the maximum voltage. For safety reasons, this project uses 30V (the actual maximum display value can be 99.9V or 100V).
The ADC reference voltage is 1.5V in this project, and this reference voltage can be configured through the program.
To reduce power consumption in the sampling circuit, the low-side resistor (R7) is typically chosen as 10K based on experience.
The high-side resistance of the voltage divider can then be calculated using the above parameters.
The required voltage division ratio is calculated as follows: ADC reference voltage: Design input voltage, calculated as 1.5V/30V = 0.05 using known parameters.
High-side resistance: Low-side resistance/voltage division ratio, calculated as 10K/0.05 = 200K using known parameters.
A standard resistor is selected: A resistor slightly higher than the calculated value of 200K is chosen. We typically choose E24 series resistors; therefore, in this project, 220K is chosen, which is greater than 200K and closest to the calculated value.
If, in actual use, the voltage to be measured is lower than 2/3 of the module's design voltage (66V), the voltage divider resistor can be replaced and the program modified to improve measurement accuracy. An example is provided below:
Assuming the measured voltage is no higher than 24V, and other parameters remain unchanged .
Calculations show that 1.5V/24V = 0.0625, and 10K/0.0625 = 160K. 160K is a standard E24 resistor and can be directly selected. Alternatively, a higher resistance value of 180K can be chosen to allow for some redundancy.
In practical applications, if the voltage to be measured is higher than the module's design voltage of 99V, the voltage divider resistor can be replaced, or the reference voltage can be modified to achieve a larger voltage measurement range. The following example illustrates this:
Assuming the measured voltage is 160V, the solution is to increase the voltage reference to expand the range.
Given that the voltage division ratio of the selected resistor is 0.0145, we can calculate 160V * 0.0145 = 2.32V using the formula. Therefore, we can choose a 2.5V voltage reference to increase the range (increasing the range will reduce accuracy).
Considering the potential fluctuations in the measured power supply, a 10nF filter capacitor is connected in parallel with the low-side voltage divider resistor in the circuit design to improve measurement stability. In this project, an additional voltage sampling circuit was
added
. Therefore, we can discuss the significance of range switching in improving measurement accuracy. To achieve more accurate measurements, multimeters often have multiple range settings. By adjusting different ranges, the optimal measurement accuracy of the measured point within the corresponding range can be obtained.
This project requires a combination of hardware and software to implement this function. When we first use the ADC_IN11 channel mentioned earlier to measure voltages below 30V, if the measured voltage is within 0~3V, then we use the ADC_IN9 channel for measurement. At this time, due to the reduced voltage division ratio, the measurement accuracy is greatly improved. There are many ways to implement range switching, and the development board design provides more design possibilities.
4. Current Sampling Circuit
This project uses a low-side current sampling circuit for current detection. When learning the common ground between the low-side of the sampling circuit and the development board's meter interface, please do not solder R0!!!

The design analysis
for this project involves a sampling current of 3A, and the selected sampling resistor (R0) is 100mΩ. The selection of the sampling resistor mainly needs to consider the following aspects:
the maximum value of the pre-designed measurement current;
the voltage difference caused by the 3A current sensing resistor in this project; and
the power dissipation of the current sensing resistor, which should generally not exceed 0.5V. A suitable package should be selected based on this parameter. Considering the power dissipation (temperature) issue under high current, a 1W metal wire-wound resistor package was chosen
. The voltage amplification factor across the current sensing resistor is also important. Since no operational amplifier is used to build the amplification circuit in this project, the factor is 1.
The current sensing resistor value can then be calculated using the above parameters
. Since no amplifier circuit is used, a larger sampling resistor is needed to obtain a higher measured voltage for measurement.
Considering that a larger resistor would result in a larger voltage drop and higher power consumption, an unlimited selection of a larger resistor is not feasible.
This project uses a 1W package resistor, corresponding to a power consumption of 1W.
Based on the above data, a 100mΩ current sensing resistor was selected. According to the formula, 3A * 100mΩ = 300mV, 900mW can be calculated.
To cope with different operating environments, especially high-current scenarios, the R0 resistor can be replaced with constantan wire or a shunt. The replacement can be selected according to the actual application scenario. For safety and educational purposes, this project will not discuss measurements exceeding 3A in detail, but the principle is the same.
5. Digital Tube Display
This project uses a digital tube as the display unit.

This project uses two 0.28-inch three-digit common-cathode LED displays as the display device. Compared to a display screen, LED displays offer better visibility in complex environments. The brightness of the LED displays can be increased by using smaller current-limiting resistors, depending on the specific needs of the application environment. Furthermore, LED displays have better mechanical properties and are not as easily damaged by external forces as display screens. They are widely used in industrial applications where stability and reliability are crucial. From a development board learning perspective, this makes it easier to learn electronic measurement principles and related development in a targeted manner.
In this project, actual testing showed that the current-limiting resistors (R1~R6) for the LED displays were configured to 300Ω. The corresponding brightness for both red and blue LED displays was good and the brightness was soft and not glaring.
Strictly speaking, the current-limiting resistors should be added to the segments; adding them to the digits would affect the display effect. Our actual design places them in the digits to save a few resistors, but the impact on the display is not significant. Therefore, we add them to the digits for convenience.
The

driving principle of LED displays mainly involves controlling the switching state of each segment of the LED display to display numbers, letters, or symbols. The following is a detailed explanation of the driving principle:
Basic Structure of a Digital Tube:
A digital tube typically consists of seven or eight LED segments (eight segments in this project). Each segment represents a part of the digital tube and can display numbers 0-9, letters AF, etc.
Digital tubes come in two types: common cathode and common anode. The difference lies in whether the common terminal COM (the end connecting all LEDs) is connected to the negative or positive terminal of the power supply.
Driving Methods:
Segment Selection: The desired number or character is displayed by controlling the on/off state of each segment of the digital tube. Each segment corresponds to a control signal; when the control signal is on, the segment lights up, and vice versa. (a, b, c, d, e, f, g, dp)
Bit Selection: The digital tube to be displayed is selected by controlling the bit lines of the digital tube. Bit line control sets the bit line of the digital tube to be displayed to a high level, and the bit lines of other digital tubes to a low level. By continuously switching the state of the bit lines, the display switching between multiple digital tubes can be achieved.
Driving Circuit:
The driving circuit for a digital tube can be implemented using hardware circuits, such as integrated circuits like digital signal processors (DSPs), microcontrollers (MCUs), or shift registers, to generate control signals suitable for the LEDs.
These control signals can be in the form of pulse width modulation (PWM) signals, serial data signals, etc. By controlling the frequency, width, and amplitude of these signals, the brightness of the digital tube can be controlled, thereby displaying the desired numbers or letters.
Software Control:
In addition to hardware driving circuits, the driving of digital tubes can also be implemented through software control. By programming to generate control signals suitable for the digital tubes, more flexible and complex display effects can be achieved, such as scrolling or alternating display of numbers.
Driving Common Cathode and Common Anode Digital Tubes:
For common cathode digital tubes, the common cathode pin is connected to the negative terminal of the power supply, and the control pin is connected to the output pin of the control chip. When a certain number needs to be displayed, the control chip outputs the corresponding encoded signal to the control pin, causing the corresponding LED segment to light up.
For common anode digital tubes, the working principle is similar to that of common cathode digital tubes, except that the common anode pin is connected to the positive terminal of the power supply, and the control pin is connected to the output pin of the control chip.
Encoded Display:
In order for the digital tube to display the corresponding numbers or characters, the segment data port must output the corresponding character encoding. For example, to display the number "0", the character code for a common anode LED display is 11000000B (i.e., C0H), while the character code for a common cathode LED display is 00111111B (i.e., 3FH). The specific code depends on the actual LED display.
Dynamic display vs. static display:
Digital tube displays can be static or dynamic. In static display, each of the eight segments of a digital tube is connected to an 8-bit I/O port address. As long as the I/O port outputs a segment code, the corresponding character is displayed and remains unchanged. Dynamic display, on the other hand, lights up each segment of the digital tube one by one in turn, achieving simultaneous visual display through rapid switching.
In summary, the driving principle of a digital tube is to control the switching state of each segment to display numbers, letters, or symbols, and to achieve display switching between multiple digital tubes through segment selection and digit selection. Simultaneously, the driving of the digital tubes can be implemented through hardware circuits or software control, and common cathode or common anode digital tubes can be selected as needed.
This project actually uses dynamic scanning display to drive the digital tubes.
Calculating the required current:
Since this project uses dynamic scanning display to drive the digital tubes, at any given time, only a maximum of eight segments of the digital tube (or LEDs) can be lit, or in other words, only one digit can be lit. According to the design, the required driving current is approximately 11mA (IO port high-level voltage 3.3V ÷ 300Ω).
At this point, it's important to ensure the selected MCU has sufficient current sinking/pull-up capability.


Analysis of the datasheet shows that the CW32 has no issues. (Some chips do not.)
6. LED Indicators:
This project includes an additional power indicator and an I/O operation indicator.

LD_PWR is the power indicator

. Since chip I/O often has a greater current sinking capability than a current pulling capability, LED1 is designed to be active low (on).
To reduce LED current consumption, some LED brightness is sacrificed, and the number of component parameters is reduced; the LED current-limiting resistor is chosen to be 10K.
7. Button Circuit Design:

There are various design methods for button control circuits. Thanks to the CW32's internal I/O ports which can be configured with pull-up and pull-down resistors, the external button control circuit does not require configuration. One end of the button is connected to the MCU's I/O, and the other end is grounded. When the button is pressed, the I/O is pulled low.
8. TL431 Circuit Design for Voltage Measurement and Calibration:
This project adds an extra TL431 circuit to provide a 2.5V reference voltage. This can be used to provide an external voltage reference for the chip to calibrate the AD converter. From a product design perspective, due to the inherent ADC performance advantages of the CW32, this circuit is not necessary. This circuit is designed on the development board to learn the relevant application principles.

The TL431 is a relatively "old" device, a classic, and widely used one, still found in many electronic products.
Many beginners may be encountering this device for the first time, so we will briefly explain its principles to help everyone better apply the TL431.
TI defines it as a "Precision Programmable Reference." On the first page of the references, we can focus on several key characteristics.
Precision: Precision indicates that its output voltage is very accurate. I used a ±0.5% accuracy TL431, which measured 2.495V on the board at room temperature. Compared to common Zener diodes, the accuracy is vastly different. In the application circuit diagram, the TL431 is represented by a Zener diode symbol.
Adjustable Output Voltage: The adjustable output voltage is between Vref and 36V. We use the output Vref voltage in our project. Vref voltage is approximately 2.5V. Therefore, we use 2.5V in the description, which is approximately equal to Vref.
Sinking Current Capability: This refers to how much current the output voltage pin can provide. This is greatly related to the resistance value (R13) in the application circuit. It should not be less than 1mA. If there is no need for sinking current, do not design the current to be too high, causing unnecessary power consumption.
Note: The description is sourced from "LCSC Development Board".
Voltmeter and Ammeter - a.jpg
Voltmeter and Ammeter - b.jpg
Voltmeter and Ammeter Video.mp4
Experiment 8: Simultaneous Acquisition and Display of Voltage and Current.rar
PDF_Geostationary Voltage and Current Meter.zip
Altium_Geostationary Voltage and Current Meter.zip
PADS_Geostationary Voltage and Current Meter.zip
BOM_Geographic Voltage and Current Meter.xlsx
92952
electronic