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

How to Use Adafruit CH9328 UART to HID Keyboard Breakout: Examples, Pinouts, and Specs

Image of Adafruit CH9328 UART to HID Keyboard Breakout
Cirkit Designer LogoDesign with Adafruit CH9328 UART to HID Keyboard Breakout in Cirkit Designer

Introduction

The Adafruit CH9328 UART to HID Keyboard Breakout (Manufacturer Part ID: 5973) is a compact and versatile breakout board designed to convert UART serial data into USB HID keyboard signals. This allows microcontrollers, such as Arduino boards, to emulate keyboard input over USB. The CH9328 chip on the breakout board simplifies the process of sending keystrokes to a computer, making it ideal for projects that require custom keyboard input or automation.

Explore Projects Built with Adafruit CH9328 UART to HID Keyboard Breakout

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-CAM and IR Sensor Interface with USB UART Communication
Image of esp32cam parking: A project utilizing Adafruit CH9328 UART to HID Keyboard Breakout in a practical application
This circuit features an ESP32 CAM module interfaced with an IR sensor and a SparkFun USB UART Breakout board. The ESP32 CAM provides power to the IR sensor and receives its output signal, likely for processing or triggering camera actions based on IR detection. The USB UART Breakout board is connected to the ESP32 CAM for serial communication, enabling programming, debugging, or data exchange with a computer.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Keypad-Controlled LED and Buzzer System with RTC and Bluetooth
Image of Uni: A project utilizing Adafruit CH9328 UART to HID Keyboard Breakout in a practical application
This circuit is an Arduino-based keypad interface system that reads input from a 4x4 membrane matrix keypad and displays the pressed key on the serial monitor. It also includes a real-time clock (RTC) module, a Bluetooth module, and visual indicators using red and green LEDs. Additionally, a buzzer is controlled via an NPN transistor for audio feedback.
Cirkit Designer LogoOpen Project in Cirkit Designer
STM32F103C8T6 Bluetooth-Controlled Arcade Joystick Interface
Image of RC카 조이스틱: A project utilizing Adafruit CH9328 UART to HID Keyboard Breakout in a practical application
This circuit features an STM32F103C8T6 microcontroller interfaced with a Bluetooth HC-06 module for wireless communication and an Adafruit Arcade Joystick for user input. The microcontroller's pins B0 and B10 are connected to the TXD and RXD pins of the Bluetooth module, enabling serial communication, while pins B14 and B15 interface with the joystick's directional controls. The circuit is powered by a battery, with power distribution managed through the microcontroller's 3.3V pin and common ground connections.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Keypad Input Logger
Image of 4x4 Keypad (Simulation Demo): A project utilizing Adafruit CH9328 UART to HID Keyboard Breakout in a practical application
This circuit integrates a 4x4 keypad with an Arduino UNO to create a simple input interface. The Arduino reads key presses from the keypad and outputs the corresponding character to the Serial Monitor, allowing for user interaction and data entry.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit CH9328 UART to HID Keyboard Breakout

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 esp32cam parking: A project utilizing Adafruit CH9328 UART to HID Keyboard Breakout in a practical application
ESP32-CAM and IR Sensor Interface with USB UART Communication
This circuit features an ESP32 CAM module interfaced with an IR sensor and a SparkFun USB UART Breakout board. The ESP32 CAM provides power to the IR sensor and receives its output signal, likely for processing or triggering camera actions based on IR detection. The USB UART Breakout board is connected to the ESP32 CAM for serial communication, enabling programming, debugging, or data exchange with a computer.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Uni: A project utilizing Adafruit CH9328 UART to HID Keyboard Breakout in a practical application
Arduino UNO Keypad-Controlled LED and Buzzer System with RTC and Bluetooth
This circuit is an Arduino-based keypad interface system that reads input from a 4x4 membrane matrix keypad and displays the pressed key on the serial monitor. It also includes a real-time clock (RTC) module, a Bluetooth module, and visual indicators using red and green LEDs. Additionally, a buzzer is controlled via an NPN transistor for audio feedback.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of RC카 조이스틱: A project utilizing Adafruit CH9328 UART to HID Keyboard Breakout in a practical application
STM32F103C8T6 Bluetooth-Controlled Arcade Joystick Interface
This circuit features an STM32F103C8T6 microcontroller interfaced with a Bluetooth HC-06 module for wireless communication and an Adafruit Arcade Joystick for user input. The microcontroller's pins B0 and B10 are connected to the TXD and RXD pins of the Bluetooth module, enabling serial communication, while pins B14 and B15 interface with the joystick's directional controls. The circuit is powered by a battery, with power distribution managed through the microcontroller's 3.3V pin and common ground connections.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of 4x4 Keypad (Simulation Demo): A project utilizing Adafruit CH9328 UART to HID Keyboard Breakout in a practical application
Arduino UNO Keypad Input Logger
This circuit integrates a 4x4 keypad with an Arduino UNO to create a simple input interface. The Arduino reads key presses from the keypad and outputs the corresponding character to the Serial Monitor, allowing for user interaction and data entry.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Creating custom USB keyboards or keypads
  • Automating repetitive keyboard tasks
  • Building assistive technology devices
  • Developing gaming macros or shortcuts
  • Prototyping USB HID devices

