Go Down

Topic: Pressing buttons on mp3-player via arduino? (Read 4 times) previous topic - next topic

Maxi

Hello. I have this mp3 player:




More links(if pictures above are not enough):
http://img78.imageshack.us/my.php?image=scan0221ca5.jpg
http://img74.imageshack.us/my.php?image=dsc00011ep4.jpg
http://img411.imageshack.us/my.php?image=dsc00012nb1.jpg

How can I press one of these three buttons shown in the pictures without using a motor, just wires?
Not so important: How can I press the four buttons on the white ground in the first picture?

Maxi

Is there noone who can help me?
Basically I have an open circuit. If I press the button the circuit is closed.
So I need something to replace the button. And if I digitalWrite(PinButton,HIGH) to that "something" it has to close the circuit.

mem

Hi Maxi,

Try a search for Arduino and optocoupler in google.

Here is one example of how it can be done: http://www.jonasolson.se/content/arduino_tutorial/

Maxi

Thank you for the link. That's exactly what I was looking for.
But I don't know where to buy the TIL116 opto isolator. So I was searching for a datasheet and found this one: http://focus.ti.com/lit/ds/symlink/til116.pdf

But I don't know what values are important.

Is this one ok?

Code: [Select]
construction:        Phototransistor/Single
Isolation-Test-Voltage:       5300 Vrms
Typ:       4 N 35
Quality:       Low cost industry standard
IF:       50 mA
Ordering Code:       Q68000-A7302
Current-Transfer-Rate:       Min. 100 %
UCEO:       70 V
case:       DIP 6

I translated the words into english, I hope you still understand them...

mem

I have no direct experience with the 4N35 optocoupler but I would think its worth a shot if you can easily get hold of them.

You might also consider a quad package if you are driving four lines, a TLP521-4 from Futurlec costs 60 cents US. http://www.futurlec.com/LEDOpto.shtml

Maxi

#5
Jul 28, 2008, 04:28 pm Last Edit: Jul 28, 2008, 04:29 pm by Maxi Reason: 1
Do I need an analogue or a digital one? The current transfer ratio seems to be very important. In my (not-english) onlineshop this is the only value which is visible in list view. I can see the other values only when I click on an item. But at best I want an opto isolator with the same specs as the til116 so i can use the same resistors with it as in the tutorial.. i think there is not a big difference between these buttons and mine...

Does anyone know where to find a better more detailed datasheet for the til116?

mem

You can find a data sheet for the til116 here: http://www.isocom.com/datasheets/db92125.pdf

You just need a device that can fully turn on the transistor in the coupler when driven by an arduino,  I don't think you need an exact equivalent to the til116.

I have successfully used the TLP521-4 with the arduino in somewhat similar application (switching buttons on a battery operated remote control) using 670 ohm resistors connecting the arduino pins to the TLP inputs.

Maxi

#7
Jul 28, 2008, 05:25 pm Last Edit: Jul 28, 2008, 05:27 pm by Maxi Reason: 1
Yeah, but I don't want to damage anything.
For example the til116 has an emitter voltage of 6V, you used an optic isolator with an emitter voltage of 55V: http://www.datasheetcatalog.com/datasheets_pdf/T/L/P/5/TLP521-4.shtml

And there are so many different optic isolators available...

mem

#8
Jul 28, 2008, 05:52 pm Last Edit: Jul 28, 2008, 05:52 pm by mem Reason: 1
6v is the reverse voltage, if you connect it up with the emitter to ground you should have no problem up to 30 volts.

Maxi

I am really a newbie here. But is even 30 volts not too high to "virtually" press a button on an mp3 player?
Or can I get any optic isolator up to 60-70V for that job?
What transfer data ratio should it have? 50%, 60% or 100%? Or doesn't it matter for that job? Tomorrow I want to go to a store to buy it. But it's a very small store, so the personal won't even know the specs of each optic isolator, because the store doesn't even have a pc.

Daniel2

#10
Jul 28, 2008, 06:32 pm Last Edit: Jul 28, 2008, 06:32 pm by Daniel2 Reason: 1
Hi

a couple of my students wrote that a tutorial for bonus credit. I'm glad to see it is  getting used.

As long as you connect things as in their diagram, you need not worry about damaging your MP3 player.

The optoisolator inn this case is working a lot like a relay, in that the transistor side shorts out the switch contacts on the MP3 player. NO current path exists between the Arduino and the MP3 player. The MP3 player switch contacts likely have 2V across them, and the current passed through the transistor is probably under .5MA. this means that any standard transistor-output opto will work, as long as it has a decent CTR (about 50% or more will work easily).


Grumpy_Mike

Problem with an opto isolator is that you have to get it the output transistor the right way round and the switch you are trying to spook is a simple pull up or down. If the switch is part of a scanning matrix it is possible you would need a two way current flow. In that case you need to use an analogue switch.

Miles

#12
Aug 13, 2008, 07:19 pm Last Edit: Aug 13, 2008, 08:23 pm by Miles Reason: 1
If you still need to resolve this issue and you don't mind a bit of hacking then using a handful of cheap transistors may be your answer.
By strapping the emitter and collector of a transistor across the button the transistor can be used as a switch by applying a small voltage to the base of the transistor, say from the Arduino.
Using an NPN type transistor
* connect the emitter (the one with the arrow symbol) to the negative rail of the device where the button is soldered and the base to the positive side of the button.
* Connect the Arduino GND to the negative rail of the device.
* Connect the base of the transistor to the pin on the Arduino that will give on/off HIGH LOW cmds.
* Give HIGH & LOW commands from the Arduino which should now trigger your switch.
n.b. allow for device debounce times in between cmds. These will usually require a delay of 20-100 ms.
If you do a google search for 'transistor switch' then a number of useful links should come up as to how this type of switch works. If there are several buttons you need switched then a component such as a Darlington transistor array will give you some finnes.

frex

wow, that's great miles. I love this transistor solution. can you please suggest to me which rules I have to follow choosing an applicable NPN transistor like this?

Anachrocomputer

Pretty much any NPN transistor will do (but that's not much help).  Choose a small-signal NPN transistor, not a power transistor.  Maximum collector current rating in the rang of 100mA is about right.  You'll need medium gain, around 100 to 200 is OK.  Voltage ratings of 20V or so is plenty.

I'm in Europe, so types like BC107, BC548 and the like are common here.

http://en.wikipedia.org/wiki/BC548

Types such as 2N2222 may be more commonly available in other parts of the world:

http://en.wikipedia.org/wiki/2N2222

Go Up