battery-selector
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBattery Selector
电池选择器
Guides battery chemistry and charging circuit selection for embedded projects.
指导嵌入式项目的电池化学类型和充电电路选择。
Resources
资源
This skill includes bundled tools and references:
- scripts/compare_batteries.py - Battery comparison calculator with 15+ battery types
- references/safety-guidelines.md - Comprehensive safety guide for all chemistries
本技能包含配套工具和参考资料:
- scripts/compare_batteries.py - 支持15+种电池类型的电池对比计算器
- references/safety-guidelines.md - 涵盖所有电池化学类型的综合安全指南
Quick Start
快速开始
Interactive selection:
bash
uv run --no-project scripts/compare_batteries.py --interactiveCommand line:
bash
undefined交互式选择:
bash
uv run --no-project scripts/compare_batteries.py --interactive命令行模式:
bash
undefinedFind battery for 50mA project, 24h runtime
为50mA电流、24小时续航的项目寻找合适电池
uv run --no-project scripts/compare_batteries.py --current 50 --hours 24
uv run --no-project scripts/compare_batteries.py --current 50 --hours 24
Require rechargeable
要求可充电电池
uv run --no-project scripts/compare_batteries.py --current 100 --hours 12 --rechargeable
uv run --no-project scripts/compare_batteries.py --current 100 --hours 12 --rechargeable
List all batteries in database
列出数据库中所有电池
uv run --no-project scripts/compare_batteries.py --list
undefineduv run --no-project scripts/compare_batteries.py --list
undefinedWhen to Use
使用场景
- "What battery should I use?"
- "How do I charge this project?"
- "Lithium vs alkaline?"
- "Is this battery safe?"
- Planning portable/battery-powered projects
- “我应该用什么电池?”
- “如何为这个项目充电?”
- “锂电池 vs 碱性电池?”
- “这种电池安全吗?”
- 规划便携式/电池供电项目
Decision Flowchart
决策流程图
START
│
▼
Is project rechargeable? ──No──► Alkaline/Lithium Primary
│ (Disposable batteries)
Yes
│
▼
What voltage does MCU need?
│
├── 5V ──► LiPo + Boost converter
│ OR 3x/4x NiMH
│
├── 3.3V ──► Single LiPo (3.0-4.2V)
│ Directly compatible!
│
└── 12V+ ──► Multi-cell LiPo pack
OR Lead-acid
│
▼
How much current?
│
├── <50mA ──► Small LiPo (500-1000mAh)
│ OR Coin cell (CR2032)
│
├── 50-500mA ──► Standard LiPo (1000-3000mAh)
│ OR 18650 cells
│
└── >500mA ──► Large LiPo (3000mAh+)
OR Multiple 18650s
External power recommended开始
│
▼
项目是否需要可充电?──否──► 碱性/锂原电池
│ (一次性电池)
是
│
▼
MCU需要多少电压?
│
├── 5V ──► LiPo + 升压转换器
│ 或 3节/4节NiMH电池
│
├── 3.3V ──► 单节LiPo电池(3.0-4.2V)
│ 直接兼容!
│
└── 12V+ ──► 多节LiPo电池组
或铅酸电池
│
▼
项目电流需求是多少?
│
├── <50mA ──► 小型LiPo(500-1000mAh)
│ 或纽扣电池(CR2032)
│
├── 50-500mA ──► 标准LiPo(1000-3000mAh)
│ 或18650电池
│
└── >500mA ──► 大容量LiPo(3000mAh+)
或多节18650电池
建议使用外部电源Battery Chemistry Comparison
电池化学类型对比
Quick Reference
快速参考
| Chemistry | Voltage | Rechargeable | Energy Density | Cost | Safety |
|---|---|---|---|---|---|
| Alkaline | 1.5V/cell | No | Medium | Low | Very safe |
| Lithium Primary | 3V | No | High | Medium | Safe |
| NiMH | 1.2V/cell | Yes | Medium | Medium | Safe |
| LiPo/Li-ion | 3.7V | Yes | Very High | Medium | ⚠️ Needs care |
| LiFePO4 | 3.2V | Yes | High | High | Safer than LiPo |
| Lead-acid | 2V/cell | Yes | Low | Low | ⚠️ Acid hazard |
| 化学类型 | 电压 | 可充电 | 能量密度 | 成本 | 安全性 |
|---|---|---|---|---|---|
| 碱性电池 | 1.5V/节 | 否 | 中等 | 低 | 非常安全 |
| 锂原电池 | 3V | 否 | 高 | 中等 | 安全 |
| NiMH | 1.2V/节 | 是 | 中等 | 中等 | 安全 |
| LiPo/Li-ion | 3.7V | 是 | 极高 | 中等 | ⚠️ 需要注意安全 |
| LiFePO4 | 3.2V | 是 | 高 | 高 | 比LiPo更安全 |
| 铅酸电池 | 2V/节 | 是 | 低 | 低 | ⚠️ 存在酸液风险 |
Alkaline (AA/AAA/9V)
碱性电池(AA/AAA/9V)
Pros:
- Cheap, available everywhere
- No charging circuit needed
- Very safe
- Long shelf life (5-10 years)
Cons:
- Not rechargeable (e-waste!)
- Voltage drops as discharged
- Poor at high current
- Heavy for capacity
Best For:
- Low-power projects (<20mA average)
- Beginner projects
- Remote/deployment where charging impractical
- Backup power
Voltage Configurations:
Cells Voltage Use With
────────────────────────────
2x AA 3.0V 3.3V MCUs (with LDO)
3x AA 4.5V 5V MCUs (direct or LDO)
4x AA 6.0V 5V MCUs (with regulator)
9V 9.0V With 5V/3.3V regulator优点:
- 价格低廉,随处可得
- 无需充电电路
- 安全性极高
- 保质期长(5-10年)
缺点:
- 不可充电(产生电子垃圾!)
- 放电时电压下降
- 高电流性能差
- 相同容量下重量较大
最佳适用场景:
- 低功耗项目(平均电流<20mA)
- 新手项目
- 充电不便的偏远/部署场景
- 备用电源
电压配置:
电池节数 输出电压 适用场景
────────────────────────────
2节AA 3.0V 3.3V MCU(搭配LDO)
3节AA 4.5V 5V MCU(直接使用或搭配LDO)
4节AA 6.0V 5V MCU(搭配稳压器)
9V 9.0V 搭配5V/3.3V稳压器使用NiMH (AA/AAA Rechargeable)
NiMH(可充电AA/AAA)
Pros:
- Rechargeable (500-1000 cycles)
- Same size as alkaline
- Safer than lithium
- No memory effect
Cons:
- Lower voltage (1.2V vs 1.5V)
- Self-discharge (~20%/month)
- Need proper charger
- Heavier than LiPo
Best For:
- Projects replacing disposable batteries
- Educational settings
- Where LiPo is too risky
- Budget rechargeable solution
Charging:
- Use dedicated NiMH charger
- Don't mix brands/capacities
- Eneloop/Eneloop Pro recommended
优点:
- 可充电(500-1000次循环)
- 尺寸与碱性电池相同
- 比锂电池更安全
- 无记忆效应
缺点:
- 电压更低(1.2V vs 1.5V)
- 自放电率高(约20%/月)
- 需要专用充电器
- 比LiPo重量大
最佳适用场景:
- 替代一次性电池的项目
- 教育场景
- LiPo电池风险过高的场景
- 高性价比的可充电方案
充电注意事项:
- 使用专用NiMH充电器
- 不要混合不同品牌/容量的电池
- 推荐使用Eneloop/Eneloop Pro系列
LiPo / Li-ion (3.7V)
LiPo / Li-ion(3.7V)
Pros:
- High energy density (light + powerful)
- Rechargeable (300-500 cycles)
- Flat discharge curve
- Many form factors
Cons:
- ⚠️ Fire risk if abused
- Needs protection circuit
- Temperature sensitive
- Ages even unused
Best For:
- Most portable projects
- Weight-sensitive applications
- When you need runtime
- Professional builds
Critical Safety Rules:
✅ DO:
- Use protected cells with BMS
- Store at 40-60% charge
- Use proper TP4056/similar charger
- Monitor temperature during charge
- Use battery with JST-PH connector (prevents polarity swap)
❌ DON'T:
- Puncture, crush, or bend
- Charge below 0°C
- Discharge below 3.0V
- Leave charging unattended (first few times)
- Use damaged/puffy batteries优点:
- 能量密度高(轻便且功率强)
- 可充电(300-500次循环)
- 放电曲线平稳
- 多种外形规格
缺点:
- ⚠️ 滥用存在起火风险
- 需要保护电路
- 对温度敏感
- 即使未使用也会老化
最佳适用场景:
- 大多数便携式项目
- 对重量敏感的应用
- 需要长续航的场景
- 专业级项目
关键安全规则:
✅ 必须:
- 使用带BMS的保护型电池
- 以40-60%电量存储
- 使用专用TP4056或类似充电器
- 充电时监控温度
- 使用带JST-PH连接器的电池(防止极性接反)
❌ 禁止:
- 穿刺、挤压或弯折电池
- 在0°C以下充电
- 放电至3.0V以下
- 充电时无人看管(前几次充电)
- 使用损坏/鼓包的电池LiFePO4 (3.2V)
LiFePO4(3.2V)
Pros:
- Much safer than LiPo (no thermal runaway)
- Longer cycle life (2000+ cycles)
- Flat discharge curve
- Tolerates abuse better
Cons:
- Lower energy density
- Lower voltage (may need boost)
- More expensive
- Less common in small sizes
Best For:
- Safety-critical applications
- Outdoor/rugged deployments
- Long-term installations
- When LiPo risk unacceptable
优点:
- 比LiPo安全得多(无热失控风险)
- 循环寿命更长(2000+次)
- 放电曲线平稳
- 更耐受滥用
缺点:
- 能量密度较低
- 电压更低(可能需要升压)
- 价格更高
- 小尺寸规格较少
最佳适用场景:
- 安全关键型应用
- 户外/ rugged部署场景
- 长期安装项目
- LiPo风险不可接受的场景
CR2032 / Coin Cells
CR2032 / 纽扣电池
Pros:
- Tiny and light
- Long shelf life
- 3V output (direct to 3.3V MCU)
Cons:
- Very low capacity (220mAh)
- Poor high-current performance
- Not rechargeable
- ⚠️ Danger if swallowed
Best For:
- Ultra-low power only (<10µA average)
- RTC backup
- Tiny sensors
- Keyfobs, beacons
Current Limits:
Continuous: <2mA
Pulse: <15mA (brief)
DON'T use for: WiFi, Bluetooth, motors, LEDs优点:
- 体积小巧轻便
- 保质期长
- 3V输出(直接适配3.3V MCU)
缺点:
- 容量极低(220mAh)
- 高电流性能差
- 不可充电
- ⚠️ 误食危险
最佳适用场景:
- 仅适用于超低功耗(平均电流<10µA)
- RTC备用电源
- 微型传感器
- 钥匙扣、信标
电流限制:
持续电流:<2mA
脉冲电流:<15mA(短时间)
禁止用于:WiFi、蓝牙、电机、LEDVoltage Regulation
电压调节
3.3V Systems (ESP32, RP2040)
3.3V系统(ESP32, RP2040)
Single LiPo → 3.3V:
LiPo outputs 3.0-4.2V
Most 3.3V MCUs tolerate this range directly!
Option 1: Direct connection (if MCU allows)
LiPo(+) → 3.3V/VIN pin
Option 2: LDO for clean 3.3V
LiPo(+) → [AMS1117-3.3] → 3.3V pin
(Need 4V min input for AMS1117)
Better: Use HT7333 LDO (low dropout, low quiescent)
Works from 3.3V input!单节LiPo → 3.3V:
LiPo输出3.0-4.2V
大多数3.3V MCU可直接耐受此电压范围!
方案1:直接连接(如果MCU支持)
LiPo(+) → 3.3V/VIN引脚
方案2:使用LDO获得稳定3.3V
LiPo(+) → [AMS1117-3.3] → 3.3V引脚
(AMS1117需要至少4V输入)
更佳选择:使用HT7333 LDO(低压差、低静态电流)
可从3.3V输入开始工作!5V Systems (Arduino UNO/Nano)
5V系统(Arduino UNO/Nano)
LiPo → 5V:
Option 1: Boost converter
LiPo(+) → [MT3608] → 5V → VIN pin
Option 2: PowerBoost module (Adafruit)
Includes charging + boost + protection
Option 3: USB power bank
Already regulated 5V + charging built-inLiPo → 5V:
方案1:升压转换器
LiPo(+) → [MT3608] → 5V → VIN引脚
方案2:Adafruit PowerBoost模块
集成充电+升压+保护功能
方案3:USB移动电源
已内置稳压5V输出和充电功能Charging Solutions
充电方案
TP4056 Module (Most Popular)
TP4056模块(最常用)
┌─────────────────────────────┐
│ TP4056 with Protection │
│ │
│ [USB-C] ─► [TP4056] ─► [DW01+FS8205] ─► [B+/B-]
│ IN Charger Protection To Battery
│ │
│ Features: │
│ - 1A max charge current │
│ - Overcharge protection │
│ - Overdischarge protect │
│ - Short circuit protect │
│ - LED charge indicator │
└─────────────────────────────┘
Wiring:
B+ → LiPo positive
B- → LiPo negative
OUT+ → Load/MCU positive
OUT- → Load/MCU negative⚠️ Get module WITH protection (6 pins, not 4 pins)
┌─────────────────────────────┐
│ 带保护电路的TP4056 │
│ │
│ [USB-C] ─► [TP4056] ─► [DW01+FS8205] ─► [B+/B-]
│ 输入 充电器 保护电路 连接电池
│ │
│ 特性: │
│ - 最大1A充电电流 │
│ - 过充保护 │
│ - 过放保护 │
│ - 短路保护 │
│ - LED充电指示灯 │
└─────────────────────────────┘
接线方式:
B+ → LiPo正极
B- → LiPo负极
OUT+ → 负载/MCU正极
OUT- → 负载/MCU负极⚠️ 务必选择带保护电路的模块(6引脚,而非4引脚)
Adafruit PowerBoost 500C/1000C
Adafruit PowerBoost 500C/1000C
Premium solution with:
- LiPo charging via USB
- 5V boost output (500mA or 1A)
- Low battery indicator
- Load sharing (charge while running)
高端解决方案,具备:
- USB接口LiPo充电
- 5V升压输出(500mA或1A)
- 低电量指示灯
- 负载共享(充电时可同时运行设备)
DIY Charging Don'ts
DIY充电禁止事项
❌ Never charge LiPo with a constant voltage supply
❌ Never charge LiPo with a phone charger directly
❌ Never charge at >1C rate (e.g., 1000mAh → max 1A)
❌ Never charge frozen batteries❌ 切勿用恒压电源给LiPo充电
❌ 切勿直接用手机充电器给LiPo充电
❌ 充电电流切勿超过1C倍率(例如1000mAh电池→最大1A)
❌ 切勿给冷冻的电池充电Battery Sizing Calculator
电池容量计算方法
Step 1: Determine average current (from power-budget-calculator)
I_avg = _____ mA
Step 2: Determine required runtime
T_required = _____ hours
Step 3: Calculate minimum capacity
C_min = I_avg × T_required × 1.25 (safety factor)
C_min = _____ × _____ × 1.25
C_min = _____ mAh
Step 4: Select battery
Choose capacity ≥ C_min
Consider: size, weight, form factorExample:
Project: Weather station
I_avg: 15mA
T_required: 48 hours (2 days between charges)
C_min = 15 × 48 × 1.25 = 900mAh
Selection: 1000mAh LiPo (gives ~67 hours actual)步骤1:确定平均电流(来自功率预算计算器)
I_avg = _____ mA
步骤2:确定所需续航时间
T_required = _____ 小时
步骤3:计算最小容量
C_min = I_avg × T_required × 1.25(安全系数)
C_min = _____ × _____ × 1.25
C_min = _____ mAh
步骤4:选择电池
选择容量≥C_min的电池
考虑:尺寸、重量、外形规格示例:
项目:气象站
I_avg: 15mA
T_required: 48小时(每2天充电一次)
C_min = 15 × 48 × 1.25 = 900mAh
选择:1000mAh LiPo(实际续航约67小时)Common Mistakes
常见错误
1. Using Wrong Charger
1. 使用错误的充电器
❌ "My 9V adapter should work"
LiPo needs CC-CV charging at 4.2V max!
✅ Use TP4056 or dedicated LiPo charger❌ “我的9V适配器应该可以用”
LiPo需要恒流-恒压充电,最大电压4.2V!
✅ 使用TP4056或专用LiPo充电器2. No Low-Voltage Cutoff
2. 无低压截止保护
❌ Draining LiPo below 3.0V
Permanently damages the cell!
✅ Use protection module OR monitor in code:
if (batteryVoltage < 3.2) {
enterDeepSleep(); // Protect battery
}❌ 将LiPo放电至3.0V以下
会永久损坏电池!
✅ 使用保护模块或在代码中监控:
if (batteryVoltage < 3.2) {
enterDeepSleep(); // 保护电池
}3. Ignoring Inrush Current
3. 忽略浪涌电流
❌ Battery can't handle WiFi TX spike (500mA)
Causes brownout/reset
✅ Add 100-470µF capacitor near MCU
✅ Size battery for peak current, not just average❌ 电池无法承受WiFi发射峰值电流(500mA)
会导致掉电/复位
✅ 在MCU附近添加100-470µF电容
✅ 按峰值电流而非平均电流选择电池4. No Reverse Polarity Protection
4. 无反接保护
❌ Swapping battery wires = magic smoke
✅ Use JST-PH connectors (keyed)
✅ Add protection diode or P-FET❌ 电池线接反=冒烟损坏
✅ 使用带防呆设计的JST-PH连接器
✅ 添加保护二极管或P-FETRecommended Setups by Project Type
按项目类型推荐配置
Low-Power Sensor Node
低功耗传感器节点
Battery: 18650 (3000mAh) or LiPo 2000mAh
MCU: ESP32 with deep sleep
Charger: TP4056 with protection
Runtime: Weeks to months电池:18650(3000mAh)或2000mAh LiPo
MCU:带深度睡眠的ESP32
充电器:带保护电路的TP4056
续航:数周至数月Handheld Device
手持设备
Battery: LiPo 1000-2000mAh flat pack
MCU: Any
Charger: PowerBoost or TP4056 + boost
Runtime: Hours to days电池:1000-2000mAh扁平LiPo
MCU:任意型号
充电器:PowerBoost或TP4056+升压转换器
续航:数小时至数天Robot/High Current
机器人/高电流项目
Battery: 2S or 3S LiPo pack (7.4V or 11.1V)
Regulator: Buck converter to 5V
Charger: Balance charger (external)
Runtime: Minutes to hours电池:2S或3S LiPo电池组(7.4V或11.1V)
稳压器:降压转换器至5V
充电器:外置平衡充电器
续航:数分钟至数小时Ultra-Low Power Beacon
超低功耗信标
Battery: CR2032 or 2x AA
MCU: ESP32-C3 or ATtiny with deep sleep
No charger needed
Runtime: Months to years电池:CR2032或2节AA电池
MCU:带深度睡眠的ESP32-C3或ATtiny
无需充电器
续航:数月至数年Quick Selection Table
快速选型表
| Project Type | Best Battery | Capacity | Charger |
|---|---|---|---|
| Simple Arduino | 4x AA | 2500mAh | None |
| ESP32 portable | 18650 | 2600mAh | TP4056 |
| Wearable | Small LiPo | 500mAh | TP4056 |
| Robot | 2S LiPo | 2200mAh | Balance |
| Ultra-low power | CR2032 | 220mAh | None |
| Solar project | LiFePO4 | 3200mAh | MPPT |
| 项目类型 | 推荐电池 | 容量 | 充电器 |
|---|---|---|---|
| 简易Arduino项目 | 4节AA电池 | 2500mAh | 无需 |
| 便携式ESP32项目 | 18650电池 | 2600mAh | TP4056 |
| 可穿戴设备 | 小型LiPo | 500mAh | TP4056 |
| 机器人 | 2S LiPo | 2200mAh | 平衡充电器 |
| 超低功耗项目 | CR2032 | 220mAh | 无需 |
| 太阳能项目 | LiFePO4 | 3200mAh | MPPT充电器 |