0

I'm looking to play songs from a DF Player mini and for that I use the SoftwareSerial.h library but my code keeps compiling an error that it's not there. In addition, the error only appears when I use a nano 33 BLE card and not a standard nano one. I reinstalled Arduino IDE several times and even tried on another computer but nothing works

 #include "SoftwareSerial.h"
 #include "DFRobotDFPlayerMini.h"
 // Use pins 2 and 3 to communicate with DFPlayer Mini
 static const uint8_t PIN_MP3_TX = 4; // Connects to module's RX
 static const uint8_t PIN_MP3_RX = 6; // Connects to module's TX
 SoftwareSerial softwareSerial(PIN_MP3_RX, PIN_MP3_TX);
 // Create the Player object
 DFRobotDFPlayerMini player;
 void setup() {
 // Init USB serial port for debugging
 Serial.begin(9600);
 // Init serial port for DFPlayer Mini
 softwareSerial.begin(9600);
 // Start communication with DFPlayer Mini
 if (player.begin(softwareSerial)) {
 Serial.println("OK");
 // Set volume to maximum (0 to 30).
 player.volume(30);
 // Play the "0001.mp3" in the "mp3" folder on the SD card
 player.playMp3Folder(1);
 } else {
 Serial.println("Connecting to DFPlayer Mini failed!");
 }
 }
 void loop() {
 }
Rohit Gupta
6122 gold badges5 silver badges18 bronze badges
asked Feb 2 at 10:50
3
  • what is your specific question? ... please add a focused, answerable question to your post ... do not write a question in a comment Commented Feb 2 at 16:13
  • what research have you done? ... why did it not resolve your issue? Commented Feb 2 at 16:15
  • the Nano 33 BLE has Serial1 on RX/TX pins. you can use it instead of SoftwareSerial Commented Feb 2 at 20:54

2 Answers 2

0

The SoftwareSerial library is provided by the Arduino cores on many types of boards. The Arduino Nano 33 BLE, however, uses the mbed version of the Arduino core, which lacks SoftwareSerial.

answered Feb 2 at 20:22
0

The Arduino Nano 33 BLE has an operating voltage of 3.3V. It is not 5V tolerant. To use DFPlayer Mini with Arduino Nano 33 BLE, you need a logic-level converter. You can make or buy one.

https://www.pcbway.com/project/shareproject/5V_3_3V_Logic_Level_Shifter_IC_for_Arduino_and_Raspberry_Pi_df288874.html

https://www.sparkfun.com/sparkfun-logic-level-converter-bi-directional.html

answered Feb 24 at 12:03
1
  • 1
    The serial interface on the DFplayer mini is 3.3V even when powered by 5V. Commented Feb 24 at 16:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.