This is a remote controlled MP3 player with an RGB-indicator light. It can optionally be battery powered. The MP3 player is a "FN-M16P Embedded MP3 Audio Module" aka DFPlayer Mini. It can play MP3/WAV files from a microSD Card or USB-stick. As it has a serial interface it can be controlled by a microcontroller. It includes a 3W amplifier to directly drive a small speaker. See the datasheet for more information. It is quite cheap and can be bought for less than 2€.
Main use cases are
The circuit consists of these main components
The most difficult part is powering all components involved especially if battery powered. The voltage ranges are
Moreover the standby current of 15mA of the DFPlayer is much too high for battery use.
My solution is this:
This allows to drain the batteries down to 3.35V.
A battery powered actor is another challenge. Because MySensors doesn't offer a 'wake on radio' mechanism there is no other way than to cyclically wake the actor and ask the controller if there is anything to do. If this is done too often energy is wasted, if done too seldom it takes too long for the actor to react to commands. So it's a tradeoff between energy consumption and latency. As there is probably no optimal value for the sleep time for every one, the time can be set dynamically with a message from the controller to the actor. The default sleep time is 5s, a sleep time of 0 switches sleeping off completely. The DFPlayer is only switched on the if a command is sent to it.
The DFPlayer can be controlled in different ways:
1-3 allow full control over the DFPlayer, 4. only implements a subset of all possible commands but is easy to use.
I also wrote a module for the Fhem controller software, see DFPlayerMini module documentation for more information.
To reduce the energy consumption of the Arduino board the power LED can be disabled/removed as described here. But don't remove the voltage regulator!
With the power LED on the Arduino disabled I measured a sleep current of 33µA. During wake with just the Arduino and the NRF24L01 enabled the current is about 18mA. With all three LEDs of the RGB-LED enabled it's 40mA. Power consumption of the DFPlayer depends on the volume and signal played, but it seems to be in the range of 20 to 150mA. All measurements were made at 4.8V.
If you don't want to power it with batteries use a power supply with 4.5-5.0V. In that case the MOSFET, transistor and corresponding resistors aren't needed and the VCC input of the DFPlayer can be directly connected to the power supply.
// set to 0 if not powered by a battery // and special power saving measures are not // required #define BATTERY_POWERED 1
// set to 0 if not powered by a battery // and special power saving measures are not // required #define BATTERY_POWERED 0
and all DFPlayer power switching and battery measurement code will be disabled.
The DFPlayerBat node implements two children
I bought some cheap speakers that make a nice case. They have a compartment for three AA batteries just as required and two speakers with 4 Ohm/3 Watt each. Moreover the case offers enough space for my additional PCB. For now I removed the small original PCB with the connectors on the back. But the switch and the mini USB connector might be quite handy. The DFPlayer can be directly connected to USB and then appears as a mass storage device. This would allow to update the the SD-card without the need to open the case.
|1||3xAA Switchable Battery Pack w/Bare Wire||3xAA, 4.5V|
|1||Arduino Pro Mini (3.3V)||Arduino Pro Mini (Rev14) 3.3V/8Mhz|
|1||NRF24L01+ Breakout Board|
|1||Electrolytic Capacitor||capacity 4.7µF; [THT, electrolytic]; Voltage 6.3V|
|1||RGB LED - (4 legs)||Package 5 mm [THT]; polarity common anode; rgb RGB; pin order rgb;|
|1||Basic FET P-Channel NDP6020P||Package TO220 [THT]; Typ p-channel; Fairchild NDP6020P|
|1||NPN-Transistor BC337||Paket TO92 [THT]; Typ NPN (EBC); BC337|
|1||SPEAKER||min. 3W, 8Ω|