Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Adafruit CP2102N Friend: Examples, Pinouts, and Specs

Image of Adafruit CP2102N Friend
Cirkit Designer LogoDesign with Adafruit CP2102N Friend in Cirkit Designer

Introduction

The Adafruit CP2102N Friend (Manufacturer Part ID: 5335) is a USB-to-UART bridge designed to facilitate seamless communication between a computer and microcontrollers or other serial devices. It features a built-in level shifter, making it compatible with both 3.3V and 5V logic levels. This compact and versatile module is ideal for debugging, programming, and interfacing with microcontrollers, sensors, and other serial devices.

Explore Projects Built with Adafruit CP2102N Friend

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Battery-Powered Smart Light with Proximity Sensor and OLED Display using Adafruit QT Py RP2040
Image of lab: A project utilizing Adafruit CP2102N Friend in a practical application
This circuit is a portable, battery-powered system featuring an Adafruit QT Py RP2040 microcontroller that interfaces with an OLED display, a proximity sensor, an accelerometer, and an RGB LED strip. The system is powered by a lithium-ion battery with a step-up boost converter to provide 5V for the LED strip, and it includes a toggle switch for power control. The microcontroller communicates with the sensors and display via I2C.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Smart Sensor Hub with Adafruit QT Py RP2040
Image of wearable final: A project utilizing Adafruit CP2102N Friend in a practical application
This circuit features an Adafruit QT Py RP2040 microcontroller interfaced with an APDS9960 proximity sensor, an MPU6050 accelerometer and gyroscope, and an OLED display via I2C communication. It also includes a buzzer controlled by the microcontroller and is powered by a 3.7V LiPo battery with a toggle switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Sensor Hub with Adafruit QT Py RP2040 and OLED Display
Image of 512: A project utilizing Adafruit CP2102N Friend in a practical application
This circuit features an Adafruit QT Py RP2040 microcontroller interfacing with an MPU-6050 accelerometer, an Adafruit APDS-9960 sensor, and a 0.96" OLED display via I2C communication. It is powered by a 3.7V LiPo battery and includes a green LED with a current-limiting resistor connected to an analog pin of the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 4B-Based Current Monitoring System with I2C OLED Display
Image of Virtual Energy Monitoring Circuit: A project utilizing Adafruit CP2102N Friend in a practical application
This circuit features a Raspberry Pi 4B as the central processing unit, interfaced with an Adafruit ADS1115 16-bit I2C ADC for analog-to-digital conversion and a 0.96" OLED display for visual output. The ADS1115 is connected to a current sensor for measuring electrical current, with the sensor's output and burden pins connected to the ADC's analog input channels. The Raspberry Pi communicates with both the ADC and the OLED display over the I2C bus, using its GPIO2 and GPIO3 pins for data (SDA) and clock (SCL) lines, respectively.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit CP2102N Friend

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of lab: A project utilizing Adafruit CP2102N Friend in a practical application
Battery-Powered Smart Light with Proximity Sensor and OLED Display using Adafruit QT Py RP2040
This circuit is a portable, battery-powered system featuring an Adafruit QT Py RP2040 microcontroller that interfaces with an OLED display, a proximity sensor, an accelerometer, and an RGB LED strip. The system is powered by a lithium-ion battery with a step-up boost converter to provide 5V for the LED strip, and it includes a toggle switch for power control. The microcontroller communicates with the sensors and display via I2C.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of wearable final: A project utilizing Adafruit CP2102N Friend in a practical application
Battery-Powered Smart Sensor Hub with Adafruit QT Py RP2040
This circuit features an Adafruit QT Py RP2040 microcontroller interfaced with an APDS9960 proximity sensor, an MPU6050 accelerometer and gyroscope, and an OLED display via I2C communication. It also includes a buzzer controlled by the microcontroller and is powered by a 3.7V LiPo battery with a toggle switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of 512: A project utilizing Adafruit CP2102N Friend in a practical application
Battery-Powered Sensor Hub with Adafruit QT Py RP2040 and OLED Display
This circuit features an Adafruit QT Py RP2040 microcontroller interfacing with an MPU-6050 accelerometer, an Adafruit APDS-9960 sensor, and a 0.96" OLED display via I2C communication. It is powered by a 3.7V LiPo battery and includes a green LED with a current-limiting resistor connected to an analog pin of the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Virtual Energy Monitoring Circuit: A project utilizing Adafruit CP2102N Friend in a practical application
Raspberry Pi 4B-Based Current Monitoring System with I2C OLED Display
This circuit features a Raspberry Pi 4B as the central processing unit, interfaced with an Adafruit ADS1115 16-bit I2C ADC for analog-to-digital conversion and a 0.96" OLED display for visual output. The ADS1115 is connected to a current sensor for measuring electrical current, with the sensor's output and burden pins connected to the ADC's analog input channels. The Raspberry Pi communicates with both the ADC and the OLED display over the I2C bus, using its GPIO2 and GPIO3 pins for data (SDA) and clock (SCL) lines, respectively.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Programming and debugging microcontrollers (e.g., Arduino, ESP32, STM32)
  • Serial communication with sensors, modules, or other devices
  • USB-to-serial conversion for legacy systems
  • Prototyping and testing UART-based circuits

