Jdy40 Arduino Example Best ✰ (Free)

void setup() Serial.begin(9600); dht.begin();

To get the "best" results, this report recommends using the module in (Pass-through) with Hardware Serial where possible.

Connect two separate Arduino boards (Transmitter and Receiver) using the following pinout: JDY-40 Pin Arduino Pin (Uno/Nano/Pro Mini) Do NOT connect to 5V GND Common ground TXD Pin 2 (Software RX) Receives data from JDY-40 RXD Pin 3 (Software TX) Use a 1kΩ resistor inline for 5V Arduinos SET Pin 4 (Digital Out) Controls AT Mode / Data Mode CS Kept permanently low for active state Configuring the JDY-40 via AT Commands jdy40 arduino example best

Add a 100µF capacitor across VCC and GND on the JDY-40. This filters noise from the Arduino’s regulator and doubles the effective range.

on the Arduino's TX pin to drop the 5V signal to 3.3V for the JDY-40 RXD pin. void setup() Serial

While Arduinos typically use 5V logic, the JDY-40 prefers 3.3V. Using a voltage divider (resistors) on the Arduino's TX line can prevent long-term damage to the module. 2. Best Code Example: Two-Way Communication

(both sides identical):

Because the JDY-40 operates strictly at 3.3V, connecting it directly to a 5V Arduino Uno or Nano requires care. While the TX pin of the JDY-40 can safely trigger a 5V Arduino RX pin, the Arduino's 5V TX pin can damage the JDY-40 RX pin over time. A logic level converter or a simple resistor voltage divider is highly recommended for the RXD line. Wiring Connections JDY-40 Pin Arduino Uno / Nano Pin Ensure your Arduino can supply enough current. GND Common ground is mandatory. TXD Pin 2 (Software RX) Direct connection. RXD Pin 3 (Software TX) Via Voltage Divider (1kΩ and 2kΩ resistors). SET Digital pin used to toggle between AT Mode and Data Mode. CS Tied to ground to keep the module constantly awake. Designing the Voltage Divider for RXD To safely step down the Arduino’s 5V signal to 3.3V: Connect Arduino Pin 3 to a 1kΩ resistor .

| 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) | on the Arduino's TX pin to drop the 5V signal to 3