更新项目说明

This commit is contained in:
不吃油炸鸡
2026-02-21 17:44:12 +08:00
parent 9235a864e1
commit 640d70a364
17 changed files with 381 additions and 2 deletions

192
README.md
View File

@@ -1,3 +1,191 @@
# Power-Pico
文件夹分层结构:
<p align="right">
<b>中文</b> | <a href="./README_EN.md">English</a>
</p>
<div align="center">
<h1 align="center">Power-Pico</h1>
<p align="center">一款产品级的便携式 USB 电流表与低功耗测量分析仪</p>
<img src="https://img.shields.io/badge/Version-1.0.0-blue">
<img src="https://img.shields.io/badge/License-GPL3.0-green">
<img src="https://img.shields.io/badge/MCU-STM32F411-lightblue">
<img src="https://img.shields.io/badge/UI-LVGL_v8.3-red">
<img src="https://img.shields.io/badge/OS-FreeRTOS-green">
<br>
<img src="https://img.shields.io/github/stars/kingham/Power-Pico?style=flat-square">
<img src="https://img.shields.io/github/forks/kingham/Power-Pico?style=flat-square">
</div>
---
## 📖 项目简介
**Power-Pico** 不仅仅是一个 USB 电流表。它是专为嵌入式开发者设计的**高精度低功耗分析工具**。针对传统电流表在 $\mu A$ 级别测量时的物理局限性Power-Pico 采用了创新的**多档位自动切换采样**设计,实现了从 $1\mu A$ 到 $5A$ 的全量程覆盖。
<div style="margin-top:20px;text-align:center">
<img src="./images/main2316.png" style="width:75%;border-radius:16px;box-shadow:0 8px 24px rgba(0,0,0,0.1);display:inline-block" alt="展示图" />
</div>
### ✨ 核心特性
- **uA 级高精度**:采用 INA190 零漂移放大器,配合三档电阻分段采样。
- **协议诱骗**:支持 PD2.0 PPS 协议诱骗,最高支持 20V/5A 诱骗输出。
- **高性能 UI**:基于 STM32F411 + LVGL v9.2,提供丝滑的实时波形显示。
- **跨平台上位机**:配套 PySide6 开发的 Power-Pico Client支持数据导出与实时功耗分析。
- **3D打印外壳**:提供完整的 3D 打印外壳与亚克力面板设计方案。
---
## 🛠️ 硬件参数分析
| 模块 | 选型 | 优势 |
| :--- | :--- | :--- |
| **主控** | STM32F411CEU6 | 100MHz 高主频,支持 DSP 指令加速波形处理 |
| **电流采样** | INA190 | 0.5nA 输入偏置电流μA 级测量的核心保证 |
| **ADC** | 12-bit (STM32 Internal) | 配合 DMA 实现 10kHz 以上的高速稳定采样 |
| **屏幕** | 1.54" TFT (ST7789) | 240x240 分辨率,高对比度显示 |
---
## 🚀 快速复刻
### 1.硬件
自行焊接硬件,或购买淘宝已经焊接组装好的套件
立创开源界面https://oshwhub.com/no_chicken/powerpico
### 2. 固件自行编译烧录
项目基于 Keil MDK 开发:
1. 克隆仓库:`git clone https://github.com/kingham/Power-Pico.git`
2. SWD口烧录BootLoader
3. 自行编译PowerPico编译好生成的`.bin`文件再使用PowerPico Client烧录即可
### 3. 结构组装
实物组装如下图所示:
3D爆炸图如下图所示:
<div style="display:flex;gap:15px;justify-content:center;align-items:center;margin-bottom:20px">
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/boom.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="3D爆炸左侧图" />
</div>
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/boom.gif" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="3D爆炸右侧图" />
</div>
</div>
### 4. 上位机运行
安装PowerPico Client使用即可目前只支持window。
## 🛠️ 使用说明
1. 硬件操作说明
Power-Pico的按键操作说明和各个界面展示如下图所示。顶部按键为 **换页/Boot** 按键长按住顶部按键再上电会直接进入Boot模式强制升级模式。
Power-Pico硬件目前只支持 **中文简体/English** 2种语言。
<div style="display:flex;gap:15px;justify-content:center;align-items:center;margin-bottom:20px">
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/key_func.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="按键说明图" />
</div>
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/startup_page.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="开机界面图" />
</div>
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/main_page.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="main界面图" />
</div>
</div>
<div style="display:flex;gap:15px;justify-content:center;align-items:center;margin-bottom:20px">
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/set_page.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="设置界面图" />
</div>
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/pps_page1.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="PPS界面1" />
</div>
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/pps_page2.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="PPS界面2" />
</div>
</div>
2. 客户端操作说明
PowerPico Client电脑客户端可以用于波形查看、记录、导出能够进行对下位机硬件的固件升级。客户端目前支持 **中文简体/中文繁体/English/日本語** 4种语言。
PowerPico Client客户端上位机的具体使用方法详见[客户端操作说明](https://no-chicken.com/content/Power-Pico/UserManual/client_operation.html)
<div style="display:flex;gap:15px;justify-content:center;align-items:center;margin-bottom:20px">
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/wave_client1.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="波形界面图" />
</div>
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/firmware_client.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="固件升级界面" />
</div>
<div style="display:flex;gap:15px;justify-content:center;align-items:center;margin-bottom:20px">
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;box-shadow:0 4px 12px rgba(0,0,0,0.1);background:rgba(255,255,255,0.3);min-height:200px">
<img src="./images/wave_client2.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="波形界面图2" />
</div>
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;box-shadow:0 4px 12px rgba(0,0,0,0.1);background:rgba(255,255,255,0.3);min-height:200px">
<img src="./images/set_client.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="设置界面" />
</div>
</div>
## 📂 项目结构
```text
Power-Pico/
├── Firmware/ # 固件包括BootLoader.hex和App.bin
├── Hardware/ # 原理图
├── 3D models/ # STL文件用于3D打印外壳
└── Software/ # PowerPico的MDK软件工程包括BootLoader和App
```
## 💻代码框架
跟以前的项目一样,采用了 BootLoader + App 的结构方便USB升级。程序分区如下图所示。
<ul>
<li>起始的sector0,1,2的48kB区域为BootLoader区域</li>
<li>第3个sector的16kB区域为升级信息区域用于开机校检App完整性具体的校检内容详见BootLoader代码</li>
<li>从0x08010000第4个扇区开始后的区域都为App区域之所以不做AB分区是片上Flash不够</li>
</ul>
<div style="margin-top:20px;text-align:center">
<img src="./images/flash.png" style="width:75%;border-radius:16px;box-shadow:0 8px 24px rgba(0,0,0,0.1);display:inline-block" alt="flash分区图" />
</div>
使用USB进行高速数据传输数据包组成如下图所示。每个数据包100组数据加上头共计711Bytes。
<div style="margin-top:20px;text-align:center">
<img src="./images/protocol.png" style="width:100%;border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,0.1);display:inline-block" alt="数据包结构图" />
</div>
📖 参考资料
<ul>
<li style="margin-bottom:8px"><a href="https://github.com/ryan-ma/PD_Micro">[1] PD_Micro - ATMega32U4 Arduino板上的USB-C PD3.0 PPS</a></li>
<li style="margin-bottom:8px"><a href="https://wiki.luatos.com/iotpower/cc/index.html">[2] 合宙 Power CC 外壳结构</a></li>
<li style="margin-bottom:8px"><a href="https://doc.qt.io/qtforpython-6/PySide6/QtWidgets/index.html">[3] PySide6手册</a></li>
<li style="margin-bottom:8px"><a href="https://qfluentwidgets.com/zh/pages/about">[4] QFluentWidgets - 让QT再次伟大</a></li>
<li style="margin-bottom:8px"><a href="https://pyqtgraph.readthedocs.io/en/latest/getting_started/index.html">[5] PyQtGraph 使用手册</a></li>
<li style="margin-bottom:8px"><a href="https://www.st.com/en/development-tools/stsw-stm32102.html">[6] STM32 USB 虚拟串口driver案例</a></li>
<li style="margin-bottom:8px"><a href="https://github.com/lvgl/lvgl">[7] LVGL - Embedded graphics library </a></li>
</ul>
🤝 提交共享
欢迎提交 Issue 或 Pull Request 来增加项目功能或修改代码bug!!

191
README_EN.md Normal file
View File

@@ -0,0 +1,191 @@
<p align="right">
<a href="./README.md">中文</a> | <b>English</b>
</p>
<div align="center">
<h1 align="center">Power-Pico</h1>
<p align="center">A Product-Grade Portable USB Ammeter and Low-Power Measurement Analyzer</p>
<img src="https://img.shields.io/badge/Version-1.0.0-blue">
<img src="https://img.shields.io/badge/License-GPL3.0-green">
<img src="https://img.shields.io/badge/MCU-STM32F411-lightblue">
<img src="https://img.shields.io/badge/UI-LVGL_v8.3-red">
<img src="https://img.shields.io/badge/OS-FreeRTOS-green">
<br>
<img src="https://img.shields.io/github/stars/kingham/Power-Pico?style=flat-square">
<img src="https://img.shields.io/github/forks/kingham/Power-Pico?style=flat-square">
</div>
---
## 📖 Project Introduction
**Power-Pico** is more than just a USB ammeter. It is a **high-precision, low-power analysis tool** designed specifically for embedded developers. To overcome the physical limitations of traditional ammeters in the μA-level measurement, Power-Pico adopts an innovative **multi-range auto-switching sampling** design, achieving full-range coverage from $1\mu A$ to $5A$.
<div style="margin-top:20px;text-align:center">
<img src="./images/main2316.png" style="width:75%;border-radius:16px;box-shadow:0 8px 24px rgba(0,0,0,0.1);display:inline-block" alt="Display" />
</div>
### ✨ Core Features
- **μA-Level High Precision**: Utilizes the INA190 zero-drift amplifier with three-resistor segmented sampling.
- **Protocol Trigger**: Supports PD2.0 PPS protocol triggering, with up to 20V/5A output.
- **High-Performance UI**: Based on STM32F411 + LVGL v8.3, providing a smooth real-time waveform display.
- **Cross-Platform PC Client**: Comes with the Power-Pico Client developed with PySide6, supporting data export and real-time power analysis.
- **3D Printed Enclosure**: Provides a complete design for a 3D printed enclosure and acrylic panel.
---
## 🛠️ Hardware Parameter Analysis
| Module | Model | Advantage |
| :--- | :--- | :--- |
| **MCU** | STM32F411CEU6 | 100MHz high frequency, supports DSP instructions to accelerate waveform processing |
| **Current Sensing** | INA190 | 0.5nA input bias current, the core guarantee for μA-level measurement |
| **ADC** | 12-bit (STM32 Internal) | Achieves high-speed stable sampling above 10kHz with DMA |
| **Screen** | 1.54" TFT (ST7789) | 240x240 resolution, high-contrast display |
---
## 🚀 Quick Replication
### 1. Hardware
Solder the hardware yourself, or purchase a pre-soldered and assembled kit from Taobao.
LCSC Open Source Hub page: https://oshwhub.com/no_chicken/powerpico
### 2. Firmware Compilation and Flashing
The project is developed based on Keil MDK:
1. Clone the repository: `git clone https://github.com/kingham/Power-Pico.git`
2. Flash the BootLoader via the SWD port.
3. Compile PowerPico yourself. The generated `.bin` file can then be flashed using the PowerPico Client.
### 3. Assembly
The physical assembly is shown in the figure below:
The exploded 3D view is as follows:
<div style="display:flex;gap:15px;justify-content:center;align-items:center;margin-bottom:20px">
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/boom.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="3D Exploded View Left" />
</div>
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/boom.gif" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="3D Exploded View Right" />
</div>
</div>
### 4. Running the PC Client
Install and use the PowerPico Client. Currently, it only supports Windows.
## 🛠️ User Guide
1. Hardware Operation
The button operations and various interface displays of Power-Pico are shown below. The top button is the **Page Switch/Boot** button. Press and hold the top button before powering on to enter Boot mode for a forced firmware upgrade.
The Power-Pico hardware currently supports 2 languages: **Simplified Chinese/English**.
<div style="display:flex;gap:15px;justify-content:center;align-items:center;margin-bottom:20px">
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/key_func.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="Button Functions" />
</div>
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/startup_page.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="Startup Page" />
</div>
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/main_page.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="Main Page" />
</div>
</div>
<div style="display:flex;gap:15px;justify-content:center;align-items:center;margin-bottom:20px">
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/set_page.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="Settings Page" />
</div>
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/pps_page1.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="PPS Page 1" />
</div>
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/pps_page2.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="PPS Page 2" />
</div>
</div>
2. Client Operation
The PowerPico Client for PC can be used for waveform viewing, recording, exporting, and upgrading the firmware of the hardware. The client currently supports 4 languages: **Simplified Chinese/Traditional Chinese/English/Japanese**.
For detailed instructions on using the PowerPico Client, please refer to: [Client Operation Manual](https://no-chicken.com/content/Power-Pico/UserManual/client_operation.html)
<div style="display:flex;gap:15px;justify-content:center;align-items:center;margin-bottom:20px">
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/wave_client1.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="Waveform Interface" />
</div>
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;">
<img src="./images/firmware_client.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="Firmware Upgrade Interface" />
</div>
</div>
<div style="display:flex;gap:15px;justify-content:center;align-items:center;margin-bottom:20px">
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;box-shadow:0 4px 12px rgba(0,0,0,0.1);background:rgba(255,255,255,0.3);min-height:200px">
<img src="./images/wave_client2.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="Waveform Interface 2" />
</div>
<div style="flex:1;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;box-shadow:0 4px 12px rgba(0,0,0,0.1);background:rgba(255,255,255,0.3);min-height:200px">
<img src="./images/set_client.png" style="max-width:100%;max-height:100%;width:auto;height:auto;display:block" alt="Settings Interface" />
</div>
</div>
## 📂 Project Structure
```text
Power-Pico/
├── Firmware/ # Firmware, including BootLoader.hex and App.bin
├── Hardware/ # Schematics
├── 3D models/ # STL files for 3D printing the enclosure
└── Software/ # MDK software project for PowerPico, including BootLoader and App
```
## 💻 Code Framework
Similar to previous projects, it uses a BootLoader + App structure for easy USB upgrades. The program partitioning is shown below.
<ul>
<li>The initial 48kB area of sectors 0, 1, and 2 is the BootLoader area.</li>
<li>The 16kB area of the 3rd sector is the upgrade information area, used for verifying the integrity of the App on startup. For specific verification details, see the BootLoader code.</li>
<li>The area starting from the 4th sector at 0x08010000 is the App area (A/B partitioning is not used due to insufficient on-chip Flash).</li>
</ul>
<div style="margin-top:20px;text-align:center">
<img src="./images/flash.png" style="width:75%;border-radius:16px;box-shadow:0 8px 24px rgba(0,0,0,0.1);display:inline-block" alt="Flash Partitioning" />
</div>
High-speed data transmission is performed via USB. The data packet structure is shown below. Each packet contains 100 data sets, totaling 711 bytes including the header.
<div style="margin-top:20px;text-align:center">
<img src="./images/protocol.png" style="width:100%;border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,0.1);display:inline-block" alt="Data Packet Structure" />
</div>
📖 References
<ul>
<li style="margin-bottom:8px"><a href="https://github.com/ryan-ma/PD_Micro">[1] PD_Micro - USB-C PD3.0 PPS on ATMega32U4 Arduino board</a></li>
<li style="margin-bottom:8px"><a href="https://wiki.luatos.com/iotpower/cc/index.html">[2] IoT Power-CC 3D printed shell structure</a></li>
<li style="margin-bottom:8px"><a href="https://doc.qt.io/qtforpython-6/PySide6/QtWidgets/index.html">[3] PySide6 user manual</a></li>
<li style="margin-bottom:8px"><a href="https://qfluentwidgets.com/zh/pages/about">[4] QFluentWidgets - Make QT Great Again</a></li>
<li style="margin-bottom:8px"><a href="https://pyqtgraph.readthedocs.io/en/latest/getting_started/index.html">[5] PyQtGraph user manual</a></li>
<li style="margin-bottom:8px"><a href="https://www.st.com/en/development-tools/stsw-stm32102.html">[6] STM32 USB vitual serial port driver demo</a></li>
<li style="margin-bottom:8px"><a href="https://github.com/lvgl/lvgl">[7] LVGL - Embedded graphics library </a></li>
</ul>
🤝 Contribute
Welcome to submit Issues or Pull Requests to add new features to the project or fix code bugs!!

BIN
images/boom.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 KiB

BIN
images/boom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

BIN
images/firmware_client.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

BIN
images/flash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
images/key_func.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 KiB

BIN
images/main2316.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 MiB

BIN
images/main_page.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

BIN
images/pps_page1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
images/pps_page2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
images/protocol.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

BIN
images/set_client.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

BIN
images/set_page.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
images/startup_page.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

BIN
images/wave_client1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 KiB

BIN
images/wave_client2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB