Difficulty with relay circuit when using transistor

Discussion in 'The Projects Forum' started by boymedic, Sep 30, 2016.

  1. boymedic

    Thread Starter New Member

    Sep 30, 2016
    Greetings, and thanks for looking!

    I apologize in advance - I'm very new to electronics and so this might be ridiculously simple. As part of a circuit I'm creating, I need to use a relay. I've been able to test most parts of my circuit using an Arduino board and various stand-alone items, including a relay board. However, to finalize the project, I intend to design a PCB containing all of the necessary elements on one board for neatness.

    In trying to move the relay board setup to my PCB design, I've run into a problem. From what I can tell, the relay board is set up similar to the following schematic, with 3.3 - 5 VDC acceptable input and a 3.3 VDC signal entering through R1 to switch the relay (and also activate the LED showing the state of the relay).

    When I set it up according to that schematic, switching the signal that enters through R1 did not activate the relay or the LED (nothing happened at all).

    I simplified the design to the following for testing, and substituted an LED for the relay. This works fine:
    However, placing the relay back in it's place and changing nothing else, I again get no action whatsoever:

    The relay works fine without transistor Q1 in the circuit:

    So my questions are the following:
    1. What is wrong with my design that is causing the relay to not function with the transistor in the circuit?
    2. If the relay activates correctly with the 3.3V signal being applied directly to it, is there a reason to bother with the transistor at all?

    Thank you in advance for your assistance!
  2. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    Depending on the relay, 3.3V is probably marginal for driving a 5V rated relay. So the collector-emitter voltage drop, even if small, may well prevent operation when Vcc=3.3V.
    For the circuit shown, the transistor base current is ~1.5mA. If the transistor has a low current gain, the collector current may not be enough for operating the relay.
    You need a transistor as a buffer if the 3.3V source is, say, a MCU. Oherwise the back-emf spike when the relay turns off could fry the 3.3V source.
  3. AlbertHall

    Distinguished Member

    Jun 4, 2014
    You don't say where this 3.3V is coming from. If it can supply enough current to operate the relay then, no, you don't need the transistor - except that it is a 5V relay so it may not operate reliably from 3.3V. The 3.3V voltage will vary up and down with loading, temperature, mains supply voltage etc. and at some point it may be low enough to fail to operate the relay and in that circumstance the 5V supply with the transistor would solve that problem.

    When the relay wasn't operating from the 5V supply where was that 5V coming from?
  4. OBW0549

    Well-Known Member

    Mar 2, 2015
    It appears you are trying to operate a relay having a 5 volt coil on only a 3.3 volt supply. Apparently 3.3 volts is sufficient to actuate the relay when applied directly, but not when the voltage is further reduced by the Vce voltage drop across the transistor (usually around 0.2 volts or so).

    You need a 3.3 volt relay. You should also reduce the value of R1, to give the transistor more base current.

    Ummm... can the incoming signal supply enough current to operate the relay? I suspect not.
  5. AlbertHall

    Distinguished Member

    Jun 4, 2014
    If the relay you have is the SRD-5VDC-SL-C then it should pull in at 3.75V so using it at 3.3V is definitely pushing your luck.
    It really needs 5V and 72mA to operate reliably.
  6. boymedic

    Thread Starter New Member

    Sep 30, 2016
    Thanks for the input!

    To answer a few of the questions:

    The power supply for testing purposes has been the 5V supply from an Arduino board powered via USB. My multimeter is showing that it is putting out 3.3V (Not 5...I assume this has to do with the fact that the board is being powered via USB to the computer? I tested 3 other boards and all had the same voltage, so I don't believe the board is bad).

    I was able to test the signal input to power the relay directly (nothing else in the circuit whatsoever, just signal input to relay to ground), and it does operate correctly.

    Finally, forgive again my ignorance. The suggestion has been made that I need a different relay for this setup due to my power supply - I recognize the logic there, but here is my confusion. I have this exact relay on a breakout board (link at bottom) that I am able to connect power, ground, and signal to from the same Arduino board and it works (on the breakout board) perfectly. What components must be being used on the breakout board that I don't have included in my design that make this difference? Essentially, my goal is to "recreate" the breakout board's setup within my own PCB...


    Thanks again, and sorry I'm so dense!!
  7. OBW0549

    Well-Known Member

    Mar 2, 2015
    I believe that's correct; if I'm not mistaken, the Arduino's on-board 5V regulator can only put out 5 volts when the board is powered through the power input jack. Under USB power the regulator is trying to put out 5 volts, but it can't get there; I think that's why you're only seeing 3.3 volts under load.

    From looking at the photo it would seem you've duplicated what's on it. Try reducing R1 from 1.8 kΩ to something like 470 Ω; that may force the transistor deeper into saturation, giving you slightly more voltage available for the relay coil.

    But you really do need 5 volts for that thing, otherwise it's going to be VERY marginal.
  8. AlbertHall

    Distinguished Member

    Jun 4, 2014
    If your relay circuit is going to be powered by a 3.3V supply then I think you have these options:
    1. There is a 3V version of that relay SRD-3VDC-SL-C
    2. Use a MOSFET if a switch to ground will what you want.
    3. Use an opto-isolated triac or opto-isolated MOSFET.
  9. crutschow


    Mar 14, 2008
    You need to buy a 3.3V relay if you only have 3.3V.
  10. ramancini8

    Active Member

    Jul 18, 2012
    I think that the unloaded port voltage is 5V. As soon as the relay load is connected to the port the relay starts to close and the port voltage drops to about 3.3 volts. So, you have a momentary 5V to start the relay and 3.3V to finish pulling the relay in and to hold the relay in. Although 3.3V is probably an adequate holding voltage, it is not an adequate pull in voltage. The transistor base current is too low to drive the transistor into saturation with a 72 mA load, so Vce is higher than 0.2V.