JLCPB Component Search Tool

Introduction

JLCPCB is a popular Chinese prototype PCB manufacturer and PCB assembler. Their low prices and short manufacturing time make the company attractive for low volume production. One limitation of the assembly service is that they only support a limited number of components (~40k at the time of writing). These components can be divided into two types, basic and extended, where extended components require you to pay an extra fee of $3.

Motivation

To keep the cost of PCBs low, I always tend prefer basic components over extended ones. JLCPCB’s webpage provides a search tool, but at some point they broke its ability to search for basic components. So at that moment my alternatives were either to be patient and navigate through multiple pages to find basic components, or to write my own search tool. I chose the second one!

The tool

The tool was written in Python and uses command-line arguments. Let’s take a look at how it works, and run the tool without any arguments:

jlcpcb.py
usage: jlcpcb.py [-h] {download,categories,simple,full} ...

positional arguments:
  {download,categories,simple,full}
    download                         downloads the component database from JLCPCB
    categories                       list available categories
    simple                           print the most important fields of the components
    full                             print all the fields of the components

optional arguments:
  -h, --help                         show this help message and exit

The first thing that I do before searching is to update the database. This is done by calling:

jlcpcb.py download
Downloading database...
Saved 106,468 entries.

It takes only a few seconds for the tool to download all components and save them in the in a file (data.parquet).  The components list contains lots of extended Unicode characters that don’t print well on my windows terminal, so unless they are Chinese characters (which I just remove), I try to convert them to ASCII.

To search for components the simple and full arguments must be used. Both use the same optional arguments. To see them we can call:

jlcpcb.py simple -h
usage: jlcpcb.py simple [-h] [-lcsc LCSC] [-pn PN] [-category CATEGORY]
                        [-manufacturer MANUFACTURER]
                        [-description [DESCRIPTION [DESCRIPTION ...]]] [-package PACKAGE]
                        [-pins PINS] [-basic] [-extended] [-price PRICE] [-stock STOCK]

optional arguments:
  -h, --help                                    show this help message and exit
  -lcsc LCSC                                    filter by LCSC code
  -pn PN                                        filter by manufacturer part number
  -category CATEGORY                            filter by component category
  -manufacturer MANUFACTURER                    filter by manufacturer name substring
  -description [DESCRIPTION [DESCRIPTION ...]]  filter by description substring
  -package PACKAGE                              filter by package substring
  -pins PINS                                    filter by number of pins
  -basic                                        filter basic components
  -extended                                     filter extended components
  -price PRICE                                  filter by maximum unitary price
  -stock STOCK                                  filter by minimum stock

All this arguments are optional, but without them the tool will just output the complete list of components.

Usage Examples

Let’s see a few examples on how to use the tool.

FTDI FT232R ICs

The FTDI FT232R datasheet shows that the IC is available in 2 packages: 28 pin SSOP (FT232RL-xxxx) and QFN-32 (PN FT232RQ-xxxx). To perform a simple search of these ICs I need to run:

jlcpcb.py simple -pn FT232R
   LCSC           PN   Manufacturer                 Description     Type Stock  Price
  C8690 FT232RL-REEL Future Designs     USB SSOP-28_208mil RoHS    Basic 4,532 $3.670
 C14090 FT232RQ-REEL           FTDI QFN-32_5x5x05P USB ICs RoHS Extended 6,685 $3.883
C490691      FT232RL           FTDI        SSOP-28 USB ICs RoHS Extended     0 $1.739

The simple search returns only part of the information available of the component, to retrieve all the information I need to perform a full search:

jlcpcb.py full -pn FT232R
LCSC:         C8690
PN:           FT232RL-REEL
Category:     USB
Manufacturer: Future Designs
Description:  USB SSOP-28_208mil RoHS
Package:      SSOP-28_5.3x10.2x0.65P
Pins:         28
Datasheet:    https://datasheet.lcsc.com/szlcsc/Future-Designs-FT232RL-REEL_C8690.pdf
Type:         Basic
Stock:        4,532
Price:        $3.670

