Serial Basic Hookup Guide

Pages
Contributors: Nate
Favorited Favorite 7

Introduction

The Serial Basic is an easy to use USB to Serial adapter based on the CH340G IC from WCH. It works with 5V and 3.3V systems and should auto install on most operating systems without the need for additional drivers. It's a great lower cost option to the extremely popular FTDI Basic.

SparkFun Serial Basic Breakout - CH340G

SparkFun Serial Basic Breakout - CH340G

DEV-14050
$7.95
5

The Serial Basic uses the CH340G IC to quickly and easily convert serial signals to USB. It works great with all of our products including the Arduino Pro Mini, our GPS modules, cellular modules, and many other devices that uses serial communication.

Required Materials

At a minimum, you will need the following materials to follow along with the tutorial. You may not need everything though depending on what you have and your setup. Add it to your cart, read through the guide, and adjust the cart as necessary.

Jumper Wires Standard 7" M/M - 30 AWG (30 Pack)

Jumper Wires Standard 7" M/M - 30 AWG (30 Pack)

PRT-11026
$2.25
20
USB micro-B Cable - 6 Foot

USB micro-B Cable - 6 Foot

CAB-10215
$4.95
12

Suggested Reading

This is an easy board to get started with, but, if you are not sure how serial works or have not used a terminal program before, you may want to checkout the following tutorials.

Serial Communication

Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!

Serial Terminal Basics

This tutorial will show you how to communicate with your serial devices using a variety of terminal emulator applications.

How to Work with Jumper Pads and PCB Traces

Handling PCB jumper pads and traces is an essential skill. Learn how to cut a PCB trace, add a solder jumper between pads to reroute connections, and repair a trace with the green wire method if a trace is damaged.

Serial Basic Overview

The pinout of the Serial Basic mimics the common DTR/RX/TX/VCC/CTS/GND pinout found on hundreds of FTDI-to-USB derivatives.

Top of Serial Basic CH340G

Pin LabelInput/OutputDescription
DTROutputData Terminal Ready, Active Low
RXIInputSerial Receive
TXOOutputSerial Transmit
VCCSupply OutputPower supply 3.3V (default) or 5V
CTSInputClear To Send, Active Low
GNDSupply OutputGround (0V) supply

Alignment Markers

These GRN and BLK indicators are there to help you align the board properly with products that use this same pinout.

Alignment markers on Serial Basic

The Serial Basic mates seamlessly with products that use the standard serial connection. If you see a board with the BLK and GRN labels, then you know it will be compatible with the Serial Basic.

nRF52832 Breakout

See the GRN and BLK labels on this nRF52832 Breakout?

Where did GRN and BLK come from? Way back in 2008, when we created the Arduino Pro Mini, we needed to have a pinout to allow serial bootloading. At the time, the best USB to TTL Serial device was the FT232 Cable. Its unpolarized connector could be flipped either way so we added the words GRN and BLK to the PCB to let folks know how to line up the colored wires. The practice stuck! Now, many boards use this standard.

The old FTDI Cable

The cable with colored wires

Voltage Selection Jumper

There is a jumper on the rear of the board that controls the output voltage on the VCC pin. By default, the board outputs 3.3V and has 3.3V signals. Changing this jumper to 5V will cause the board to output 5V on the VCC pin with 5V signals.

Jumper to select between 3.3V and 5V

Jumper is default to 3.3V VCC and I/O

When the jumper is set to 3.3V, the board uses an onboard 3.3V regulator capable of sourcing 600mA. If you attempt to pull more than 600mA, the regulator will go into short-circuit shutdown where it will only output 150mA.

When the jumper is set to 5V, the board will source as much power as your USB port will provide.

LEDs

There are two LEDs on the board connected to TX (Green) and RX (Yellow). This is a quick and handy way to see the serial traffic.

LEDs on CH340G Serial Basic

Hardware Test

To connect the board to a computer, you will need a standard A to micro-B USB cable. Plug the micro-B USB cable into a USB port on your computer and the other end into the Serial Basic. Your computer should automatically install the necessary drivers and create a COM port on your computer. If you are prompted for drivers, please see the Drivers section.

The quickest and easiest way to make sure everything is working is to do a TX/RX loop-back. To do this, insert a jumper wire between TX and RX. Anything that is transmitted from the TX pin will be echoed back to the RX pin.

