DFPlayer draws current from the Tx pins

Hey guys :slight_smile: I am trying to high switch a DFPlayer in order to extend the battery life. Unfortunately the DFPlayer draws current from the arduino Tx pin which is what I am trying to prevent now. Without the DFPlayer the sleeping arduino draws 3.3mA, with the the DFPlayer and a 1KOhm resistor between the Tx and Rx of the DFPlayer it draws 7.3mA. With 5K resistor the current drawn is 4.3mA. Above 5KOhm the voltage drop is too high and the receiver of the DFPlayer gets no commands from the arduino.

Is there a way to save that 1mA ? Like turning off somehow the arduino pins when it sleeps ? some manipulation on the resistor ? some other creative way in which I didn't think of ?

The high side switching is just like the picture with the transistors. The wiring of the arduino and the DFPlayer are like the second picture beside the powering of the DFPlayer which goes like pic 1. There is another switch at pin 6 to make the arduino go to sleep. The 1K resistor is varied.

The sketch contains nothing, I first want to measure the current :

#include <DFPlayerMini_Fast.h>
#include "Arduino.h"
#include "SoftwareSerial.h"
#include "LowPower.h"


DFPlayerMini_Fast myDFPlayer;


const int wakeUpPin = 2;


const int transistorPin = 5 ;


const int sleepPin = 6 ;


SoftwareSerial mySoftwareSerial(10, 11); // RX, TX 11 Resistor

void wakeUp()
{
}


void setup()
{
  mySoftwareSerial.begin(9600);
  myDFPlayer.begin (mySoftwareSerial) ;


  pinMode(wakeUpPin, INPUT);
  digitalWrite (wakeUpPin, HIGH) ;


  pinMode(sleepPin, INPUT);
  digitalWrite (sleepPin, HIGH) ;

  pinMode (transistorPin, OUTPUT) ;
  digitalWrite (transistorPin, LOW);


}


void loop()
{
  attachInterrupt(0, wakeUp, LOW);


  LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);


  detachInterrupt(0);

  // wake up


  if (!digitalRead (wakeUpPin)) {
    {
      digitalWrite (wakeUpPin, LOW) ;
      digitalWrite (transistorPin, HIGH);
    }


    //go to sleep


    if (!digitalRead (sleepPin)) {
      digitalWrite (transistorPin, LOW);
      digitalWrite (wakeUpPin, HIGH) ;
    }
  }
}

Thank you all in advance

You state: "the DFPlayer draws current from the arduino Tx pin" which is connected to air; that does not use much current. A full schematic, not a frizzy thing, would be nice. Be sure to show all ground connections as well as power.

That's called Fantom powering. You need som device in between that stops that. Maybe a level shifter can be manipulated to stop the loss of current.

DIode between the Arduino and DFPlayer so that the Tx pin can only pull the Rx input low, then a voltage divider between the DFPlayer Vcc and Gnd to set the Rx input HIGH level around 3.3V.

I am sorry, posting it like that was a bit rash of me, especially when you can't even see which pin is which in the DFPlayer.
I added a new wiring scheme. I changed it a bit, I added this two diodes and they reduced the current to 3.5mA which is way better already and almost solved the problem. I will play with the resistors a bit to see if I can reduce it even more

I still find it interesting to know so I ask that. Railroader, if I were to put a level shifter between 10, 11 of the Arduino and Tx, Rx of the player, then what I needed to do would be to reduce the level of the Arduino pins to 0 when the arduino should sleep ? and then with 0 voltage there will be no current ?

David, I this I didn't understand that. So let's say I am putting a voltage divider and reducing the voltage on the DFPlayer and it's now on 4V. Then the Rx input will need to have a higher voltage to be turned on which will limit the current ?

Thank you guys so much, I really appreciate your help and time

It should be buttons which are connected to pin 2 and 6

arad2456:
Railroader, if I were to put a level shifter between 10, 11 of the Arduino and Tx, Rx of the player, then what I needed to do would be to reduce the level of the Arduino pins to 0 when the arduino should sleep ? and then with 0 voltage there will be no current ?

I've got some level shifters, somewhere... You don't need to actually switch levels! They act as isolators.
Make a search for level shifter.

My idea was to apply a level shifter to the connection where current is leaking away.

Oh, I read on wiki that they switch the logic level and act as , say, some kind of two ways voltage dividers. I figured out you meant something else. I'll read now which other functionalities they have as well

They don't have a lot of selectable functions but my guess is that the cut off You do with the MOSFET can be done to the shifter, in the proper place, and then save current.

Ohh, ok, I understand now. That sounds very interesting, I am definitely going to try that. Thank you so much :slight_smile:

Sorry I haven't been tampering much with them, not knowing a bit more.

Something like this is what I had in mind, bias the Rx input to around its HIGH input level, then let the Arduino Tx pin act to pull it LOW.

outputtemp.png

outputtemp.png

Did you try to sleep the DFPlayer with a software command?
Leo..

arad2456:
the sleeping arduino draws 3.3mA

That means you waste another 3.3 mA there. This number can go down to about 1 µA.

The Pro Mini is more suitable for low power battery operation than the Nano, and is also available in an 8MHz version that can be run at 3.3V, or more importantly directly off a LiPo battery without the use of a regulator.

Sorry if this was covered, can you just change the TX pin mode to INPUT during the sleeping phase?

a7

David I am going to try that also, thank you :slight_smile: I didn't mention it at the first comment, I am using a pro mini, 5V version. I know the pic says Nano, I got it from the internet. Sorry for that...

Wawa I did, it still consumes around 20mA which isn't really helping me....

wvmarle I will be very happy to reduce it even more. I am going to remove the power led which will save me around 0.8mA but I have no idea how to reduce it more. I followed the sketch that says "Waking from sleep with a signal" here and I didn't manage to get what he gets. I suppose it's because he removed everything from the board and I use the board as it is.

alto I tried, it didn't change much

Thank you all :slight_smile:

Do you have anything else connected besides the DFPlayer?

In the full project I am going to have couple of buttons and a poti (which consumes 0.5mA, yet I think I can just put it under the transistor and then it's saved) but as I measured it I had only the DFPlayer connected. Also when I connect it without the player it stays on 3.3mA at least

Remove the regulator as well, and when the Arduino is in power down sleep you can go to <1 µA. A Pro Mini is about as barebones as can be after that.

One thing: do remember to switch off the ADC before going to sleep, that's some 220 µA... It may also help to set all unused pins to INPUT_PULLUP so they're not floating.

You can use a 100k pot for less current consumption (0.5 mA at 5V), or connect one end to an I/O pin so you can power it down when going to sleep.