I'm using an Arduino Due board with an optocoupler 4N25 to simulate a button pressed. I have to open and close a circuit that drive an actuator. In that circuit, when connected, with the tester I'm measuring 6V.

I connect the anode to the pin 12 and the cathode in series with a 150-ohm resistor to ground, and Collector and Emitter from optocopupler to the circuit (and a normal Blink example with the pin 12).

When optocoupler is fired on and off respectively with a tester I measure 0V and 1.7V in the arduino part, and 4V and 6V.

This is not enough and the actuator is always run. I'd like to read 0-6V instad of 4V-6V. Does this depends on how much current goes to the anode/cathode of the optocoupler? Do I have to change the resistor in the arduino part? Any kind of advice? What can I do?

I don't want to use relay because I have read that in respect to a relay they are faster, smaller, longer-lived and quieter.

enter image description here

  • Could you add a circuit diagram to your question? It might help people understand the problem better. Dec 17, 2014 at 12:50
  • @PeterR.Bloomfield : ok, see the edit please
    – nkint
    Dec 17, 2014 at 13:02
  • The connection to the Arduino looks OK I think. It could be a problem with how you're trying to use the optocoupler. Could you expand the diagram to show exactly how your actuator circuit is connected (including its power source and ground)? Dec 17, 2014 at 13:25
  • it is a black box I cannot open sorry. I don't know anything else then the voltage when the button is pressed
    – nkint
    Dec 17, 2014 at 14:10
  • I think I can act on the resistence on the arduino side to change the voltage.. am I wrong?
    – nkint
    Dec 17, 2014 at 15:22

1 Answer 1


It sounds like the 4N25 opto-coupler on its own can't do what you need because it's not designed to directly make/break a connection between a power source and its load (i.e. it isn't functionally equivalent to a relay).

Internally, the switching functionality is provided by an NPN photo-transistor. A typical open collector usage would be something like this:

Example of an opto-coupler circuit

(Image copyright Lewis Loflin: http://www.bristolwatch.com/ele/opto_isolated.htm)

The switch (S1) and the power source (Vi) on the left would be your Arduino. All the connections on the right would be part of your device (the actuator).

As you can see, you need 3 connections on the right: voltage source (Vcc), ground, and the output (Vo, which goes to your device). The circuit basically works by pulling the output (Vo) either up to Vcc to turn it on, or down to ground to turn it off.

It looks like all you have is Vcc and Vo, so this kind of configuration won't work. (Don't try to use the ground from your Arduino instead. That could cause various other problems.)

It should be possible to setup additional circuitry to act more like a Solid State Relay, but without a ground reference point it can be harder than it sounds. A mechanical relay might be the easiest option.

  • Hi! Thank you for your clear response. I have ho simulate a "press a button" functionality. I have only the 2 wire that goes in and out from the button. Don't know what else can I try to do, I can not open the device (it is under warranty). And I cannot use a Solid State Relay (it make a little "tick" when fired, and everything is for a small concert room: the silence is high priority, we already tried that, does not work). Do you have any advice?
    – nkint
    Dec 17, 2014 at 18:34
  • From you clear answer I understand that 4N25 is a Phototransistor opto-isolators and not simply a Opto-isolator as I thought. Can a simple Opto-isolator can be a better solution? In case, can you advice me a model that is good with the Arduino Due?
    – nkint
    Dec 17, 2014 at 18:44
  • (I have used a relay like this one: store.arduino.cc/product/T010010 and it does not work, too noisy for my porpoise)
    – nkint
    Dec 17, 2014 at 19:38
  • @nkint It's a mechanical relay which makes a tick. A Solid State Relay (SSR) is purely electronic; it has no moving parts so it makes no noise. (Some of them even have built-in opto-couplers.) A photo-transistor is very common in opto-couplers, but there are certainly other designs. I can't recommend anything specific, but you might get some good suggestions on a more general electronics site, such as electronics.stackexchange.com Dec 17, 2014 at 20:17
  • If he's replacing a SPST switch in common usage, the opto-isolator will be perfectly satisfactory, as long as it's wired up with the more positive switch terminal on the collector. The transistor will replicate the same behaviour as the switch: either open circuit, or connecting the two pins. Dec 18, 2014 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.