|
|
0
Offline
Newbie
Karma: 0
Posts: 33
Arduino rocks
|
 |
« Reply #1 on: July 28, 2008, 05:55:11 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
London
Offline
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #2 on: July 28, 2008, 06:22:46 am » |
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/
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 33
Arduino rocks
|
 |
« Reply #3 on: July 28, 2008, 06:48:26 am » |
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.pdfBut I don't know what values are important. Is this one ok? 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...
|
|
|
|
|
Logged
|
|
|
|
|
London
Offline
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #4 on: July 28, 2008, 07:37:00 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 33
Arduino rocks
|
 |
« Reply #5 on: July 28, 2008, 09:28:24 am » |
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?
|
|
|
|
« Last Edit: July 28, 2008, 09:29:58 am by Maxi »
|
Logged
|
|
|
|
|
London
Offline
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #6 on: July 28, 2008, 09:52:23 am » |
You can find a data sheet for the til116 here: http://www.isocom.com/datasheets/db92125.pdfYou 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.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 33
Arduino rocks
|
 |
« Reply #7 on: July 28, 2008, 10:25:40 am » |
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.shtmlAnd there are so many different optic isolators available...
|
|
|
|
« Last Edit: July 28, 2008, 10:27:11 am by Maxi »
|
Logged
|
|
|
|
|
London
Offline
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #8 on: July 28, 2008, 10:52:14 am » |
6v is the reverse voltage, if you connect it up with the emitter to ground you should have no problem up to 30 volts.
|
|
|
|
« Last Edit: July 28, 2008, 10:52:27 am by mem »
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 33
Arduino rocks
|
 |
« Reply #9 on: July 28, 2008, 11:07:30 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 227
Intransigent prototyper
|
 |
« Reply #10 on: July 28, 2008, 11:32:19 am » |
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).
|
|
|
|
« Last Edit: July 28, 2008, 11:32:59 am by Daniel2 »
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 269
Posts: 25392
Solder is electric glue
|
 |
« Reply #11 on: July 28, 2008, 04:12:35 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Vancouver, Canadia
Offline
Newbie
Karma: 0
Posts: 1
Solder burn smells like bacon.
|
 |
« Reply #12 on: August 13, 2008, 12:19:50 pm » |
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.
|
|
|
|
« Last Edit: August 13, 2008, 01:23:06 pm by Miles »
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 24
Arduino rocks
|
 |
« Reply #13 on: May 11, 2009, 04:49:13 pm » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Bristol, UK
Offline
Edison Member
Karma: 0
Posts: 1197
Exhibitor at UK Maker Faire
|
 |
« Reply #14 on: May 12, 2009, 05:37:47 am » |
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/BC548Types such as 2N2222 may be more commonly available in other parts of the world: http://en.wikipedia.org/wiki/2N2222
|
|
|
|
|
Logged
|
|
|
|
|
|