Technical Specifications

The Adafruit CP2102N Friend is based on the Silicon Labs CP2102N USB-to-UART bridge chip. Below are its key technical details:

Specification Details
USB Interface USB 2.0 Full-Speed (12 Mbps)
UART Baud Rate Up to 3 Mbps
Voltage Compatibility 3.3V and 5V (selectable via onboard jumper)
Logic Level Shifting Built-in level shifter for 3.3V and 5V compatibility
Operating Temperature -40°C to +85°C
Dimensions 1.3" x 0.7" (33mm x 18mm)
Connector Type Micro-USB for USB connection, 6-pin header for UART
Drivers Compatible with Windows, macOS, and Linux (drivers available from Adafruit)

Pin Configuration

The CP2102N Friend has a 6-pin header for UART communication. Below is the pinout:

Pin Name Description
1 GND Ground connection
2 VCC Power output (3.3V or 5V, depending on jumper setting)
3 TXD Transmit data (output from CP2102N to the connected device)
4 RXD Receive data (input to CP2102N from the connected device)
5 RTS Request to Send (optional, for hardware flow control)
6 CTS Clear to Send (optional, for hardware flow control)

Usage Instructions

How to Use the CP2102N Friend in a Circuit

  1. Connect the CP2102N Friend to Your Computer:

    • Use a Micro-USB cable to connect the CP2102N Friend to your computer. Ensure that the appropriate drivers are installed (available on the Adafruit website).
  2. Set the Voltage Level:

    • Use the onboard jumper to select the desired logic level (3.3V or 5V) based on the requirements of your connected device.
  3. Connect to Your Device:

    • Use the 6-pin header to connect the CP2102N Friend to your microcontroller or serial device:
      • Connect TXD to the RX pin of your device.
      • Connect RXD to the TX pin of your device.
      • Connect GND to the ground of your device.
      • Optionally, connect RTS and CTS if hardware flow control is required.
  4. Open a Serial Terminal:

    • Use a serial terminal program (e.g., PuTTY, Tera Term, or the Arduino IDE Serial Monitor) to communicate with your device. Select the correct COM port and baud rate.

Important Considerations and Best Practices

  • Voltage Selection: Ensure the voltage jumper is set correctly to match your device's logic level (3.3V or 5V).
  • Driver Installation: Install the appropriate drivers for your operating system before using the CP2102N Friend.
  • Cross-Check Connections: Double-check the TX and RX connections to avoid communication issues.
  • Avoid Overloading: Do not draw excessive current from the VCC pin; it is intended for low-power devices only.

Example: Using CP2102N Friend with Arduino UNO

The CP2102N Friend can be used to communicate with an Arduino UNO via UART. Below is an example Arduino sketch and corresponding Python script for communication:

Arduino Code

void setup() {
  Serial.begin(9600); // Initialize UART communication at 9600 baud
  while (!Serial) {
    // Wait for the serial port to connect
  }
  Serial.println("Hello from Arduino!");
}

void loop() {
  if (Serial.available()) {
    char received = Serial.read(); // Read incoming data
    Serial.print("Received: ");
    Serial.println(received); // Echo received data back
  }
}

Python Code (PC Side)

import serial
import time

Initialize serial communication with the CP2102N Friend

ser = serial.Serial('COM3', 9600) # Replace 'COM3' with your actual COM port time.sleep(2) # Wait for the connection to stabilize

Send data to Arduino

ser.write(b'Hello from PC!\n') # Send a message to the Arduino

Read response from Arduino

while True: if ser.in_waiting > 0: response = ser.readline().decode('utf-8').strip() print(f"Arduino says: {response}") break

ser.close() # Close the serial connection


Troubleshooting and FAQs

Common Issues and Solutions

  1. Device Not Recognized by Computer:

    • Ensure the USB cable is functional and supports data transfer.
    • Verify that the CP2102N Friend drivers are installed correctly.
  2. No Data Transmission:

    • Check the TX and RX connections. Remember that TX on the CP2102N connects to RX on your device, and vice versa.
    • Confirm that the baud rate in your serial terminal matches the baud rate of your device.
  3. Incorrect Voltage Level:

    • Double-check the voltage jumper setting to ensure it matches your device's logic level.
  4. Serial Port Not Found:

    • Verify the COM port assigned to the CP2102N Friend in your operating system's device manager.

FAQs

Q: Can I use the CP2102N Friend with a 1.8V device?
A: No, the CP2102N Friend only supports 3.3V and 5V logic levels. For 1.8V devices, you will need an external level shifter.

Q: Is the CP2102N Friend compatible with macOS?
A: Yes, the CP2102N Friend is compatible with macOS. Ensure you install the appropriate drivers from the Adafruit website.

Q: Can I power my microcontroller using the VCC pin?
A: Yes, but only if your microcontroller's power requirements are within the current limits of the CP2102N Friend. Avoid powering high-current devices directly from the VCC pin.

Q: Does the CP2102N Friend support hardware flow control?
A: Yes, the CP2102N Friend supports hardware flow control via the RTS and CTS pins, but it is optional and not required for most applications.