I’m using DFPlayer in stand-alone mode (no Arduino) for a music project. The buttons all have short-press and long-press commands. I want to trigger a short-press command by releasing a depressed normally-closed switch (ie. lifting an object containing a pressure switch.) Since the switch stays closed upon release, it would register as a long-press, but I want the short-press behavior.
Based on my research, it seems like a capacitor-based debounce circuit might allow me to accomplish this, but I can’t make the jump from those examples and my application. I don’t want to involve a microcontroller.
UPDATE 6/19: To clarify the application, here is what we built previously.
Musical Invitation: https://www.youtube.com/watch?v=r6qroO5coos
This used a different music player that doesn’t have as good a sound quality, and required prying it out of a plastic enclosure (150 times) so we could modify it to control the lights, but it did have a push button to activate the music. We wired the switch normally-closed, so while it’s in the box, it holds the switch open. As soon as the box opens, it releases the switch and begins playing. But in the new music player, it interprets normally closed as a long press, and depending on which pin I connect to, that will either play a track on infinite repeat, or increase the volume, neither of which are what I want, which is to play the track once and stop. We’re working on a similar project and wish to use a better quality music player that requires less manual labor to assemble.
Try this. Play with component values. Node 1 to the pin on the DFPlayer. Sw1 is your switch. Normally the switch is closed so the transistor is off and the node 1 pin is internally pulled high (vcc). i.e. no input. If sw1 opens the transistor turns on and node1 is pulled to ground since the cap does not initially have any charge. Over time r2 charges the capacitor and Node 1 will eventually return to high Vcc. R2 and C will set the short duration time.
Correction : Move R2 to between the emitter of Q1 and the capacitor. The DFplayer data sheet does not give enough info to say if this will work but if you make R2 small (Say 2K to start with) and R1 big (say 10k to start with) it should work okay.
Answered by user192252 on December 19, 2020
Get help from others!