component-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Component Search

元件搜索

Find and add components, modules, and reference designs to a Zener project. Use this workflow any time you need a part or subcircuit that isn't already in the workspace or covered by stdlib generics.
在Zener项目中查找并添加元件、模块及参考设计。当工作区中没有所需的元件或子电路,且标准库通用元件也无法满足需求时,即可使用此工作流程。

Search Priority

搜索优先级

Always search in this order. Move down only when the higher tier doesn't have what fits.
  1. pcb search -m registry:modules <query> -f json
    — Pre-designed, validated subcircuits (modules and reference designs). Best option: the design work is already done, with passives, layout, and validation included.
  2. pcb search -m registry:components <query> -f json
    — Pre-packaged component definitions in the registry. Good: symbol, footprint, and
    .zen
    file already exist and are ready to use.
  3. pcb search -m web:components <MPN> -f json
    — Diode's web component database (CSE, LCSC sources). Fallback: returns a
    component_id
    that must be imported with
    pcb new component
    .
If the user asks for a specific MPN, still try registry first before falling back to web.
请始终按照以下顺序进行搜索。只有当更高优先级的层级无法找到合适的内容时,才向下进行。
  1. pcb search -m registry:modules <query> -f json
    —— 预先设计并经过验证的子电路(模块和参考设计)。这是最佳选择:设计工作已完成,包含无源器件、布局及验证内容。
  2. pcb search -m registry:components <query> -f json
    —— 注册表中预先打包的元件定义。优势:符号、封装及
    .zen
    文件已存在,可直接使用。
  3. pcb search -m web:components <MPN> -f json
    —— Diode的网络元件数据库(来源为CSE、LCSC)。备选方案:返回一个
    component_id
    ,需通过
    pcb new component
    命令导入。
如果用户指定了具体的MPN,仍需先尝试注册表搜索,再降级使用网络搜索。

Search Tips

搜索技巧

  • Registry search is richly indexed — it supports MPN search, manufacturer name search, semantic/functional queries, and lexical keyword matching. Use descriptive queries freely:
    "buck converter 3.3V"
    ,
    "Texas Instruments LDO"
    ,
    "USB-C connector"
    .
  • Web components search is strict MPN-only. Only use exact or partial manufacturer part numbers:
    "TPS54331"
    ,
    "STM32F103C8T6"
    . Do NOT include descriptions, keywords, or functional terms in the query — they will cause the search to fail or return irrelevant results. Strip everything except the MPN.
  • All commands output JSON with
    -f json
    . Parse results programmatically to evaluate options.
  • Registry results include
    dependencies
    (what they use) and
    dependents
    (who uses them) for context.
  • Web results include
    model_availability
    showing whether ECAD and STEP models are available. The same MPN may appear from multiple sources (DigiKey, CSE, LCSC) with different model availability; check all returned results before concluding models are unavailable.
  • Try multiple queries. Parts go by different names — full MPN, base family, orderable variant, manufacturer alias. If the first search doesn't find what you need, try alternative names before giving up.
  • Use
    pcb doc --package <url>@<version>
    to inspect a registry module's io/config interface before using it.
  • 注册表搜索拥有丰富的索引——支持MPN搜索、制造商名称搜索、语义/功能查询以及词汇关键词匹配。可自由使用描述性查询,例如:
    "buck converter 3.3V"
    ,
    "Texas Instruments LDO"
    ,
    "USB-C connector"
  • 网络元件搜索仅支持严格的MPN查询。只能使用精确或部分制造商零件编号,例如:
    "TPS54331"
    ,
    "STM32F103C8T6"
    。请勿在查询中包含描述、关键词或功能术语——这会导致搜索失败或返回无关结果。请仅保留MPN部分。
  • 所有命令添加
    -f json
    参数后将输出JSON格式内容。可通过编程方式解析结果以评估选项。
  • 注册表结果包含
    dependencies
    (该元件依赖的内容)和
    dependents
    (使用该元件的内容),以便了解上下文。
  • 网络结果包含
    model_availability
    字段,显示ECAD和STEP模型是否可用。同一MPN可能来自多个来源(DigiKey、CSE、LCSC),且模型可用性不同;在判定模型不可用前,请检查所有返回结果。
  • 尝试多种查询方式。元件有不同的名称——完整MPN、基础系列、可订购变体、制造商别名。如果首次搜索未找到所需内容,请尝试其他名称后再放弃。
  • 使用
    pcb doc --package <url>@<version>
    命令,可在使用注册表模块前查看其IO/配置接口。

Choosing Between Results

结果选择

Pick when there's a clear winner. Present tradeoffs and ask only when genuinely ambiguous.
Selection heuristics in priority order:
  1. Functional fit — does it meet the electrical requirements?
  2. ECAD + STEP availability — strongly prefer results with both models available.
  3. Package — prefer leadless packages (QFN, DFN, LGA, WLCSP) over leaded alternatives (SOIC, TSSOP, QFP) when multiple package options exist.
  4. Sourcing — prefer in-stock parts. Check
    availability
    fields for stock counts and pricing.
  5. Source quality — for web:components, prefer CSE source over LCSC.
  6. Registry adoption — more
    dependents
    in registry results means more battle-tested.
当有明确最优选项时直接选择。仅当结果确实存在歧义时,才呈现权衡方案并询问用户。
选择优先级如下:
  1. 功能适配——是否满足电气要求?
  2. ECAD + STEP模型可用性——优先选择同时具备两种模型的结果。
  3. 封装类型——当存在多种封装选项时,优先选择无引脚封装(QFN、DFN、LGA、WLCSP)而非有引脚封装(SOIC、TSSOP、QFP)。
  4. 采购可用性——优先选择有库存的元件。查看
    availability
    字段获取库存数量和价格信息。
  5. 来源质量——对于web:components,优先选择CSE来源而非LCSC。
  6. 注册表采用率——注册表结果中
    dependents
    数量越多,说明该元件经过更多实际验证。

Using Registry Results

使用注册表结果

Registry modules and components (Flows 1 and 2) are used directly via
Module()
with the registry URL. Auto-dep handles
pcb.toml
updates automatically — just use the URL and build.
python
undefined
注册表模块和元件(流程1和2)可通过
Module()
直接使用注册表URL。自动依赖管理会自动更新
pcb.toml
——只需使用URL并构建即可。
python
undefined

Reference design from registry:modules search

来自registry:modules搜索的参考设计

LDO = Module("github.com/diodeinc/registry/reference/AP2112Kx/AP2112Kx.zen")
LDO( name="LDO_3V3", VIN=vbus_5v0, VOUT=vdd_3v3, GND=gnd, )

```python
LDO = Module("github.com/diodeinc/registry/reference/AP2112Kx/AP2112Kx.zen")
LDO( name="LDO_3V3", VIN=vbus_5v0, VOUT=vdd_3v3, GND=gnd, )

```python

Component from registry:components search

来自registry:components搜索的元件

TPS54331 = Module("github.com/diodeinc/registry/components/TPS54331D/TPS54331D.zen")

Use `pcb doc --package <url>@<version>` to check available io/config before wiring into a design.
TPS54331 = Module("github.com/diodeinc/registry/components/TPS54331D/TPS54331D.zen")

使用`pcb doc --package <url>@<version>`命令,可在将元件接入设计前查看可用的IO/配置接口。

Importing Web Components

导入网络元件

Web component results (Flow 3) require an import step before use.
  1. Search:
    pcb search -m web:components <MPN> -f json
  2. Pick a result and extract its
    component_id
    ,
    part_number
    , and
    manufacturer
    .
  3. Import:
bash
pcb new component --component-id <ID> --part-number <MPN> --manufacturer <MFR>
This downloads the symbol, footprint, and STEP model, scans the datasheet, and generates a
.zen
file into
components/<manufacturer>/<mpn>/
. If the component already exists in the workspace, it skips and reports the existing path.
  1. Use the imported component via
    Module()
    with the local workspace path:
python
ESP32 = Module("./components/Espressif_Systems/ESP32-S3-WROOM-1-N16R8/ESP32-S3-WROOM-1-N16R8.zen")
网络元件结果(流程3)需要先导入才能使用。
  1. 搜索:
    pcb search -m web:components <MPN> -f json
  2. 选择一个结果,提取其
    component_id
    part_number
    manufacturer
  3. 导入:
bash
pcb new component --component-id <ID> --part-number <MPN> --manufacturer <MFR>
此命令将下载符号、封装及STEP模型,解析数据手册,并在
components/<manufacturer>/<mpn>/
目录下生成
.zen
文件。如果该元件已存在于工作区中,将跳过导入并报告现有路径。
  1. 使用本地工作区路径,通过
    Module()
    使用导入的元件:
python
ESP32 = Module("./components/Espressif_Systems/ESP32-S3-WROOM-1-N16R8/ESP32-S3-WROOM-1-N16R8.zen")

Command Reference

命令参考

Search

搜索

bash
undefined
bash
undefined

Modules and reference designs (fast, local index)

模块和参考设计(快速,本地索引)

pcb search -m registry:modules <query> -f json
pcb search -m registry:modules <query> -f json

Pre-packaged components (fast, local index)

预先打包的元件(快速,本地索引)

pcb search -m registry:components <query> -f json
pcb search -m registry:components <query> -f json

Web component database (network, slower, MPN-ONLY queries)

网络元件数据库(需联网,速度较慢,仅支持MPN查询)

pcb search -m web:components <MPN> -f json
undefined
pcb search -m web:components <MPN> -f json
undefined

Import

导入

bash
undefined
bash
undefined

Import a web component into the workspace

将网络元件导入工作区

pcb new component --component-id <ID> [--part-number <MPN>] [--manufacturer <MFR>]
undefined
pcb new component --component-id <ID> [--part-number <MPN>] [--manufacturer <MFR>]
undefined

Inspect

查看

bash
undefined
bash
undefined

Read a registry package's io/config interface

查看注册表包的IO/配置接口

pcb doc --package <url>@<version>
undefined
pcb doc --package <url>@<version>
undefined

Verifying Sourcing with
pcb bom

使用
pcb bom
验证采购情况

After adding components to a design, use
pcb bom
to check sourcing and availability:
bash
pcb bom boards/MyBoard/MyBoard.zen -f json
The JSON output is a list of BOM entries, each with:
  • designator
    ,
    mpn
    ,
    manufacturer
    ,
    package
    ,
    value
    ,
    description
  • availability
    — per-entry sourcing data:
    • us
      /
      global
      — regional summary with
      price
      ,
      stock
      ,
      alt_stock
    • offers
      — individual distributor offers with
      region
      ,
      distributor
      ,
      stock
      ,
      price
在向设计中添加元件后,使用
pcb bom
命令检查采购和可用性:
bash
pcb bom boards/MyBoard/MyBoard.zen -f json
JSON输出是BOM条目列表,每个条目包含:
  • designator
    mpn
    manufacturer
    package
    value
    description
  • availability
    ——每个条目的采购数据:
    • us
      /
      global
      ——区域汇总信息,包含
      price
      stock
      alt_stock
    • offers
      ——各个分销商的报价,包含
      region
      distributor
      stock
      price

Fixing BOM issues

修复BOM问题

  • "No house cap/resistor found" warnings during build mean no pre-qualified generic part matches the spec. Adjust the value, package, or voltage rating, or specify an explicit
    part=Part(mpn=..., manufacturer=...)
    where appropriate.
  • Low stock or no offers — search for alternative parts using the component search flows above, then update the design.
  • Checking availability — look at
    stock
    counts across regions. Parts with zero stock and only
    alt_stock
    may have long lead times.
  • 构建过程中出现“未找到内部预认证电容/电阻”警告,说明没有预认证的通用元件符合规格。请调整参数值、封装或电压等级,或在适当位置指定明确的
    part=Part(mpn=..., manufacturer=...)
  • 库存不足或无报价——使用上述元件搜索流程查找替代元件,然后更新设计。
  • 检查可用性——查看各区域的
    stock
    数量。库存为零且仅有
    alt_stock
    的元件可能交货周期较长。