LCSC:         C14090
PN:           FT232RQ-REEL
Category:     USB ICs
Manufacturer: FTDI
Description:  QFN-32_5x5x05P USB ICs RoHS
Package:      QFN-32_EP_5.0x5.0x0.5P
Pins:         32
Datasheet:    https://datasheet.lcsc.com/lcsc/1809191813_FTDI-FT232RQ-REEL_C14090.pdf
Type:         Extended
Stock:        6,685
Price:        $3.883

LCSC:         C490691
PN:           FT232RL
Category:     USB ICs
Manufacturer: FTDI
Description:  SSOP-28 USB ICs RoHS
Package:      SSOP-28_5.3x10.2x0.65P
Pins:         28
Datasheet:    https://datasheet.lcsc.com/szlcsc/2003182011_FTDI-FT232RL_C490691.pdf
Type:         Extended
Stock:        0
Price:        $1.739

Basic Amplifiers under $0.1

To search for basic amplifiers under $0.1, I first need to find the code number of the “amplifier” category:

  jlcpcb.py categories
  0: Amplifiers
  1:   Analog Comparators
  2:   Audio Power OpAmps
  3:   Differential OpAmps
  4:   FET InputAmplifiers
  5:   General Purpose Amplifiers
  6:   High speed & WideBandOpAmps
  7:   Instrumentation OpAmps
  8:   Low Noise OpAmps
  9:   Low Power OpAmps
 10:   Operational Amplifiers
 11:   Precision OpAmps
 12:   Special Purpose Amplifiers
 13: Analog ICs
 14:   Analog Switches
 15:   Analog To Digital Converters (ADCs)
 16:   Digital Potentiometer ICs
 17:   Digital To Analog Converters (DACs)
 18:   PMIC - Current & Power Monitors & Regulators
 19:   PMIC - Current Regulation
 20: Battery Products
 21:   Batteries
 22:   Battery Holders, Clips & Contacts

The complete list contains more than 400 categories, so I only showed the first 22 ones. There are main categories, like Amplifier, Analog ICs and Battery Products, and subcategories like Analog Comparators, Audio Power OpAmps, etc.

To perform a full search I can run:

jlcpcb.py full -category 0 -price 0.1 -basic

Or I can abbreviate the optional parameters if I want to type less:

jlcpcb.py full -cat 0 -pr 0.1 -b
LCSC:         C7955
PN:           LM393DR2G
Category:     Analog Comparators
Manufacturer: ON Semicon
Description:  Analog Comparators 2V ~ 36V, ±1V ~ 18V SOIC-8_150mil RoHS
Package:      SOIC-8_3.9x4.9x1.27P
Pins:         8
Datasheet:    https://datasheet.lcsc.com/szlcsc/ON-Semicon-ON-LM393DR2G_C7955.pdf
Type:         Basic
Stock:        68,410
Price:        $0.088

33 μF Tantalum Capacitors

To search for 33 μF tantalum capacitors made by Panasonic with a minimum stock of 1,000 units I run:

jlcpcb.py full -description 33uf tantalum -manufacturer panasonic -stock 1000
LCSC:         C139576
PN:           16TQC33MYFB
Category:     Tantalum Capacitors
Manufacturer: PANASONIC
Description:  33uF ±20% 16V 90 mOhms @ 100kHz -55°C ~ +105°C CASE-B_3528 Tantalum Capacitors RoHS
Package:      CASE-B_3528
Pins:         2
Datasheet:    https://datasheet.lcsc.com/lcsc/1810010224_PANASONIC-16TQC33MYFB_C139576.pdf
Type:         Extended
Stock:        18,528
Price:        $0.615

LCSC:         C179784
PN:           16TQS33MED
Category:     Tantalum Capacitors
Manufacturer: PANASONIC
Description:  33uF ±20% 16V CASE-B_3528 Tantalum Capacitors RoHS
Package:      CASE-B_3528
Pins:         2
Datasheet:    https://datasheet.lcsc.com/lcsc/1806080425_PANASONIC-16TQS33MED_C179784.pdf
Type:         Extended
Stock:        1,856
Price:        $0.495

Conclusion

JLCPCB has added more filters to its search engine, but (at the time of writing) it still lacks some filtering capabilities that I implemented in the search tool. The tool can certainly be improved in many ways by adding features such as  regular expressions or Boolean operations, but until those features become really important to me I will probably delay their implementation.

The code is available on GitHub for anyone who wants to use the tool.