Jdy40 Arduino Example Best ((link)) May 2026
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):
#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
is a highly versatile, low-cost 2.4GHz wireless serial port module. Unlike Bluetooth, it uses a proprietary 2.4G protocol, making it faster for simple point-to-point communication between Arduinos with a range of up to 120 meters. Key Technical Specs Operating Voltage : 2.2V - 3.6V (Use a 3.3V regulator; it is 5V tolerant on VCC). : Standard Serial (UART).
: Support for transparent transmission, IO switching, and remote control. Best Getting Started Example: Two-Way Serial Chat
This example allows you to type a message in the Serial Monitor of one Arduino and see it appear on the other. It is the most reliable way to test if your modules are paired correctly. 1. Wiring Diagram JDY-40 Pin Arduino Pin Do not use 5V. Common ground. Connects to SoftwareSerial RX.
Connects to SoftwareSerial TX (Use a voltage divider if using 5V Arduino).
Pull LOW to enter AT command mode; leave HIGH/Floating for communication. 2. Arduino Code Flash this same code to Arduino boards.
// RX on Pin 2 (connect to JDY-40 TX), TX on Pin 3 (connect to JDY-40 RX) SoftwareSerial jdySerial( setup() Serial.begin( ); jdySerial.begin( );
Serial.println( "JDY-40 Serial Chat Ready..." ); Serial.println( "Type a message to send to the other module:" // Read from JDY-40 and send to Serial Monitor
(jdySerial.available()) Serial.write(jdySerial.read()); // Read from Serial Monitor and send to JDY-40
(Serial.available()) jdySerial.write(Serial.read()); Use code with caution. Copied to clipboard Pro Tips for Success : By default, JDY-40 modules ship with the same
. They should "just work" out of the box. If they don't, you must use AT commands to match their (Device ID) and (Network ID). Logic Levels : If you are using an Arduino Uno or Mega (5V), use a 1kΩ/2kΩ resistor voltage divider
on the Arduino's TX pin to drop the 5V signal to 3.3V for the JDY-40 RXD pin.
: Keep the onboard PCB antenna away from large metal objects or high-interference components like motors to maximize range. AT command list to change the communication channel or transmission power?
Most basic examples only show how to send "Hello World," but in real-world applications, users struggle with the default baud rate (often 9600) not matching their project (e.g., 115200), and they have no way of knowing if the connection is stable.
Here is the developed feature proposal and the complete implementation code.
5. Experimental Results
Range Test (Open Field, 0 dBm, default antenna):
- 0–30 m: 100% packet success (no errors)
- 30–70 m: ~95% success, occasional CRC errors
- 70–100 m: 70–80% success, visible delay
-
110 m: connection lost
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 is a 2
The Ideal Wiring (Arduino Uno / Nano)
| JDY-40 Pin | Arduino Pin | Notes | | :--- | :--- | :--- | | VCC | 3.3V (Not 5V!) | Using 5V will eventually kill the module. | | GND | GND | Common ground is mandatory. | | TX | Pin 2 (SoftwareSerial) | Do not use hardware Serial (Pins 0/1) for data. | | RX | Pin 3 (SoftwareSerial) | Use a voltage divider (3.3V logic is safer). | | SET | Pin 4 (Optional) | Pull LOW to enter AT command mode. |
Critical Best Practice: Add a 100µF capacitor across VCC and GND on the JDY-40. This filters noise from the Arduino’s regulator and doubles the effective range.
Problem 3: Range is very short (2 meters)
- You are indoors with interference. Change channel (
AT+RFCH5). - Check antennas – the PCB antenna needs clear space.
The "Best" Configuration String
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.
Pro Tip: Always pair addresses and channels
If you have multiple sets of JDY-40s nearby, change the channel and address:
Module A & B (must match):
AT+RFCH5
AT+ADDR1234
AT+DEFAULT (if something breaks)
Implementation and Performance Analysis of JDY-40 Wireless Modules with Arduino
Abstract —The JDY-40 is a low-power, half-duplex 2.4 GHz transceiver module offering simple UART-based communication for Arduino projects. Unlike complex protocols like nRF24L01, JDY-40 uses transparent serial transmission with automatic pairing and frequency hopping. This paper presents hardware connections, example code for point-to-point communication, range testing results, and use-case analysis. The module is ideal for short-range (≤100m) wireless sensor networks, remote controls, and data logging.
Keywords —JDY-40, Arduino, wireless communication, UART, embedded systems.
2. JDY-40 Overview
Specifications:
- Frequency: 2.4 GHz ISM band (2400–2483 MHz)
- Modulation: GFSK
- Range: Up to 100m (open area, 0 dBm output)
- Interface: UART TTL (3.3V – 5V tolerant on VCC, but logic levels ideally 3.3V)
- Baud rate: Default 9600 (configurable 1200–115200)
- Supply: 2.2–5.5V DC
- Current: ~23 mA transmit, 22 mA receive
Key advantage: Auto-pairing. Two modules at the same RF channel and baud rate automatically connect.
6. Troubleshooting
- Garbled Text: Baud rate mismatch. Try 9600, then 57600, then 115200.
- No Data Received: Check wiring. Ensure JDY-40 TX goes to Arduino RX, and vice versa.
- Module Not Found: Ensure the module is powered (LED might blink or be solid depending on version/state). Verify the EN pin is connected to 3.3V.
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. (jdySerial
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.
Channel Interference: For stable communication between multiple links, it is best to separate their channels by at least 6 to avoid interference.
The JDY-40 is a highly efficient 2.4GHz wireless transceiver module favored for its simplicity, as it operates as a standard UART serial bridge. Unlike the more complex NRF24L01, it does not require specialized libraries for basic communication, making it an excellent choice for beginner Arduino projects like remote sensor reporting or wireless robots. Quick Review & Specifications
Ease of Use: It functions as a "wireless wire." Data sent into one module's RX pin appears on the other module's TX pin. Range: Up to 120 meters in open areas.
Power: Operates at 2.2V – 3.6V (3.3V is ideal). It is ultra-low power, with sleep modes consuming only 5µA.
Modes: Supports transparent serial transmission (default) and a remote control mode where the 8 GPIO pins can be used without an external microcontroller. Arduino Connection Example
To use the JDY-40 with an Arduino, you must ensure you are using 3.3V logic levels or a level shifter, as the module is not 5V tolerant.
Как работать с беспроводным модулем jdy-40 и ардуино?