Jdy-40 Arduino Example Jun 2026

Connecting the JDY-40 to an Arduino requires caution because the module is . Using 5V on VCC or its logic pins can destroy it. For a 5V Arduino (Uno, Nano), use a 3.3V voltage regulator or a logic level shifter on TXD/RXD lines. A simpler approach is to use a 3.3V-compatible board like the Arduino Pro Mini 3.3V or an ESP8266. Assuming you use an Arduino Uno with a level shifter:

String receivedData = "";

This example sends the reading of a potentiometer (or random data) from the Transmitter to the Receiver, which displays it on the Serial Monitor. jdy-40 arduino example

// Define pins (Note: RX/TX are crossed wire-wise) SoftwareSerial jdy(3, 2); // RX = 3 (connect to JDY-40 TX), TX = 2 (connect to JDY-40 RX via divider) Connecting the JDY-40 to an Arduino requires caution

// Print directly to serial monitor Serial.print(c); A simpler approach is to use a 3

void loop() if (bluetooth.available() > 0) char data = bluetooth.read(); Serial.print("Received: "); Serial.println(data); bluetooth.print("Hello from Arduino!");

void setup() Serial.begin(9600); // For displaying received data jdy.begin(9600); // Must match transmitter