Arduino Example Best — Jdy40
Range Test (Open Field, 0 dBm, default antenna):
Throughput: At 9600 baud, effective data rate ~900 bytes/sec after overhead. Not suitable for streaming, but adequate for sensor readings or short commands.
Power consumption: 23 mA average during continuous transmission.
The JDY-40 operates on 3.3V logic. While the VCC can handle up to 3.6V (or sometimes 5V depending on the specific board revision), the data pins (RX/TX) are strictly 3.3V.
Best Practice Wiring Configuration:
| JDY-40 Pin | Arduino Uno Pin | Notes | | :--- | :--- | :--- | | VCC | 3.3V | Do not connect to 5V unless board has a regulator. | | GND | GND | Common ground is required. | | TX | Digital Pin 2 | (Uses SoftwareSerial) | | RX | Digital Pin 3 | (Use 1K-2K Resistor Divider for safety) | | EN | 3.3V | Must be HIGH for the module to run. |
The JDY-40 supports AT commands. To change the baud rate or channel, connect the SET pin to 3.3V before powering up the module. Then you can send commands like AT+BAUD4 (for 115200) or AT+RFCH1 (for channel 1).
Send these commands to both modules (Master and Slave):
| Command | Function | Best Setting |
| :--- | :--- | :--- |
| AT+RFADDR | RF Channel (0-255) | AT+RFADDR=115 (Pick a quiet channel) |
| AT+RFNETID | Network ID (0-65535) | AT+RFNETID=5678 (Avoid default 0) |
| AT+BAUD | UART baud rate | AT+BAUD=9600 (Most stable) |
| AT+RFMD | RF Data rate | AT+RFMD=250 (250kbps = longest range) |
| AT+TRPMAX | Transmit power | AT+TRPMAX=1 (Max power) |
| AT+SLEEP | Power management | AT+SLEEP=0 (Disable sleep for continuous use) |
Pro Tip: After setting AT+RFNETID, the modules automatically pair. No need for AT+LINK or address targeting. This is transparent broadcasting — anything one sends, all receive.
Never send a command without an acknowledgment.
bool sendCommand(String cmd)
jdy40.println(cmd);
unsigned long timeout = millis() + 500;
while (millis() < timeout)
if (jdy40.find("ACK")) return true;
return false; // Retry or indicate failure
The JDY-40 is a low-cost, ultra-low power wireless serial pass-through module based on the CC2541 chip. It is often preferred over the older HC-05/HC-06 Bluetooth modules because it supports both Bluetooth 4.0 (BLE) and standard serial transparency, and it requires no complex AT command pairing process for basic data transmission. jdy40 arduino example best
To get the "best" results, this report recommends using the module in Transparent Transmission Mode (Pass-through) with Hardware Serial where possible.
While there isn't a single "academic paper" that serves as the definitive guide, the following highly-regarded technical resources and tutorials are considered the best documentation for using the JDY-40 wireless module with Arduino. Best Technical Guides & Documentation
Detailed Setup and AT Commands: For a comprehensive technical overview, including how to configure the module via AT commands and its 128 radio channel options, refer to the Simple Wireless Serial Communication guide by Ben Emmett
. This resource is excellent for understanding current draw and power options.
Networking and Broadcast Examples: If you are looking to build a multi-node network (e.g., one hub and multiple remote nodes), Ben Emmett's JDY-40 Wireless Broadcast project provides complete Arduino and Python code examples using JSON formatting for message transmission.
Scientific Application: For a look at how the JDY-40 is used in professional research, the peer-reviewed paper "Wireless Data Acquisition System with Feedback Function" in MDPI details its integration into a data acquisition sensor, highlighting its 3.3V power requirements and energy-efficient sleep modes. Practical Implementation Resources
Video Tutorials: Ralph Bacon’s video tutorial on Wireless Serial Comms and the accompanying GitHub repository
are highly recommended for beginners. These resources demonstrate how to use the Go to product viewer dialog for this item.
as a "wireless USB cable" for serial debugging and data transfer.
Datasheets: The JDY-40 Wireless Serial Module PDF on Scribd provides the essential hardware specifications, including its 120-meter transmission range and 2.4GHz operating frequency. Critical Usage Tips Voltage Limitation: Always remember that the
is a 3.3V limited device; applying 5V directly to the VCC or logic pins without a level shifter can damage the module. Range Test (Open Field, 0 dBm, default antenna):
Channel Interference: For stable communication between multiple links, it is best to separate their channels by at least 6 to avoid interference.
This sketch sets up a "Pass-through" bridge. It checks for incoming configuration commands from the PC and relays all other data transparently.
/* * Title: JDY-40 Smart Bridge & Link Monitor * Description: The "Best" example to configure JDY-40 and monitor connection health. * * Circuit: * - JDY-40 TX -> Arduino Pin 2 * - JDY-40 RX -> Arduino Pin 3 * - Built-in LED (Pin 13) used for Link Status. */#include <SoftwareSerial.h>
// --- Configuration --- #define JDY_RX_PIN 2 // Connect to JDY-40 TX #define JDY_TX_PIN 3 // Connect to JDY-40 RX #define LED_PIN 13 // Status LED
// Baud Rates const long PC_BAUD = 115200; // Speed for Serial Monitor const long JDY_DEFAULT_BAUD = 9600; // Factory default const long JDY_TARGET_BAUD = 115200; // Desired speed for project
SoftwareSerial jdySerial(JDY_RX_PIN, JDY_TX_PIN); // RX, TX
// Variables for Non-blocking LED Blink unsigned long lastReceiveTime = 0; const long linkTimeout = 1000; // If no data for 1s, consider link idle
// Feature Flag: Set to true once we configure the module bool isConfigured = false;
void setup() pinMode(LED_PIN, OUTPUT);
// Start PC Serial Serial.begin(PC_BAUD); while (!Serial) ; // Wait for port to connect
// Start JDY Serial at Default Factory Baud jdySerial.begin(JDY_DEFAULT_BAUD); Throughput: At 9600 baud, effective data rate ~900
Serial.println(F("--- JDY-40 Smart Bridge Started ---")); Serial.println(F("Type 'AT' to enter config mode (works only at 9600 baud)")); Serial.println(F("Type 'SETBAUD' to automatically set module to 115200")); Serial.println(F("-----------------------------------"));
void loop() { // 1. Handle PC -> JDY-40 Traffic if (Serial.available()) { String command = Serial.readStringUntil('\n'); command.trim();
// FEATURE: Software Configuration Helper if (command ==
is a versatile 2.4GHz wireless serial port module designed for simple point-to-point or point-to-multipoint data transmission with a range of up to 120 meters
. It functions primarily as a "wireless cable," making it an excellent choice for beginners who want to replace physical UART wires with a radio link. Arduino.ru Key Technical Specifications Frequency Range: 2400 - 2483.5 MHz. Operating Voltage:
2.2V to 3.6V (Note: Use 3.3V, not 5V directly to the module). Interface: UART (Serial) and 8 GPIO pins. Baud Rate: Supports up to 19,200 bps (default is 9600). Power Consumption: ~40mA during transmission, as low as 5µA in sleep mode. Wiring Connection (Arduino to JDY-40)
To configure or use the module, connect it to your Arduino as follows:
Video #257: Serial Wireless Comms for Arduino (et al) - GitHub
JDY-040/JDY-041 module. JDY-040 module Serial Wireless transceiver info. PLEASE NOTE: this module is 3v3 limited - don't apply 5v.
Радиомодули JDY-40 только UART - Arduino.ru
Fantastic!