Jdy40 Arduino Example Best -

void setup() Serial.begin(9600); // For Serial Monitor output Serial1.begin(9600); // For communication with JDY-40

if (Serial.available() > 0) char data = Serial.read(); bluetooth.print(data);

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" jdy40 arduino example best

#include const int rxPin = 2; const int txPin = 3; const int setPin = 4; SoftwareSerial jdy40(rxPin, txPin); void setup() pinMode(setPin, OUTPUT); // Enter AT command mode by pulling SET pin LOW digitalWrite(setPin, LOW); delay(100); Serial.begin(9600); jdy40.begin(9600); Serial.println("JDY-40 AT Command Mode Ready."); Serial.println("Type AT commands in the Serial Monitor."); void loop() // Pass data from Arduino Serial Monitor to JDY-40 if (Serial.available()) jdy40.write(Serial.read()); // Pass data from JDY-40 back to Arduino Serial Monitor if (jdy40.available()) Serial.write(jdy40.read()); Use code with caution. Essential AT Commands

. You can have one central "Hub" Arduino in your house and multiple "Remote" nodes (like an Arduino Uno void setup() Serial

Once the wiring is complete and correct, you are ready to power up the system.

void setup() Serial.begin(9600); // Debug serial jdy.begin(9600); // JDY-40 UART Serial.println("JDY-40 Transmitter Ready"); void setup() Serial.begin(9600)

else if (command == "LED_OFF") digitalWrite(ledPin, LOW); Serial.println("LED turned OFF");

Imagine you have an Arduino with a temperature/humidity sensor (e.g., DHT11) in your garden, and you want to send readings to a PC in your house. Use a JDY‑40 at the sensor side and a second JDY‑40 connected to a USB‑to‑serial adapter (like CP2102 or CH340) at the PC side. The PC can then read the data with any serial terminal.