Jumper wire connecting TX to RX

Open your favorite terminal program. Select the COM port that the Serial Basic is assigned to, and connect. When you type a character, you should see each character you type echoed back in the terminal.

Terminal window showing echoed characters

Success!

Which COM Port Do I Need?

Most programs will show you a description of the USB device that created the port. To verify that your driver is working, you can use a serial terminal, Arduino IDE, device manager, or command line.

Serial Terminal

Look for the port associated with CH340.

Serial port with CH340G named

Arduino IDE Ports

If you're using the Arduino IDE, figuring out which COM port is the one you want is more difficult. Here's the quick way to figure it out: attach the Serial Basic to your computer, and check which COM ports are listed. In the image below, we have two ports. Now close the Tool menu by clicking on the main Arduino IDE window.

Arduino serial com port sub menu

Which COM port should I select?

Unplug the Serial Basic, and re-open the Tools->Ports submenu. You will see one of the serial ports is missing. That's the one you want! Plug your Serial Basic back in, and use that COM port.

Missing COM port in Arduino IDE Tools -> Ports Menu

Note: You need to close and re-open the tools menu before Arduino will refresh the port list. If you have the tool menu open simply click on the main window, then click back on Tools -> Port.

Windows: Device Manager

You can also verify that the board is installed if it shows up in your device manager. You can click the Start or (Windows) button and type "device" to quickly search for the application. (*On Windows 10, the quick search function is picky on the spelling of the application you are searching for. For example, you may get results using "_devi_" and none for "_device_".)

Windows 10 Device Manager Window
Screenshot of Window 10 Device Manager with Serial Basic on COM42. Click to enlarge.

Mac OSX: Command Line

To verify on a Mac via the command line. To open a command line window, head to your Applications folder, Utilities folder, then double-click on Terminal. Otherwise, press (Command) + space bar (Space Bar) to launch Spotlight and type "Terminal," then double-click the search result.

Run the following command "ls /dev/cu*" in a Terminal and check for the following changes (your board may show up under a different device name).

language:bash
ls /dev/cu*

You should get something similar as shown in the image below.

Mac OSX CLI Command Entry
Screenshot of Mac OSX terminal with Serial Basic on cu.wchusbserialfd1410. Click to enlarge.

Note: If you are still unsure of how to access the Terminal, watch this video or read this Apple support article.

Raspbian: Command Line

Run the following command "ls /dev/ttyUSB*" in the CLI/Terminal and check for the following changes (your board may show up under a different device name).

language:bash
ls /dev/ttyUSB*

You should get something similar as shown in the image below.

Raspbian CLI Command Entry
Screenshot of Raspberry Pi CLI with Serial Basic on ttyUSB0. Click to enlarge

Drivers If You Need Them

The driver should automatically install on most operating systems. However, there is a wide range of operating systems out there. You may need to install drivers the first time you connect the chip to your computer's USB port or when there are operating system updates. For more information, check out our How to Install CH340 Drivers Tutorial.

How to Install CH340 Drivers

August 6, 2019

How to install CH340 drivers (if you need them) on Windows, Mac OS X, and Linux.

Resources and Going Further

Once you've got serial communication working, you're ready to start playing with serial projects. Consider connecting to a GPS module like the LS20031 (one of my favorites) and watching the serial strings roll by. Or, you can use the Serial Basic to program and debug devices like the Arduino Pro Mini. There are tons of devices that use serial to communicate, so go explore!

Serial Basic to program the Pro Mini

The Serial Basic programming an Arduino Pro Mini

Check out these other resources for the Serial Basic.


Check out these other great SparkFun tutorials.

IR Communication

This tutorial explains how common infrared (IR) communication works, as well as shows you how to set up a simple IR transmitter and receiver with an Arduino.

Hexadecimal

How to interpret hex numbers, and how to convert them to/from decimal and binary.

AST-CAN485 Hookup Guide

The AST CAN485 is a miniature Arduino in the compact form factor of the ProMini. In addition to all the usual features it has on-board CAN and RS485 ports enabling quick and easy interfacing to a multitude of industrial devices.

Adding More SERCOM Ports for SAMD Boards

How to setup extra SPI, UART, and I2C serial ports on a SAMD-based boards.