Switching circuit using 4n25

Discussion in 'General Electronics Chat' started by soulcramp, Jan 21, 2011.

  1. soulcramp

    Thread Starter New Member

    Jan 21, 2011
    I have a similar issue as one that I found when searching for opto-isolators in the forums. I am trying to use the optocoupler to activate a relay and switch 120VAC. I am forced to work with a 1.9-2.1 VDC control voltage and figured an optocoupler would be the best way to go. Attached is a picture of the circuit I have but cannot seem to get to work properly. When the 12V adapter is plugged in it instantly energizes the coil on the relay voiding the ability to control it with the opto. Any suggestions would be much appreciated!
  2. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    Perhaps either the 2N3904 or the 4N25 is damaged. If you can unplug the opto-coupler (if it is socket mounted?) the 2N3904 should not conduct.

    The 4N25 "dark current" should only be a few nA so the 2N3904 shouldn't be turning on with no LED side input current.

    Have you checked the wiring and device pin/lead connections are correct?
  3. eblc1388

    Senior Member

    Nov 28, 2008
    This happens by (bad) circuit design.

    You will need to place a resistor of around 10K(10K~20K) from the base of the NPN transistor to 0V.
  4. SgtWookie


    Jul 17, 2007
    The 4.7k resistor is really too large; it should be 3.6k, and as eblc1388 mentions, a pull-down resistor from the base to the emitter is needed to ensure the relay turns off when the optocoupler turns off.

    That doesn't address why the relay turns on immediately though.

    Double check the transistor connections. If you had the base and collector connections swapped, that would cause the problem.
  5. Audioguru

    New Member

    Dec 20, 2007
    If you built it on a breadboard then a nearby radio station will be picked up by the wires connected to the base of the transistor acting like antennas and causing the transistor to turn on. A base-emitter resistor will make the base less sensitive. A small pcb instead of the breadboard will stop the radio pickup.

    Every few threads I say, "Don't use a breadboard". We should have a "sticky" about it.