qoistoochee128

USB voltage and ammeter

 
Overview

Introduction

A USB voltage and current meter based on STM32 can easily see whether the charger is working in fast charging mode, and can also easily test the power consumption of USB devices or the output power of USB chargers.


Version update instructions

v1.1 - 2020/4/15

  • An automatic screen-off function is added. After detecting no current output for 20 seconds, the screen will automatically turn off to protect the OLED screen. After the screen is paused, the screen will automatically light up when current output is detected or a button is pressed manually.

characteristic

  • Based on STM32F030K6, the code is written using HAL library and GCC compiler

  • 0.91-inch white OLED display with clear display effect

  • Use low resistance sampling resistor (5mΩ) to prevent excessive internal resistance from affecting USB power supply efficiency

  • Supports a wide voltage range of 4.7~24V and current measurement of 0~5A

  • Can measure Vbus, D+, D- voltage, Vbus current. Support power display and energy calculation

  • Optional use of internal voltage reference source (Vref) or external voltage reference source (AZ431)

  • Software calibration function can ensure a certain accuracy after calibration.

  • Completely open source, you can add functions by yourself

    • -

Calibration instructions

This USB voltage and ammeter is designed with a software calibration function that can compensate for hardware deviations. When powering on, press and hold the button until "Prepare to calibrate~~~~" appears on the screen, then release the button to enter the calibration mode. Please follow the screen prompts to provide standard voltage and current to complete the calibration.


Code description

The code is a trueStudio project generated through STM32CubeMX. It is recommended to use trueStudio 9.3.0 to import and use.


Precautions

There are two types of USB female sockets, one with the internal contacts facing down (facing the pad) and the other with the internal contacts facing up (back to the pad). These two female sockets can use the same PCB package. If you have used a USB female socket with lower contacts, the female socket should be welded to the front of the board, otherwise it should be welded to the back of the board. The example picture uses a USB female socket with lower contacts, and the female socket with upper contacts is designed in the schematic diagram and PCB. Please pay attention to this when making.

Recommended mother seat:

  • Upper contact (soldered back): C265460
  • Lower contact (soldered front): C464564  (used in example picture)

Physical picture

IMG_3471.jpg

IMG_3473.jpg

IMG_3472.jpg

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-18 22:21:34

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号