Jdy40 Arduino Example Best 〈Essential ›〉
/* * JDY-40 Remote Node (e.g., ID=1) * Receives commands from the hub. */
/* * JDY-40 Simple Serial Bridge * This sketch forwards data between the JDY-40 and the Serial Monitor. * No AT commands are used – the module acts as a transparent wireless UART. */
void setup() pinMode(ledPin, OUTPUT); Serial.begin(9600); jdy40.begin(9600); Serial.println("JDY-40 Receiver Ready"); jdy40 arduino example best
The hub sequentially polls each remote node.
#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 /* * JDY-40 Remote Node (e
JDY-040/JDY-041 module. JDY-040 module Serial Wireless transceiver info. PLEASE NOTE: this module is 3v3 limited - don't apply 5v.
3. The Best JDY-40 Arduino Example: Transparent Transmission */ void setup() pinMode(ledPin, OUTPUT); Serial
The JDY‑40 supports basic addressing: you can assign an ID to each node. One common topology is a network: a central Arduino (the hub) communicates with several remote devices (spokes). This is great for a weather station with multiple sensors, a robot that reports telemetry to a base station, or a home automation system.
: If you are looking to build a multi-node network (e.g., one hub and multiple remote nodes), Ben Emmett's JDY-40 Wireless Broadcast project provides complete Arduino and Python code examples using JSON formatting for message transmission.
: For a comprehensive technical overview, including how to configure the module via AT commands and its 128 radio channel options, refer to the Simple Wireless Serial Communication guide by Ben Emmett
Video #257: Serial Wireless Comms for Arduino (et al) - GitHub