Author Options:

Toggable MP3 player to play/pause with a electrical input? Answered

I know the title does a poor job of explaining my situation. Basically, what I want to do is make a simple one song MP3 player that will play when it has power, and not when it doesn't. But verses most MP3 players, I would want this to pause when it does not get power, not stop and then restart. I know I need a power source to the MP3 player to keep it's spot in the song when it's paused, but it's critical it has a play/pause function that is dealt with through a power source going to/through it.



I said that I had some ideas about how to make this work, and I decided to go ahead and try these ideas,  using an old mp3 player, plus some other junk that I have.

My crank sensor

The crank sensor I built starts with an optical encoder wheel from an old computer mouse.  The output from the phototransistor conveniently has a minimum lower than (1/3)*Vcc, and a maximum higher than (2/3)*Vcc, so I just feed that signal to the comparators on a 555 timer, and the output from the 555 is nice clean pulses.  I feed those pulses to a voltage doubler, and feed the output from the doubler to another 555, again using a 555 to give me a nice, square, de-bounced signal.

Because the voltage doubler is AC coupled (notice the capacitor in series with its input), the input to it must be changing, i.e have some AC in it, to get any output.  Thus,  when the mouse-wheel stops turning, the doubler output goes to zero.

Play/Pause signal [ > ||]

The Play/Pause signal is generated by a circuit that detects the low-to-high (rising edge) transition of the crank signal, and also the high-to-low (falling edge) transition, and then logically "or"s those two together.

To get a pulse that occurs on a low-to-high transition,  I use a high pass RC filter, followed by a CMOS inverter.  The width of the pulse is proportional to R times C.  Choosing R= 10^6 ohm, and C =10^-7 farad, gives a pulse that is close to 0.1 seconds in duration.

To get a pulse on a high-to-low transition, I do the same thing, except invert the input first.

Then I "or" those two signals together using some fakey diode-resistor-logic, followed by another inverter, and that works.  This is easier than bringing in a whole new IC, just to do the logical OR.

As you can see from the attached circuit diagram I managed to use all six inverters on the CD4069, and that's usually not hard, because inverters are so handy.

Transistor and push button

It turns out for the play/pause button on my mp3 player, one side of this button wants to be pulled low, to the mp3 player's ground, which is, the way I'm defining it (and the way it is usually defined),  connected to the negative terminal of the mp3 player's battery.

So I connect the ground of my circuit and the ground of the mp3 player, and I connect one side of that button to the collector of a NPN (2n3906)
transitor.  Turning that transistor on, does the same thing as pushing the button. 

Also I put another push button of my own in parallel with this transistor (from collector to emitter), and it does the same thing.  It's there because it is easier to reach than the button on the mp3 player.

Picture and video links



Correction: the transistor is a 2n3904. That's the NPN one. The 2n3906 is its PNP compliment. I actually got it right on the written diagram. There it is correctly labeled 2n3904.

Thank you again for this, but by chance, do you have a larger print of the schematic used...? I hate to ask more from all the help you have supplied so far.

Assuming you start with an inexpensive mp3 player, one with a play/pause button, I claim that it is possible to wire some kind of electrically driven switch,  such as a relay, or a transistor, or an optocoupler, or something in parallel with that button, so that activating this relay, or transistor, optocoupler, etc, with some other electrical signal, i.e the current the relay coil, the base current to the transistor, or the current to the LED in the optocoupler,  then this will do what you want it to do:  close that switch in response to this other electrical signal which you presumably control.

In the case that you do not know what you are doing, a big clunky relay would probably be the safest  way to go.  That way you'd be certain that your electrical signal is isolated from the electrical signals inside the mp3 player.

In the case you do know what you are doing, then you can probably figure out how to make the supply for your electrical signal, and the supply for the mp3 player share a common ground, and then maybe you could just short that button with a BJT transistor, but this trick takes a little more understanding and finesse.

Often, but not always, the way these little buttons work is that they are just logic level inputs that are pulled high (or low) by a resistor on one side, with the button wired between the input and the other rail of the supply.

E.g if the resistor pulls the input up, to the high side (e.g. +5V) of the supply, the button is wired between the input and ground.

Conversely if the resistor pulls the input down, to ground ( 0 V), then the button is wired between the input and the high side (e.g. +5 V) of the supply.

This article
has some nice diagrams of what pull-up or pull-down resistors with buttons, look like.

If you can sort of feel out that play/pause button, and confirm that it is one of these, a pulled up, or pulled down, kind of input, then wiring a little BJT transistor across it should be pretty easy.

And if you can't figure that out, just using a relay should be pretty foolproof.

By the way, throughout this, I have sort of been assuming that your control signal is something tame like low voltage DC, similar to what is powering the cheap mp3 player.  If you're doing something weird like trying to play/pause your mp3 player with mains power then you're definitely going to want these circuits isolated from each other; e.g. by converting the mains level signal into a low voltage DC using an AC adapter that has some big isolation built into it.

Thank you kindly for the fantastic info here!

However, I'm still a bit sckety on some of the details, all to do with the relays.
I've yet to get into relays as a whole, so this is new grounds for me.

From what you've said, I can use a relay which will take the solid on input from my system and convert it over to a on time shot for the play button. At least, that's what I got from it.

So, if that is the case, main question being: is there a way to set up a relay where when the input toggles states, there is a one time output from that state change?

Somehow I think I read what you what you wrote without totally understanding it.

You've got this input signal that turns on and stays on for a long time,  then turns off for a long time.   You want an output signal that gives a short pulse when the input signal turns on, and also gives a short pulse when the output signal turns off.  Moreover these short pulses are going to be used to push a play/pause button,  [>/ ||], on an mp3 player, so that when the input signal turns on, you get a short pulse to on the button, and that starts the music.  When the signal turns off you get a short pulse to the same button, and that pauses the music.

Just to be clear, I should probably draw a picture of this, what the input and output signal look like in time.  This is attached.

I'm trying to think how to implement this.   I think it could be done with some logic ICs, like maybe some edge-triggered flip-flops that set, then reset themselves.  The 555 timer chip gets used a lot for implementing little one-shot pulses like this, but I'm not sure if using the 555 would be the easiest way to do this.

Erm... what is the input signal anyway?  I mean you want to make music play, or not play, in response to what?


You got it now.

And I know this is probably being over-thought for the project at hand, but it's for a music box.

I'm unsure if you are familiar with the game series Legend of Zelda, but in it there is a character with a music box and back pack with a cone speaker that spins. Goes without saying, but I plan to make the music box. I have found a way to make the crank a switch which will turn the whole system on (this would be a motor to spin the cone, power for the speakers [if needed] and the one-shot to the MP3 player).

The first link actually have! I know how o make a traditional music box. However, in a crowded room, it may be a bit hard to hear.

The second link I've seen a few times on ThinkGeek. Clever, but it is kind of cheating.

And as far as the mp3 button, I'm still interested in getting that set up. The crank shaft I do have figured out. I asked a question on that prior to this one, and got a fantastic system set up to be used (link to it, if your curious: https://www.instructables.com/answers/Hand-crank-to-be-used-as-a-on-switch-for-a-system/)

Perhaps you are building something like a clockwork music box with a lid?  I mean a box that will play music when the lid to the box is open, and pause the music when the lid to the box is closed.

Are you looking for hi-fi ?

Not particularly. Not sure if your familer, but the song in question is the song of storm. So long as it's not 8-bit, and it's recognizable, all is good.

In that case, Radio Shack may have what you need. How long is the track you want to play ?

It's about two minutes, give or take.
And I may have to buy online. My local RadioShack is a bit lacking in complex bits and bobs.

If you have to go online, search a bit and see if you can find any "Nuvoton ISD speed chips"

The Shack part is out of stock anyway, and they've changed it for some cheaper piece of stuff anyway