a0aLSBK

Voltage and current meter based on CW32F030

 
Overview
This design utilizes a CW32F030-based voltmeter and ammeter to measure voltage and current, and provides voltage calibration. The hardware design employs the JLCPCB EDA Professional Edition.
Background:
ADCs (Analog-to-Digital Converters) are indispensable components in electronic systems, converting 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 a key factor 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 intuitive 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 significantly supporting 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.
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 based on the maximum measured voltage; for safety reasons, this project uses 30V (the actual maximum display value can be 99.9V or 100V).
The ADC reference voltage in this project is 1.5V, which can be configured through the program.
To reduce power consumption in the sampling circuit, the low-side resistor (R7) is usually selected as 10K based on experience.

The high-side resistance of the voltage divider resistors can then be calculated using the above parameters.

The required voltage division ratio is calculated as follows: ADC reference voltage: Design input voltage, calculated using known parameters as 1.5V/30V=0.05.
The high-side resistance is calculated as: Low-side resistance/voltage division ratio, calculated using known parameters as 10K/0.05=200K.
A standard resistor is selected: A resistor slightly higher than the calculated value is chosen; the calculated value is 200K. We usually choose E24 series resistors, therefore in this project, 220K is selected, 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. 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, you can choose to replace the voltage divider resistor or modify the reference voltage. Here's a case study:

Assuming the measured voltage is 160V, we can choose 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 to improve measurement stability. This
is my first time doing hardware design, so the PCB layout is not very efficient and it's not very convenient to use.
Photos of the finished product are below;  
firmware and a demonstration video are attached below.
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2026-03-28 06:02:31

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号