How to Build a Precision Digital Micro Current Meter with STM32

Share

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 Gerber File Precision Digital Micro Current MeterPCB Gerber ZIP File Precision Digital Micro Current Meter
 
ValueManufacturerDigiKey Part NumberDatasheet LinkQuantity
4.7uF 0603Samsung Electro-Mechanics1276-1784-1-ND

Datasheet

8
100nF 0603YAGEO311-1088-1-ND

Datasheet

3
2.2uF 0603Samsung Electro-Mechanics1276-1040-1-ND

Datasheet

2
10pF 0603Walsin Technology Corporation1292-1471-1-ND

Datasheet

2
Blue LEDHarvatek CorporationF1961NB--20C001714U1930

Datasheet

1
1N4148WDiodes Incorporated1N4148W-13FDICT-ND

Datasheet

2
AO3401AAlpha & Omega Semiconductor Inc.785-1001-1-ND

Datasheet

1
5K1YAGEO311-5.10KHRCT-ND

Datasheet

2
100KYAGEO311-100KHRCT-ND

Datasheet

4
CS1213AGF160CIT Relay and Switch2449-CS1213AGF160CT-ND

Datasheet

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

Datasheet

2
USB_C ReceptacleAssmann WSW Components123-A-USBC-20F0-EA-GSR11CT-ND

Datasheet

1
AO3400AAlpha & Omega Semiconductor Inc.785-1000-1-ND

Datasheet

1
L203111MS02QC&K108-L203111MS02Q-ND

Datasheet

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

Datasheet

1
LTC4054ES5-4.2-TRMPBFAnalog Devices Inc.505-LTC4054ES5-4.2#TRPBFCT-ND

Datasheet

1
ADPL44002AUJZ-2.5-R7Analog Devices Inc.505-ADPL44002AUJZ-2.5-R7CT-ND

Datasheet

1
MAX4239AUT+TAnalog Devices Inc.MAX4239AUT+TCT-ND

Datasheet

2
LMV321SN3T1GonsemiLMV321SN3T1GOSCT-ND

Datasheet

1
INA333AIDGKRTexas Instruments296-23564-1-ND

Datasheet

1
STM32G071KBU6STMicroelectronics497-18357-ND

Datasheet

1
Resistor 0.01ohm 0.1% 15ppm 2512VPG Foil ResistorsY14870R01000B9R

Datasheet

1
1K 0.05% 0603 10ppmSusumuRG16N1.0KWTR-ND

Datasheet

2
6K8 0.05% 0603 10ppmSusumuRG16N6.8KWTR-ND

Datasheet

2
2K2 0.05% 0603 10ppmSusumuRG16N2.2KWTR-ND

Datasheet

2
10K 0.05% 0603 10ppmSusumuRG16N10.0KWTR-ND

Datasheet

1
10R 0.05% 0805 10ppmStackpole Electronics IncRNCF0805AKT10R0-ND

Datasheet

1
100K 0.1% 0603SusumuRG16P100KBCT-ND

Datasheet

2
270R 1% 0603Stackpole Electronics IncRMCF0603FT270RCT-ND

Datasheet

3
470R 0603Panasonic Electronic ComponentsP470GCT-ND

Datasheet

1
2K 0603Panasonic Electronic ComponentsP2.0KDBCT-ND

Datasheet

1
Have any question related to this Article?