Jdy40 Arduino Example Best May 2026
The Go to product viewer dialog for this item. is a highly versatile 2.4GHz wireless serial port module that serves as an affordable alternative to the NRF24L01. It is designed for "transparent transmission," essentially acting as a wireless USB cable between microcontrollers like the Arduino. 1. Key Specifications & Performance Range: Up to 120 meters (line-of-sight).
Operating Voltage: 2.2V to 3.6V (Note: 5V may damage the module; use a voltage regulator if needed).
Working Current: ~40mA (TX), ~24mA (RX), and an ultra-low <5µA in sleep mode. Frequency: 2.4 GHz ISM Band. Interface: Standard TTL Serial port. 2. Pinout Configuration
has a 14-pin layout, though standard communication only requires a few.
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. Simple Wireless Serial Communication - - Notes To Self
For an Arduino project using the JDY-40 wireless module, the most useful advanced feature is implementing a Multi-Node Hub-and-Spoke Network using unique device identifiers.
While the JDY-40 natively broadcasts messages to all modules on the same frequency, you can create a more sophisticated system where a central hub communicates with specific remote nodes by including a "destination" field in your data packets. Key Feature: Targeted Device Addressing
This feature allows you to build complex systems like a multi-room sensor network where only the intended node responds to a query.
Logic: Assign each node a unique ID (e.g., "Sensor1", "Sensor2").
Packet Structure: Use a simple JSON or string format like "to": "Sensor1", "cmd": "readTemp".
Filtering: Program your Arduino nodes to ignore any message that does not match their specific ID. Hardware Setup:
VCC: 2.2V – 3.6V (Use a 3.3V supply; do not use 5V directly). CS Pin: Pull to GND to keep the module awake.
SET Pin: Pull HIGH for normal data transmission (Transparent mode) or LOW for configuration via AT commands. Example Implementation Scenarios
Remote Relay Controller: Send a specific ID code to toggle a relay in a different room (up to 120 meters away in open areas). jdy40 arduino example best
Battery-Efficient Sensors: Use the CS pin to wake the module only when it needs to transmit data, reducing power consumption to as low as 25 microamps during sleep.
One-to-Many Control: Use one master controller (like an Arduino with a joystick) to send different commands to multiple "follower" robots simultaneously. Common Configuration Commands
You can configure these features using AT commands when the SET pin is grounded: AT+BAUD: Change serial speed (Default is 9600).
AT+RFID: Set a common "Wireless ID" for your specific network to avoid interference from other JDY-40 users. AT+DVID: Assign a unique "Device ID" to individual modules. AT+POWE: Adjust transmit power (0–9) to save battery. 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
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 versatile 2.4GHz wireless serial transceiver module that stands out for its simplicity, long-range capabilities (up to 120 meters), and built-in GPIO control modes. Unlike standard Bluetooth modules (like the HC-05) that typically have a 10m range, the JDY-40 acts more like a wireless serial cable, making it one of the best choices for long-distance Arduino projects. Key Specifications Operating Frequency: 2.4GHz Range: Up to 120 meters (line of sight)
Operating Voltage: 2.2V to 3.6V (Note: 5V logic on Arduino requires a level shifter or 3.3V power) Baud Rate: Up to 19,200 bps Communication Interface: Standard TTL Serial (UART) Best Arduino Connection Example
To get the best results, use the SoftwareSerial library so you can keep the hardware serial port for debugging.
Video #257: Serial Wireless Comms for Arduino (et al) - GitHub The Go to product viewer dialog for this item
JDY-040/JDY-041 module. JDY-040 module Serial Wireless transceiver info. PLEASE NOTE: this module is 3v3 limited - don't apply 5v. Lesson 36: Get Started with Bluetooth Module
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
In the world of wireless Arduino projects, is often hailed as a "silent workhorse" because of its effortless ability to establish long-range, transparent serial communication without the pairing headaches of traditional Bluetooth The Story of the "Ghost Connection"
Imagine building a remote-controlled rover intended to explore a dense backyard garden. Traditional Bluetooth modules like the
might struggle with line-of-sight obstacles or drop the connection if you walk too far away. By switching to a JDY-40, you gain a massive 120-meter range
. Because it uses 2.4GHz RF technology (similar to an NRF24L01 but with a simplified serial interface), it broadcasts to all other JDY-40 modules on its channel automatically. The "best" example of its power is a Hub-and-Spoke sensor network
. You can have one central "Hub" Arduino in your house and multiple "Remote" nodes (like an Arduino Uno
) scattered in the garden, each monitoring soil moisture. By sending simple JSON messages with a "destination ID," only the intended remote node replies, making it feel like a sophisticated, custom-built network. Best Practice Setup Example
To get the best performance out of your JDY-40, follow this standard serial setup:
Complete Shopping List
- 2x JDY-40 modules (~$3 each)
- 2x Arduino Uno/Nano
- Jumper wires (female-female)
Going Further
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). // If wireless module receives data, send it
3.1 Wiring (Arduino Uno)
| JDY-40 Pin | Arduino Uno Pin | |------------|------------------| | VCC | 5V | | GND | GND | | TX | Pin 2 (SoftwareSerial RX) | | RX | Pin 3 (SoftwareSerial TX) |
Note: JDY-40 logic is 3.3V. For long-term reliability, use a level shifter on RX. However, many users directly connect to 5V Arduino pins without damage.
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.
Real-World Application: Wireless Sensor
Here’s a more useful example: a remote temperature sensor.
Transmitter (with DHT11):
#include <DHT.h> DHT dht(2, DHT11);void setup() Serial.begin(9600); dht.begin();
void loop() float temp = dht.readTemperature(); float hum = dht.readHumidity(); Serial.print(temp); Serial.print(","); Serial.println(hum); delay(5000);
Receiver (Serial Plotter ready):
void setup() Serial.begin(9600);
void loop() if (Serial.available()) String data = Serial.readStringUntil('\n'); Serial.println(data); // Send to Serial Plotter
Open Tools → Serial Plotter on the receiver. You’ll see a live graph of temperature and humidity – wirelessly!
3.2 Module Configuration (AT Commands)
To enter AT mode, pull the SET pin low (to GND) before powering the module. Send commands via Serial (9600 baud, newline ending).
Common commands:
AT→OKAT+BAUD0→ Set baud rate to 9600 (default)AT+CH1→ Set RF channel to 1 (0–127, default 1)AT+DEFAULT→ Reset to factory settings
Two modules must have same channel and baud rate to communicate.