The Go to product viewer dialog for this item. is a versatile 2.4GHz wireless serial transceiver module popular for Arduino projects due to its low power consumption ( 40mA40 m cap A
sleep) and ease of use in point-to-point or broadcast networks. Unlike Bluetooth, it natively broadcasts to all nodes on the same channel and ID, making it ideal for simple telemetry and "one-to-many" communication. Core Specifications
Operating Voltage: 2.2V to 3.6V (3.3V recommended; do not use 5V directly). Communication: Standard TTL Serial (UART). Range: Up to 120 meters in open sight.
Modes: Transparent transmission (default) or AT command mode (for configuration). Connection Guide (Arduino Uno/Nano)
To interface with an Arduino, connect the pins as follows, ensuring you use a voltage divider or level shifter for the RX pin if using a 5V Arduino. Configuration with AT command - Arduino Forum
The JDY-40 is a low-power, 2.4GHz wireless transceiver that functions as a "wireless serial port" for microcontrollers like Arduino
. It is particularly favored for its low cost and simple UART-based communication, allowing devices to exchange data up to 120 meters Longan Labs 1. Hardware Connection Best Practices The JDY-40 operates on 2.2V to 3.6V
, though many breakout boards include a regulator allowing for 5V input. For the best stability on an Arduino Uno, follow this wiring scheme: Longan Labs JDY-40 Pin Arduino Pin 3.3V or 5V Check your breakout board's requirements. Common ground is essential for signal integrity. Digital Pin 3 Connect to Arduino's TX pin (via SoftwareSerial). Digital Pin 2 Connect to Arduino's RX pin (via SoftwareSerial). GND / D-Pin Ground this pin to enter "Serial Communication Mode". Ground this pin to wake the module from sleep.
While Arduinos typically use 5V logic, the JDY-40 prefers 3.3V. Using a voltage divider (resistors) on the Arduino's TX line can prevent long-term damage to the module. 2. Best Code Example: Two-Way Communication jdy40 arduino example best
To avoid interfering with the Arduino’s USB programming (which uses pins 0 and 1), the best practice is to use the SoftwareSerial
// If wireless module receives data, send it to the computer (jdy40.available()) Serial.write(jdy40.read()); Use code with caution. Copied to clipboard 3. Advanced Configuration (AT Commands)
The JDY-40 is a 2.4GHz wireless serial module often used as a "wireless serial cable" for Arduinos. It operates at 3.3V and supports a range of up to 120–150 meters. 1. Circuit Connections
To interface the JDY-40 with an Arduino (like a Nano or Uno), use the following wiring scheme. Note that the module is 3.3V limited; applying 5V to the data pins without a level shifter can damage it. JDY-40 Pin Arduino Pin Description VCC Power supply (2.2V - 3.6V) GND Common Ground RXD TX (e.g., D3*) Data receive pin (3.3V logic) TXD RX (e.g., D2*) Data transmit pin SET D4 / GND / 3.3V LOW for AT Mode; HIGH for Communication Mode CS Chip Select; LOW to keep the module active
*Using SoftwareSerial is recommended to keep the hardware Serial port free for debugging. 2. Configuration (AT Mode)
Before sending data, you must configure both modules (e.g., to the same channel). Enter AT Mode: Pull the SET pin LOW. Common Commands: AT+BAUD: Set baud rate (Default is 9600).
AT+CHNAL: Set wireless channel (0–127). Modules must be on the same channel. AT+DVID: Set Device ID. AT+CLSS: Set mode (e.g., A0 for transparent transmission). 3. Best Arduino Example (Transparent Serial)
The most reliable way to use the JDY-40 is as a transparent serial bridge. This allows you to send data from one Arduino and receive it on another as if they were connected by a wire. Transmitter/Receiver Sketch (Generic): The Go to product viewer dialog for this item
#include Use code with caution. Copied to clipboard 4. Advanced Networking
For more complex setups, you can implement a broadcast network where a "hub" sends messages to specific "nodes" using JSON identifiers. In this setup, every node receives the message, but only the one matching the "destination" field in the data processes it. Key Performance Specs Frequency: 2.4GHz (2400-2483.5 MHz). Power Consumption: ~40mA (TX), ~24mA (RX), 5μA (Sleep). Max Speed: 19,200 bps for transparent transmission.
Stability Tip: If you experience data loss, ensure modules are within 6 channels of each other or use data integrity checks (like checksums) in your code.
Video #257: Serial Wireless Comms for Arduino (et al) - GitHub
Specifications:
Key advantage: Auto-pairing. Two modules at the same RF channel and baud rate automatically connect.
#include <SoftwareSerial.h>SoftwareSerial jdy(2, 3); // RX on pin 2, TX on pin 3
void setup() Serial.begin(9600); jdy.begin(9600); Serial.println("JDY-40 Receiver Waiting..."); // If wireless module receives data, send it
void loop() if (jdy.available()) String msg = jdy.readString(); Serial.print("Received: "); Serial.println(msg);
Out of the box, the JDY-40 works. But to eliminate interference and maximize range, you must configure it via AT commands.
To enter AT mode:
SET pin LOW.\r\n.#include <SoftwareSerial.h>SoftwareSerial jdy(2, 3); // RX on pin 2, TX on pin 3
void setup() Serial.begin(9600); // Debug serial jdy.begin(9600); // JDY-40 UART Serial.println("JDY-40 Transmitter Ready");
void loop() static unsigned long lastSend = 0; if (millis() - lastSend > 2000) jdy.println("Hello from JDY-40!"); Serial.println("Message sent"); lastSend = millis();