We weren't talking the same thing. That trick turns on the supply using the power
enable pin.
I would use an optocoupler, a solid state relay or a mechanical relay to perform
that function. Without optical isolation you could end up with ground loops.
It all depends on how you are powering the Arduino and wire the supply
to the Arduino grounds.
Thanks for the suggestion, but I'd like to keep it as simple as possible.
Since I have some spare IRF510's laying around now, I'd like to use 'em, however it has to be safe. Could you shed some more light on the ground loops?
In case it's a no go with the IRF510's, my second preference would be a solid state relay. Only problem is the whole thing's new to me and I only have a vague notion about it. If I were to trigger the relay with my Arduino, would this be a good choice?
And how would I go about wiring it up?
Whether you have ground loops or grounding problems depends on how all the
components are wired in your system. Using isolation (solid-state relay or mechanical
relay) eliminates this issue for this portion of the circuit.
The relay you linked to looks like a mechanical relay and should work fine. You
could use the IRF510 to drive the coil. If the relay does not have an internal
protection diode be sure to add one.
You could use Digikey search to take a look at solid-state relays (SSR). With a
solid-state relay you would not need an IRF510 buffer (or a protection diode).
I've done some more research about the ground loops and It's starting to make sense
I'm pretty convinced of using a mechanical relay now. Although I still wondered: isn't it possible for the Arduino to control the relay directly? (it's a 5V relay and Arduino's output is 5V as well ..) or is it just too much for the Arduino to handle?
Otherwise I'd need yet another power source that connects to the IRF510 and to the relay.
On a side note: what exactly does it mean when it says a 5V relay? Does that mean you have to apply 5V to drive the coil? Or that a maximum of 5V can run through it?
I'm quite sure the relay doesn't have an internal diode ( it's rather cheap.. ) so what diode would you recommend ? Where exactly do I place it? Between the positive end of the power source to drive the coil and the pin of the relay?
I really appreciate all the effort you do,
thanks a lot ;D
Relays have two general ratings, one is the nominal coil voltage and the other is the contact ratings. A 5vdc relay means the coil will activate when 5vdc is applied to the coil, plain and simple. You can directly drive a 5vdc relay coil with an Arduino digital output pin IF the coil current requirements is under 40ma, under 20ma would be better. There are such low current 5vdc relays available but they are not as common as the ones that require more current. It is also recommended to always wire a reverse biased diode directly across the coil terminals to suppress coil switching spikes, a 1N4004 didode is a good choice.
Contact ratings have to do with what the contacts can handle in voltage and current for the contacts as they open and close the external circuit. It's a good idea to use contacts with amperage ratings well above (double at least) the actual DC current you want to control. Breaking and making higher DC currents is really hard on contacts and arcing and burning will happen over time. That is the real advantage to using today's high current MOSFET transistors over relays, they are more reliable over time.
I have no experience at all with optocoupler, so again, I have no clue which one to pick ..
I'd like to order them here, but they have a whole bunch ranging from 0.24 euro to 13 euro :
Keeping it relatively cheap is quite important (I've already spent more than my budget :D), and the mechanical relay seemed to fit that profile quite well.
So what's the advantage of using an optocoupler over a mechanical relay?
I was wondering, is the LED built in the optocoupler or do I wire an external LED pointing at it? (then why do some optocouplers have 6 pins?)
I was wondering, is the LED built in the optocoupler or do I wire an external LED pointing at it? (then why do some optocouplers have 6 pins?)
LED is built in and needs an external current limiting resistor. Why 6 pins, you have to download the datasheet for the specific device you get and see why or if even all six are used.
Just had a look at the datasheet of a 4N25, and it definately answered a lot of my questions. (Should have done this immediately, I know ;))
Still, I can't seem to figure out what pin 6 does (the base)?
And on another site I found out how to wire the thing.
However, there's one thing I don't quite understand: why does he use a 4k7 resistor on the collector? Is it because the optocoupler can't handle such high voltage?
I read that the maximum current that the optocoupler can handle is 100mA, is that correct? Is the current being passed through the PS_ON pin lower than this value?
I can't seem to figure out what pin 6 does (the base)?
It is used, if required, to bias the transistor. That is put a small voltage permanently on the base so that it is closer to the switch on point. This will make the transistor more sensitive to light. That is there does not need to be so much light to turn it on. This has the side effect of reducing the noise margin so it is not often used.
why does he use a 4k7 resistor on the collector? Is it because the optocoupler can't handle such high voltage?
No nothing to do with voltage rating.
The voltage output depends on the current flowing through the resistor. The current through the resistor depends on the photo current from the light times the gain of the transistor. Therefore the collector resistor sort of scales the output for any light change. The bigger the resistor is the more voltage swing you get for less light change.
I would get the 6N138. This is also used for MIDI if you ever decide to do that.
The Vactrols are optically isolated potentiometers which a lot of people use
to get computer control of manual controlled device (like guitar effects). For your
application you replacing a switch not a knob so the optocoupler is a better choice (also a lot less expensive).
However, there's one thing I don't quite understand: why does he use a 4k7 resistor on the collector? Is it because the optocoupler can't handle such high voltage?
In your application you omit the load resistor (RL in the datasheet, 4K7 in the example). The resistor is already attached to the #PS_ON pin inside the power supply. Just wire the collector to #PS_ON and the emitter to the power supply return pin.