Jdy40 Arduino Example Best -
// Send data, then enter deep sleep jdy40.println("SENSOR:OK"); delay(10); // Put JDY-40 to sleep via AT command pinMode(4, OUTPUT); digitalWrite(4, LOW); jdy40.println("AT+SLEEP=2"); // Deep sleep delay(50); // Now sleep the Arduino (using LowPower library) Never send a command without an acknowledgment.
#include <SoftwareSerial.h> // Define RX (JDY-40 TX) and TX (JDY-40 RX) pins SoftwareSerial jdy40(2, 3); // RX = pin 2, TX = pin 3 jdy40 arduino example best
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. Best Use Cases (With Example Sketches) 1. Wireless Sensor Node (Low Power) Send temperature every 60 seconds, then sleep the Arduino + JDY-40. // Send data, then enter deep sleep jdy40
If you have searched for , you are likely frustrated with vague datasheets and broken English translations. This article will provide you with the definitive guide to wiring, coding, and optimizing the JDY-40 for real-world projects. What is the JDY-40? (And Why It’s Better Than You Think) The JDY-40 is a half-duplex, 2.4GHz wireless transceiver module. Unlike the nRF24L01, which requires managing 20+ registers via SPI, the JDY-40 communicates over UART (Serial) . To your Arduino, it looks exactly like a wire replacement. This is transparent broadcasting — anything one sends,
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
| 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) |
String receivedData = "";