Technical Specifications

The following table outlines the key technical details of the Adafruit CH9328 UART to HID Keyboard Breakout:

Parameter Value
Chipset CH9328
Input Voltage 3.3V or 5V (logic level selectable)
Communication UART (TX/RX pins)
USB Interface USB 2.0 HID (Keyboard)
Baud Rate Configurable (default: 9600 bps)
Operating Current ~10mA
Dimensions 25mm x 18mm x 4mm

Pin Configuration and Descriptions

The breakout board has the following pin layout:

Pin Name Description
VIN Power input (3.3V or 5V, depending on logic level)
GND Ground connection
TX UART Transmit pin (connect to RX of microcontroller)
RX UART Receive pin (connect to TX of microcontroller)
3V3 3.3V output (can power external devices)
USB USB Type-C connector for HID keyboard output

Usage Instructions

How to Use the Component in a Circuit

  1. Power the Breakout Board:

    • Connect the VIN pin to a 3.3V or 5V power source.
    • Connect the GND pin to the ground of your circuit.
  2. Connect UART Pins:

    • Connect the TX pin of the breakout board to the RX pin of your microcontroller.
    • Connect the RX pin of the breakout board to the TX pin of your microcontroller.
  3. Connect USB:

    • Use a USB Type-C cable to connect the breakout board to your computer. The board will enumerate as a USB HID keyboard.
  4. Send Keystrokes:

    • Send ASCII characters or keyboard commands via UART from your microcontroller. The breakout board will translate these into USB HID keyboard signals.

Important Considerations and Best Practices

  • Logic Level Selection: Ensure that the UART logic level (3.3V or 5V) matches your microcontroller's logic level to avoid damage.
  • Baud Rate Configuration: The default baud rate is 9600 bps. If needed, you can configure the baud rate using specific UART commands (refer to the CH9328 datasheet for details).
  • USB HID Limitations: The board is designed for keyboard emulation only and does not support other HID device types (e.g., mouse or joystick).
  • Avoid Overloading: Do not exceed the current output of the 3V3 pin if powering external devices.

Example Code for Arduino UNO

Below is an example of how to send keystrokes using the Adafruit CH9328 breakout board with an Arduino UNO:

// Example: Sending "Hello, World!" via the CH9328 UART to HID Keyboard Breakout
// Ensure the TX/RX pins of the breakout are connected to RX/TX of the Arduino UNO.

#include <SoftwareSerial.h>

// Define the TX and RX pins for SoftwareSerial
SoftwareSerial mySerial(10, 11); // RX, TX

void setup() {
  // Start the hardware serial for debugging
  Serial.begin(9600);
  while (!Serial) {
    ; // Wait for the serial port to connect
  }
  Serial.println("Adafruit CH9328 UART to HID Keyboard Example");

  // Start the software serial for the CH9328
  mySerial.begin(9600); // Default baud rate for CH9328
}

void loop() {
  // Send a string to the CH9328 breakout board
  mySerial.println("Hello, World!"); // Sends "Hello, World!" as keystrokes

  // Add a delay to avoid spamming the keyboard
  delay(2000);
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. The board is not recognized as a USB device:

    • Ensure the USB cable is properly connected and functional.
    • Verify that the board is powered correctly (check the VIN and GND connections).
  2. Keystrokes are not being sent:

    • Check the UART connections (TX/RX) between the breakout board and the microcontroller.
    • Ensure the baud rate of the microcontroller matches the breakout board's baud rate (default: 9600 bps).
  3. Incorrect or garbled keystrokes:

    • Verify that the UART logic level matches the microcontroller's logic level (3.3V or 5V).
    • Check for noise or interference on the UART lines.
  4. The board is drawing too much current:

    • Avoid powering high-current devices from the 3V3 pin. Use an external power source if needed.

FAQs

Q: Can I use this board with a Raspberry Pi?
A: Yes, the CH9328 breakout board can be used with a Raspberry Pi. Connect the UART pins (TX/RX) to the Pi's GPIO UART pins and ensure the logic levels are compatible.

Q: Can I send special keys like "Ctrl" or "Alt"?
A: Yes, the CH9328 supports sending special keys and key combinations. Refer to the CH9328 datasheet for the specific UART commands required.

Q: Is it possible to change the default baud rate?
A: Yes, the baud rate can be configured using specific UART commands. Refer to the CH9328 datasheet for details on how to change the baud rate.

Q: Does the board support USB-C power delivery?
A: No, the USB Type-C connector is used only for USB HID communication and does not support power delivery features.