How to Build a Precision Digital Micro Current Meter with STM32

Published  September 24, 2025   
S Staff
Author



The Precision Digital Micro Current Meter is a purpose-built hardware solution designed to accurately measure extremely low current levels in embedded and battery-powered systems. At its core is the STM32G071KBU microcontroller, chosen for its robust ADC performance and peripheral flexibility. The current-sensing front includes high-precision shunt resistors selected for nanoamp, microamp, and milliamp ranges. These are paired with ultra-low offset operational amplifiers, notably the MAX4239 and the INA333 instrumentation amplifier, which ensure minimal burden voltage and accurate signal conditioning before being processed by the MCU. Power management and signal integrity are central to the design. A USB Type-C connector serves as the primary power input, compliant with the USB Type-C standard using pull-down resistors on the CC lines. The battery charging circuit utilizes an LTC4054 linear charger, while an ADP44002 LDO regulator delivers a clean 2.5V supply for analog and digital sections. The soft-latching power circuit, implemented using AO3401 and AO3400 MOSFETs, allows the device to power on or off through a single GPIO-controlled tactile button, supporting both manual and firmware-driven shutdown. Voltage supervision and precise analog references are handled via PA1 and PA2 pins, ensuring stable operation under variable supply conditions.

Display and user interface integration are streamlined using a 128x64 OLED module connected over I2C through PA9 and PA10, minimizing pin usage while offering crisp readouts. A DP3T selector switch provides manual control over the current measurement range, while a slide switch and tactile button interface complete the minimal yet functional front panel. The layout is organized to minimize analog noise coupling and maintain signal fidelity, with careful placement of ground planes, analog paths, and digital components. All hardware is assembled on a custom-designed PCB measuring approximately 45mm x 65mm. Designed using KiCad, the board supports both through-hole and surface-mount components. A custom 3D-printed enclosure houses the PCB, with provisions for display mounting, switch access, and battery accommodation. The enclosure not only enhances portability and durability but also gives the device a finished, user-friendly appearance suitable for bench-top or field use. This open hardware design packas in the complete schematics, layout files, and STL models to makes it an ideal tool and reference for engineers working on low-power electronic design.

Code File

Code and Schematics Precision Digital Micro Current MeterCode and Schematics Zip File Precision Digital Micro Current Meter

PCB Gerber File

PCB Geber File Precision Digital Micro Current MeterPCB Geber ZIP File Precision Digital Micro Current Meter
 
Value Manufacturer DigiKey Part Number Datasheet Link Quantity
4.7uF 0603 Samsung Electro-Mechanics 1276-1784-1-ND

Datasheet

8
100nF 0603 YAGEO 311-1088-1-ND

Datasheet

3
2.2uF 0603 Samsung Electro-Mechanics 1276-1040-1-ND

Datasheet

2
10pF 0603 Walsin Technology Corporation 1292-1471-1-ND

Datasheet

2
Blue LED Harvatek Corporation F1961NB--20C001714U1930

Datasheet

1
1N4148W Diodes Incorporated 1N4148W-13FDICT-ND

Datasheet

2
AO3401A Alpha & Omega Semiconductor Inc. 785-1001-1-ND

Datasheet

1
5K1 YAGEO 311-5.10KHRCT-ND

Datasheet

2
100K YAGEO 311-100KHRCT-ND

Datasheet

4
CS1213AGF160 CIT Relay and Switch 2449-CS1213AGF160CT-ND

Datasheet

1
JST Connector JST Sales America Inc. 455-1704-ND

Datasheet

2
USB_C Receptacle Assmann WSW Components 123-A-USBC-20F0-EA-GSR11CT-ND

Datasheet

1
AO3400A Alpha & Omega Semiconductor Inc. 785-1000-1-ND

Datasheet

1
L203111MS02Q C&K 108-L203111MS02Q-ND

Datasheet

1
TS02-66-90-BK-160-LCR-D Same Sky (Formerly CUI Devices) 2223-TS02-66-90-BK-160-LCR-D-ND

Datasheet

1
LTC4054ES5-4.2-TRMPBF Analog Devices Inc. 505-LTC4054ES5-4.2#TRPBFCT-ND

Datasheet

1
ADPL44002AUJZ-2.5-R7 Analog Devices Inc. 505-ADPL44002AUJZ-2.5-R7CT-ND

Datasheet

1
MAX4239AUT+T Analog Devices Inc. MAX4239AUT+TCT-ND

Datasheet

2
LMV321SN3T1G onsemi LMV321SN3T1GOSCT-ND

Datasheet

1
INA333AIDGKR Texas Instruments 296-23564-1-ND

Datasheet

1
STM32G071KBU6 STMicroelectronics 497-18357-ND

Datasheet

1
Resistor 0.01ohm 0.1% 15ppm 2512 VPG Foil Resistors Y14870R01000B9R

Datasheet

1
1K 0.05% 0603 10ppm Susumu RG16N1.0KWTR-ND

Datasheet

2
6K8 0.05% 0603 10ppm Susumu RG16N6.8KWTR-ND

Datasheet

2
2K2 0.05% 0603 10ppm Susumu RG16N2.2KWTR-ND

Datasheet

2
10K 0.05% 0603 10ppm Susumu RG16N10.0KWTR-ND

Datasheet

1
10R 0.05% 0805 10ppm Stackpole Electronics Inc RNCF0805AKT10R0-ND

Datasheet

1
100K 0.1% 0603 Susumu RG16P100KBCT-ND

Datasheet

2
270R 1% 0603 Stackpole Electronics Inc RMCF0603FT270RCT-ND

Datasheet

3
470R 0603 Panasonic Electronic Components P470GCT-ND

Datasheet

1
2K 0603 Panasonic Electronic Components P2.0KDBCT-ND

Datasheet

1