Arduino Example Best Exclusive — Jdy40
Disconnect the pin from GND when configuration is complete. Best JDY-40 Arduino Example: Transmitter and Receiver
void setup() Serial.begin(9600); dht.begin();
: Adjusts transmit power (0 to 9). 9 is max (+12dBm).
Open two separate Serial Monitor instances in the Arduino IDE, each corresponding to its own Arduino board. Set both Serial Monitors to 9600 baud. Type in one monitor and it will appear on the other. 4. Configuring JDY-40 via AT Commands jdy40 arduino example best
[1] JDY-40 Datasheet, Shenzhen Jiayida Electronic Co. [2] Arduino SoftwareSerial Library Reference. [3] “2.4 GHz Wireless Modules Comparison,” Embedded Lab, 2021.
| Feature | JDY-40 | nRF24L01+ | HC-12 (433MHz) | | :--- | :--- | :--- | :--- | | | UART (Easy) | SPI (Complex Library) | UART (Easy) | | Max Range | 120m+ | 100m (with PA/LNA) | 1000m+ | | Frequency | 2.4 GHz | 2.4 GHz | 433 MHz | | Max Baud Rate | 19200 | 2 Mbps | 115200 | | Sleep Current | ~5uA | ~900nA | ~16mA | | Best Use Case | Simple wireless, remote control | High-speed data, complex networks | Long-range, outdoor, low-interference |
This guide provides the best, most reliable examples for setting up and using the JDY-40 with Arduino, covering both basic transparent transmission and configuration via AT commands. 1. Understanding the JDY-40 Module Disconnect the pin from GND when configuration is complete
// Variables for Non-blocking LED Blink unsigned long lastReceiveTime = 0; const long linkTimeout = 1000; // If no data for 1s, consider link idle
Chip select/Sleep pin. Pull LOW for active operation; pull HIGH to enter low-power sleep mode. Wiring the JDY-40 to an Arduino
lastButtonState = buttonState;
Checks device mode. For standard serial passthrough, ensure it returns +OK A0 . Send AT+BPS9600 →right arrow Sets communication speed to 9600 baud. Send AT+RFID12345678 →right arrow
void setup() Serial.begin(9600); // Debug serial jdy.begin(9600); // JDY-40 UART Serial.println("JDY-40 Transmitter Ready");