CH340G vs CP2102N
The two most common USB-serial chips on Arduino clones and ESP boards.
Almost every inexpensive development board has a USB-UART bridge, and most of the time it is one of these two: the CH340G from WCH or the CP2102N from Silicon Labs. Both show up as a virtual COM port on the computer and break out TXD, RXD and the modem lines RTS and DTR, which Arduino and ESP boards use to enter the bootloader automatically.
They differ clearly when designing a circuit. The CH340G comes in an SOIC-16 package and needs an external 12 MHz crystal on XI and XO. It runs at 5 V or 3.3 V; at 5 V the V3 pin needs a 100 nF capacitor, at 3.3 V V3 is tied to VCC. The CP2102N comes in a small QFN package, has an internal clock and its own voltage regulator that can be powered straight from VBUS. It supports higher baud rates and can be configured with the Silicon Labs tool, for example with a custom serial number or product name. The CH340, on the other hand, is very cheap and also available without a crystal as the CH340C.
Because package and pin count differ, the table matches the pins by signal: D+ and D−, TXD and RXD, the modem lines and the supply.
The pinouts differ. Use the tables below to rewire the signals.
Overview from the pinout data
| Property | CH340G USB to Serial UART Bridge Controller | CP2102N USB-to-UART Bridge Controller |
|---|---|---|
| Manufacturer | WCH (Jiangsu Qinheng) | Silicon Labs |
| Type | Chip | Chip |
| Compared pinout | SOIC-16 Top View | QFN28 Top View |
| Pins | 16 | 29 |
| Supply pins | V3, VCC | VDD, VREGIN |
| Ground pins | 1 | 2 |
| Interfaces | UART, USB | – |
Interface pins
| UART | CH340G USB to Serial UART Bridge Controller | CP2102N USB-to-UART Bridge Controller |
|---|---|---|
| TX | 2 · TXD | 26 · TXD |
| RX | 3 · RXD | 25 · RXD |
| RTS | 14 · RTS | – |
| CTS | 9 · CTS | – |
| USB | CH340G USB to Serial UART Bridge Controller | CP2102N USB-to-UART Bridge Controller |
|---|---|---|
| D+ | 5 · UD+ | 4 · D+ |
| D− | 6 · UD- | 5 · D- |
| VBUS | – | 8 · VBUS |
| ID | – | – |
Pin number · pin name. "+n" = further pins with the same function.
Pin by pin
The pins are numbered differently, so they are matched by signal: 12 signals exist on both.
| Signal | CH340G USB to Serial UART Bridge Controller | CP2102N USB-to-UART Bridge Controller |
|---|---|---|
| GND | 1 · GND | 3 · GND |
| TXD | 2 · TXD | 26 · TXD |
| RXD | 3 · RXD | 25 · RXD |
| UD+ | 5 · UD+ | 4 · D+ |
| UD- | 6 · UD- | 5 · D- |
| CTS | 9 · CTS | 23 · ~CTS |
| DSR | 10 · DSR | 27 · ~DSR |
| RI | 11 · RI | 2 · RI / CLK |
| DCD | 12 · DCD | 1 · ~DCD |
| DTR | 13 · DTR | 28 · ~DTR |
| RTS | 14 · RTS | 24 · ~RTS |
| VCC | 16 · VCC | 6 · VDD |
Only on CH340G USB to Serial UART Bridge Controller
4 · V37 · XI8 · XO15 · R232Only on CP2102N USB-to-UART Bridge Controller
7 · VREGIN8 · VBUS9 · ~RSTb11 · ~SUSPENDb12 · SUSPEND13 · CHREN14 · CHR115 · CHR016 · GPIO.3 / WAKEUP17 · GPIO.2 / RS48518 · GPIO.1 / RXT19 · GPIO.0 / TXT20 · GPIO.621 · GPIO.522 · GPIO.4EP · GNDVerdict
For low-cost boards that are easy to hand-solder, the CH340G (or the crystal-less CH340C) is practical. For compact designs, high baud rates and stable driver support, the CP2102N is the more solid choice.