void loop() { if (jdy.available()) { char c = jdy.read(); digitalWrite(ledPin, (c == '1') ? HIGH : LOW); } }

#include <SoftwareSerial.h> SoftwareSerial jdy(2, 3); // RX = pin 2, TX = pin 3 const int buttonPin = 4; int lastState = LOW;

#include <SoftwareSerial.h> SoftwareSerial jdy(2, 3); // RX = pin 2, TX = pin 3 const int ledPin = 5; void setup() { pinMode(ledPin, OUTPUT); jdy.begin(9600); }

void loop() { int currentState = !digitalRead(buttonPin); // active LOW if (currentState != lastState) { jdy.write(currentState ? '1' : '0'); lastState = currentState; } delay(50); }

void setup() { pinMode(buttonPin, INPUT_PULLUP); jdy.begin(9600); // Match JDY-40 baud rate }

Before uploading, disconnect JDY-40’s TXD/RXD pins because pins 2 and 3 are used for SoftwareSerial. Also, ensure both modules are on the same channel (default channel 0 works). Power both circuits; pressing the button on the transmitter will light the LED on the receiver wirelessly. The JDY-40 is not suitable for high-speed data (e.g., audio or video) but excels for sensor readings, remote control, and simple messages. It operates in half-duplex mode, so avoid simultaneous transmissions. Interference from Wi-Fi or other 2.4GHz devices can reduce range. For improved reliability, add a simple checksum to your data packets. Also, note that the module’s default baud rate is 9600 8N1; ensure both Arduinos and both JDY-40s match. Conclusion The JDY-40 module provides an exceptionally simple pathway to add wireless serial communication to Arduino projects. With just four connections and a few lines of code, hobbyists can create robust point-to-point links. By following the wiring precautions, configuration steps, and example provided, anyone can implement wireless control or data logging. While it lacks the advanced features of more expensive modules, its ease of use and low cost make it a compelling choice for countless embedded applications—from remote plant monitoring to wearable controls. As with any RF project, experimentation with antennas, channels, and power levels will yield the best real-world performance.

ZeroKnox Removal V1.6 [ 9964 Downloads ]
MTK Auth Bypass Tool V26 [ 9170 Downloads ]
MTK Driver 3.0.1504.0 [ 5021 Downloads ]
SamFlash Tool V4.1 Free [ 4248 Downloads ]
SamFW Frp Tool V4.9 [ 3939 Downloads ]
Vivo Y90_PD1917F ISP Pinout [ 2798 Downloads ]
Vivo Y28 ISP Pinout [ 1951 Downloads ]
0%

Jdy-40 Arduino Example Apr 2026

void loop() { if (jdy.available()) { char c = jdy.read(); digitalWrite(ledPin, (c == '1') ? HIGH : LOW); } }

#include <SoftwareSerial.h> SoftwareSerial jdy(2, 3); // RX = pin 2, TX = pin 3 const int buttonPin = 4; int lastState = LOW; jdy-40 arduino example

#include <SoftwareSerial.h> SoftwareSerial jdy(2, 3); // RX = pin 2, TX = pin 3 const int ledPin = 5; void setup() { pinMode(ledPin, OUTPUT); jdy.begin(9600); } void loop() { if (jdy

void loop() { int currentState = !digitalRead(buttonPin); // active LOW if (currentState != lastState) { jdy.write(currentState ? '1' : '0'); lastState = currentState; } delay(50); } Also, ensure both modules are on the same

void setup() { pinMode(buttonPin, INPUT_PULLUP); jdy.begin(9600); // Match JDY-40 baud rate }

Before uploading, disconnect JDY-40’s TXD/RXD pins because pins 2 and 3 are used for SoftwareSerial. Also, ensure both modules are on the same channel (default channel 0 works). Power both circuits; pressing the button on the transmitter will light the LED on the receiver wirelessly. The JDY-40 is not suitable for high-speed data (e.g., audio or video) but excels for sensor readings, remote control, and simple messages. It operates in half-duplex mode, so avoid simultaneous transmissions. Interference from Wi-Fi or other 2.4GHz devices can reduce range. For improved reliability, add a simple checksum to your data packets. Also, note that the module’s default baud rate is 9600 8N1; ensure both Arduinos and both JDY-40s match. Conclusion The JDY-40 module provides an exceptionally simple pathway to add wireless serial communication to Arduino projects. With just four connections and a few lines of code, hobbyists can create robust point-to-point links. By following the wiring precautions, configuration steps, and example provided, anyone can implement wireless control or data logging. While it lacks the advanced features of more expensive modules, its ease of use and low cost make it a compelling choice for countless embedded applications—from remote plant monitoring to wearable controls. As with any RF project, experimentation with antennas, channels, and power levels will yield the best real-world performance.