In this mode, the module emulates a serial cable replacement, allowing devices to communicate over Bluetooth using the SPP protocol.
In this mode, the module emulates a serial cable replacement, allowing devices to communicate over Bluetooth using the SPP protocol.
In this mode, the module operates as a BLE peripheral, enabling communication with BLE-enabled devices.
The DX-BT18 module is designed to provide wireless connectivity for a wide range of applications, including |
Industrial control systems
Medical devices
Consumer electronics
IoT devices
Key Features
Technical Specifications
3.3V to 5V
Up to 1Mbps in SPP mode, up to 2Mbps in BLE mode
UART, up to 921600bps
2.0, 4.0
SPP 1.0, SPP 1.1
GATT, GAP
FCC, CE, RoHS, REACH
Applications
The DX-BT18 Bluetooth dual-mode module is suitable for various applications, including |
Wireless industrial control systems
Medical device connectivity
IoT device connectivity
Wireless sensors and wearable devices
Smart home automation systems
Conclusion
The DX-BT18 Bluetooth dual-mode module is a versatile and reliable solution for wireless communication between devices. Its dual-mode operation, transparent serial port connection, and low power consumption make it an ideal choice for a wide range of applications.
DX-BT18 Bluetooth Dual Mode Module Documentation
Overview
The DX-BT18 is a Bluetooth dual-mode module that supports both SPP 2.0 and BLE 4.0 protocols, enabling transparent serial port communication. This module is suitable for various IoT applications, including robotics, industrial automation, and wearable devices.
Features
Dual-mode support: SPP 2.0 and BLE 4.0
Transparent serial port communication
Operating frequency: 2.4 GHz
Transmission power: up to 4 dBm
Receiving sensitivity: up to -90 dBm
Data transmission rate: up to 2 Mbps
Supported protocols: UART, SPP, and GATT
Power supply: 3.3 V to 5 V
Dimensions: 18 mm x 13 mm x 2.5 mm
Pinout
| Pin | Function |
| --- | --- |
| VCC | Power supply (3.3 V to 5 V) |
| GND | Ground |
| TXD | UART transmission data |
| RXD | UART reception data |
| RTS | UART request to send |
| CTS | UART clear to send |
| State | Module state indicator (HIGH: connected, LOW: disconnected) |
| EN | Enable pin (active HIGH) |
Code Examples
### Example 1: Arduino Serial Communication using SPP 2.0
This example demonstrates how to use the DX-BT18 module with an Arduino board to establish a serial communication link using SPP 2.0.
```c
#include <SoftwareSerial.h>
// Define the serial pins for the DX-BT18 module
#define RX_PIN 2
#define TX_PIN 3
// Create a software serial object
SoftwareSerial btSerial(RX_PIN, TX_PIN);
void setup() {
// Initialize the serial communication
Serial.begin(9600);
btSerial.begin(9600);
// Set the module to SPP 2.0 mode
btSerial.println("AT+SPP=2");
delay(100);
}
void loop() {
// Send a string to the connected device
btSerial.println("Hello, world!");
// Receive data from the connected device
if (btSerial.available() > 0) {
String receivedData = btSerial.readStringUntil('
');
Serial.print("Received data: ");
Serial.println(receivedData);
}
delay(1000);
}
```
### Example 2: Raspberry Pi Python Script for BLE 4.0 Peripherals
This example demonstrates how to use the DX-BT18 module with a Raspberry Pi to connect to a BLE 4.0 peripheral device using Python.
```python
import bluetooth
# Set the module to BLE 4.0 mode
bt_addr = "00:11:22:33:44:55" # Replace with the BLE peripheral address
bt_port = 1
# Create a Bluetooth socket
sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
# Connect to the BLE peripheral
sock.connect((bt_addr, bt_port))
# Send a string to the BLE peripheral
sock.send("Hello, BLE!")
# Receive data from the BLE peripheral
data = sock.recv(1024)
print("Received data:", data.decode())
# Close the Bluetooth socket
sock.close()
```
### Example 3: MicroPython Script for UART Communication
This example demonstrates how to use the DX-BT18 module with a MicroPython board (e.g., ESP32 or ESP8266) to establish a UART communication link.
```python
import machine
import uart
# Define the UART pins for the DX-BT18 module
uart_tx = machine.Pin(1)
uart_rx = machine.Pin(2)
# Create a UART object
uart_obj = uart.UART(0, baudrate=9600, tx=uart_tx, rx=uart_rx)
# Send a string to the connected device
uart_obj.write("Hello, UART!")
# Receive data from the connected device
data = uart_obj.readline()
print("Received data:", data.decode())
# Close the UART object
uart_obj.deinit()
```
Note: The above examples are for demonstration purposes only and may require modifications to suit your specific use case. Make sure to check the module's datasheet and documentation for detailed instructions on its operation and configuration.