

Serial.println("JDY-40 Master/Slave Ready");
SoftwareSerial jdy(2, 3); // RX on pin 2, TX on pin 3
It is incredibly inexpensive, often costing less than two dollars per module. Pinout and Technical Specifications jdy40 arduino example best
#include SoftwareSerial jdyWireless(2, 3); // RX, TX void setup() Serial.begin(9600); jdyWireless.begin(9600); Serial.println("System initialized. Ready to send/receive data..."); void loop() // Check if data is received from the remote JDY-40 module if (jdyWireless.available()) Serial.print("Received: "); while (jdyWireless.available()) char inChar = (char)jdyWireless.read(); Serial.write(inChar); Serial.println(); // Check if there is data from local serial monitor to transmit if (Serial.available()) String outData = Serial.readStringUntil('\n'); jdyWireless.println(outData); Serial.print("Sent: "); Serial.println(outData); Use code with caution. Advanced Best Practices for Production Projects
Wireless communication adds immense value to microcontroller projects. While many developers default to the NRF24L01 or HC-05 Bluetooth modules, the JDY-40 mesh networking serial wireless port module offers a compelling alternative. It features built-in high-frequency 2.4G technology, an impressive range, and an incredibly simple communication protocol. Serial
If you are currently building a specific project, please let me know: What or sensor reading are you trying to send? What is your required physical operating range ? Are you using battery power or a plug-in power source?
. 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 If you are currently building a specific project,
To prevent interference with the hardware serial port (used for uploading code to the Arduino), we use SoftwareSerial to configure and test the module. JDY-40 Pin Arduino Uno Pin Do not use 5V Common ground Pin 2 (Rx) Directly connected Pin 3 (Tx) Use a 1kΩ / 2kΩ resistor voltage divider Used to toggle AT mode Module always enabled Part 1: Configuring the JDY-40 with AT Commands
Here is a complete reference for the most useful AT commands.