Stufin
Home Quick Cart Profile

CH340G Module (5 Pin)

Buy Now

IC

CH340G

Interface

USB (Type-A) to 5-pin TTL serial

Baud Rate

50bps to 2Mbps (automatic baud rate detection)

Operating Voltage

5V

Power Consumption

10mA (typical)

Operating Temperature

-40C to 85C

### Physical Characteristics

Dimensions

17.5mm x 15mm x 7.5mm

Weight

2g

Pinout

| Pin | Function |

| --- | -------- |

| VCC | Power Supply (5V) |

| TXD | Transmit Data |

| RXD | Receive Data |

| GND | Ground |

| DTR | Data Terminal Ready (optional) |

### Additional Features

Auto-installation of driversThe module comes with a built-in driver that automatically installs on most operating systems, making it plug-and-play compatible.
Hot-swappableThe module can be connected and disconnected from the computer without restarting the system.
High-speed transmissionThe module supports high-speed data transmission, making it suitable for applications that require fast data exchange.

Applications

--------------

The CH340G Module (5 Pin) is ideal for various applications, including

Arduino and Raspberry Pi projects

Robot control and automation systems

IoT prototypes and development boards

Microcontroller programming and debugging

Serial communication between devices

Conclusion

----------

The CH340G Module (5 Pin) is a compact, cost-effective, and reliable USB-to-TTL serial converter module, perfect for a wide range of applications that require serial communication. Its ease of use, high-speed transmission, and auto-installation of drivers make it a popular choice among engineers, hobbyists, and students.

Pin Configuration

  • CH340G Module (5 Pin) Documentation
  • Overview
  • The CH340G Module is a USB-to-UART serial communication module that converts USB signals to UART signals, allowing for communication between a computer and a microcontroller or other serial devices. The 5-pin version of the module is a compact and convenient solution for IoT projects, robotics, and other applications.
  • Pin Description
  • Here is a detailed explanation of each pin on the CH340G Module (5 Pin):
  • 1. VCC (Power Supply) Pin
  • Pin Function: Power supply input
  • Voltage: 5V (typically)
  • Current: Up to 500mA (dependent on the device connected)
  • Connection: Connect to a 5V power source, such as a USB port or a power supply unit (PSU).
  • Note: Ensure the power supply is stable and within the recommended voltage range to avoid damage to the module.
  • 2. GND (Ground) Pin
  • Pin Function: Ground reference
  • Connection: Connect to the ground pin of the power supply, microcontroller, or other devices.
  • Note: A stable ground connection is essential for proper module operation and to prevent electrical noise.
  • 3. TXD (Transmit) Pin
  • Pin Function: UART transmit data output
  • Signal: Digital output (logic level)
  • Connection: Connect to the RX (receive) pin of the microcontroller or other serial device.
  • Note: The TXD pin transmits data from the USB interface to the microcontroller or serial device.
  • 4. RXD (Receive) Pin
  • Pin Function: UART receive data input
  • Signal: Digital input (logic level)
  • Connection: Connect to the TX (transmit) pin of the microcontroller or other serial device.
  • Note: The RXD pin receives data from the microcontroller or serial device and transmits it to the USB interface.
  • 5. DTR (Data Terminal Ready) Pin
  • Pin Function: Flow control and reset input
  • Signal: Digital input (logic level)
  • Connection: Typically connected to the DTR pin of the microcontroller or left unconnected if not used.
  • Note: The DTR pin is used for flow control and can be used to reset the module in some configurations.
  • Connection Structure
  • Here is a general connection structure for the CH340G Module (5 Pin):
  • Connect VCC to a 5V power source (e.g., USB port or PSU).
  • Connect GND to the ground pin of the power supply, microcontroller, or other devices.
  • Connect TXD to the RX pin of the microcontroller or serial device.
  • Connect RXD to the TX pin of the microcontroller or serial device.
  • Connect DTR to the DTR pin of the microcontroller or leave unconnected if not used.
  • Important Notes
  • Ensure the power supply is stable and within the recommended voltage range to avoid damage to the module.
  • Use a suitable serial communication protocol and baud rate when communicating with the microcontroller or serial device.
  • Follow proper grounding and shielding practices to minimize electrical noise and interference.
  • By following this documentation, you should be able to properly connect and use the CH340G Module (5 Pin) in your IoT projects.

Code Examples

CH340G Module (5 Pin) Documentation
Overview
The CH340G Module (5 Pin) is a USB-to-Serial converter module based on the CH340G IC, which is a popular and widely used USB-to-Serial bridge controller. This module provides a convenient way to connect microcontrollers, robots, and other devices to a computer via a USB interface.
Pinouts
The 5-pin CH340G Module has the following pinouts:
| Pin | Function |
| --- | --- |
| VCC | Power supply (3.3V or 5V) |
| GND | Ground |
| TXD | Transmitter data (output) |
| RXD | Receiver data (input) |
| DTR | Data Terminal Ready (optional) |
Features
Converts USB signals to TTL-level serial signals
 Supports baud rates from 50bps to 2Mbps
 Compatible with Windows, Mac, and Linux operating systems
 Operating voltage: 3.3V or 5V
 Low power consumption
Code Examples
### Example 1: Arduino Serial Communication using CH340G Module
In this example, we will use the CH340G Module to communicate with an Arduino board. We will send a string from the Arduino to the computer using the serial communication protocol.
Arduino Code
```cpp
void setup() {
  Serial.begin(9600); // Initialize serial communication at 9600bps
}
void loop() {
  Serial.println("Hello, World!"); // Send a string to the computer
  delay(1000);
}
```
Computer Code (Python)
```python
import serial
# Open the serial port (replace 'COM3' with the actual serial port number)
ser = serial.Serial('COM3', 9600, timeout=1)
while True:
    # Read data from the serial port
    data = ser.readline().decode('utf-8').strip()
    print(data)  # Print the received data
```
### Example 2: Raspberry Pi Serial Communication using CH340G Module
In this example, we will use the CH340G Module to communicate with a Raspberry Pi. We will send a string from the Raspberry Pi to the computer using the serial communication protocol.
Raspberry Pi Code (Python)
```python
import serial
# Open the serial port (replace '/dev/ttyUSB0' with the actual serial port number)
ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=1)
while True:
    # Send a string to the computer
    ser.write(b"Hello, World!
")
    time.sleep(1)
```
Computer Code (Python)
```python
import serial
# Open the serial port (replace 'COM3' with the actual serial port number)
ser = serial.Serial('COM3', 9600, timeout=1)
while True:
    # Read data from the serial port
    data = ser.readline().decode('utf-8').strip()
    print(data)  # Print the received data
```
These examples demonstrate how to use the CH340G Module to establish serial communication between a microcontroller or single-board computer and a computer. The CH340G Module can be used in a variety of projects, including robotics, automation, and IoT applications.