Jdy40 Arduino Example Best ✓

The JDY-40 supports AT commands. To change the baud rate or channel, connect the SET pin to 3.3V before powering up the module. Then you can send commands like AT+BAUD4 (for 115200) or AT+RFCH1 (for channel 1).

This example turns your Arduino into a wireless extension cord for your PC’s serial monitor. You can type "LED_ON" on Computer A, and it turns on an LED on Computer B.

Transmitter Code (Arduino A):

#include <SoftwareSerial.h>

// JDY-40 connected to pins 2 (RX) and 3 (TX) SoftwareSerial jdy40(2, 3);

void setup() Serial.begin(9600); // Debugging on PC jdy40.begin(9600); // JDY-40 default baud rate Serial.println("JDY-40 Transmitter Ready");

void loop() // Read from Serial Monitor (PC) if (Serial.available()) String data = Serial.readString(); jdy40.print(data); // Send wirelessly to receiver

Receiver Code (Arduino B):

#include <SoftwareSerial.h>

SoftwareSerial jdy40(2, 3); const int ledPin = 13; jdy40 arduino example best

void setup() pinMode(ledPin, OUTPUT); Serial.begin(9600); jdy40.begin(9600); Serial.println("JDY-40 Receiver Ready");

void loop() // Read from wireless module if (jdy40.available()) String command = jdy40.readString(); command.trim();

if (command == "LED_ON") 
  digitalWrite(ledPin, HIGH);
  Serial.println("LED turned ON via wireless");
else if (command == "LED_OFF") 
  digitalWrite(ledPin, LOW);
  Serial.println("LED turned OFF");

The JDY-40 is an incredibly robust module when paired with good code. Unlike the nRF24L01, which requires complex SPI libraries and addresses, the JDY-40 feels like a piece of wire. Copy these examples, modify the packet structure for your own sensors (DHT22, DS18B20, or even GPS), and you will have the most reliable low-cost wireless link in your workshop.

Remember: The best example is the one that handles failure gracefully. Always validate your data.

is a versatile 2.4GHz wireless serial port module designed for simple point-to-point or point-to-multipoint data transmission with a range of up to 120 meters

. It functions primarily as a "wireless cable," making it an excellent choice for beginners who want to replace physical UART wires with a radio link. Arduino.ru Key Technical Specifications Frequency Range: 2400 - 2483.5 MHz. Operating Voltage: The JDY-40 supports AT commands

2.2V to 3.6V (Note: Use 3.3V, not 5V directly to the module). Interface: UART (Serial) and 8 GPIO pins. Baud Rate: Supports up to 19,200 bps (default is 9600). Power Consumption: ~40mA during transmission, as low as 5µA in sleep mode. Wiring Connection (Arduino to JDY-40)

To configure or use the module, connect it to your Arduino as follows:

Video #257: Serial Wireless Comms for Arduino (et al) - GitHub

JDY-040/JDY-041 module. JDY-040 module Serial Wireless transceiver info. PLEASE NOTE: this module is 3v3 limited - don't apply 5v.

Радиомодули JDY-40 только UART - Arduino.ru

Getting Started with JDY-40 Arduino Module: A Comprehensive Guide

The JDY-40 is a popular Bluetooth 4.0 module widely used in Arduino projects for wireless communication. It's a cost-effective and efficient way to add Bluetooth connectivity to your Arduino board. In this article, we'll explore the JDY-40 module, its features, and provide a step-by-step guide on how to use it with Arduino, along with some example code.

Overview of JDY-40 Module

The JDY-40 is a Bluetooth 4.0 module based on the CSR8510 chipset. It supports a wide range of Bluetooth protocols, including SPP (Serial Port Protocol), HID (Human Interface Device), and more. The module operates at a frequency of 2.4 GHz and has a maximum data transfer rate of 1 Mbps.

Key Features of JDY-40 Module:

Hardware Requirements:

Software Requirements:

Step-by-Step Guide:

  • Install the SoftwareSerial Library:
  • Upload the Example Code:
  • #include <SoftwareSerial.h>
    SoftwareSerial bluetooth(2, 3); // RX, TX
    void setup() 
      Serial.begin(9600);
      bluetooth.begin(9600);
    void loop() 
      if (bluetooth.available() > 0) 
        char data = bluetooth.read();
        Serial.print("Received: ");
        Serial.println(data);
    if (Serial.available() > 0) 
        char data = Serial.read();
        bluetooth.print(data);
    

    Explanation of the Code:

    Example Use Cases:

    Tips and Troubleshooting:

    By following this guide, you should now have a better understanding of how to use the JDY-40 Bluetooth module with Arduino. Experiment with different projects and explore the possibilities of wireless communication with your Arduino board. Happy building!


    Even with perfect code, hardware issues arise. Here is the diagnostic ladder: