Author Topic: Switching a relay with a transistor for 12V LED red light  (Read 6250 times)

0 Members and 1 Guest are viewing this topic.

Offline originalscottygTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Switching a relay with a transistor for 12V LED red light
« on: June 27, 2016, 08:47:40 pm »
Noob alert... please be nice  :o
I am trying to switch on a red "On Air" light (12V LED strip) using the GPIO Tally outputs of a popular audio console.  The idea is that when the talkback mic is on, the "On Air" light turns on so the clients know when the talent can hear them.  The console's documentation on how to use the tally outputs are fairly vague, saying only "All tallies are open collector pull down using 47R series resistor".  The console's tally output is a logic signal that goes high when switched on.  I have measured the voltage on this output using a Fluke 177 and it measures about 0.585V when switched on, referenced to the 0V pin on the console's  multi-pin GPIO connector.  I was advised by the manufacturer to use a transistor to switch a relay to supply the 12V to the red light.  So far so good. 

Below is the circuit that I've wired up on a proto-board. 

Unfortunately it doesn't work.   |O  When I originally asked the question to the manufacturer, I was using a 1K base resistor, because that's what I saw in sample circuits that they had sent me.  Their response was "...So, if you need to sink 40mA through the collector and you're sending half a volt to the base, referenced to the LED supply negative, try a 12 ohm resistor in place of the 1K.  You could probably just remove the resistor all together with the same result...."  This seems strange to me because the datasheet for this 2N3904, which is one of the ones that they recommended, shows the turn-on voltage starting at 0.6V and rising from there depending on various parameters.  My thought is that the 0.585V that the console is putting out is not enough to exceed the turn-on voltage for the transistor, so no base current is flowing and therefore no collector current is flowing and the relay isn't switching.  When I connect this circuit to a bench supply at home and feed the base with 0.7V or more, the circuit seems to work fine.  I did try several value of base resistor and I tried bypassing the base resistor and sending the 0.585V from the console directly to the base.

Am I correct in thinking that the voltage coming from the console is too low to turn on the transistor?  Is there a way to make this work using the existing voltage from the console (0.585V)? 

Also, just to clarify, the 12V supply is a SMPS "wall wart" type that measures quite high ?19VDC unloaded.  Not sure if this affects the operation of the transistor.

Thanks for the help!
« Last Edit: June 27, 2016, 09:05:42 pm by originalscottyg »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Switching a relay with a transistor for 12V LED red light
« Reply #1 on: June 27, 2016, 09:06:03 pm »
Because the output is 'open collector', it is only capable of pulling a voltage down.  It does not pull the transistor base up.  It also doesn't provide voltage which is what your circuit requires.

So, assuming your output circuit can withstand 12V, use a 1k Ohm resistor to pull the base up and let the open collector pull it down directly.  Of course, this is logically backwards in that the open collector pulls the base down when it logically needs to rise.  You could reverse the contact connections on the relay but this is ugly.

You can use a PNP transistor.  Connect the emitter to +12V and connect the collector to one side of the relay coil and the other side of the coil to ground.  Connect a 10k resistor between the base and 12V and a 1k resistor between the base and the open collector output.

The 1k resistor could be larger if I knew what transistor you were using and how much current the coil took.

Like figure 8.2 here:
http://www.w9xt.com/page_microdesign_pt8_pnp_switching.html

 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Switching a relay with a transistor for 12V LED red light
« Reply #2 on: June 27, 2016, 09:09:39 pm »
When you want to use a transistor as a switch, drive it into saturation,
the rule of thumb is to supply Ib = Ic / 10, so if you want 100 mA
in the collector then supply 10 mA to the base and the output should
stay in saturation.

The high output of .585 V is very marginal to turn on the 2N3904,
one usually uses (at room temp) .7 V as Vbe turn on. You need to find
out from manufacturer what the voltage source looks like , the .585,
is it low Z out or high. Stated another way how much current can it deliver
at that V ?

The whole thing sounds fishy to me, eg. an active high that can only generate
.585 V. If thats the real case you might gave to use a RRIO OpAmp / Comparator
to get an adequate drive source for the 2N3904.

Regards, Dana.
« Last Edit: June 27, 2016, 09:20:21 pm by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Switching a relay with a transistor for 12V LED red light
« Reply #3 on: June 27, 2016, 09:13:05 pm »
If its open collector with a pulldown R then its probably a PNP
pulling to the supply rail to generate the high voltage. Or a
MOSFET or.....manufacturer should show in its datasheet what
the interface signal path looks like.

Its also odd that the pull down is 47 ohms, the manufacturer
must think energy costs nothing. There is something we do not
understand about this output.

Regards, Dana.
« Last Edit: June 27, 2016, 09:22:58 pm by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline originalscottygTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Switching a relay with a transistor for 12V LED red light
« Reply #4 on: June 27, 2016, 09:31:47 pm »
Thanks for the responses!  I am a sound re-recording mixer and I have no electronics background whatsoever, aside from some light reading.  So I'm a bit out of my depth here.

The general circuit configuration is what was recommended to me by the manufacturer of the console.  They sent me a sample circuit (that I can tell they pulled directly from google) that I have attached below.

I also attached the page of the manual that has the pinouts of the GPIO connector, and the notes regarding the "open collector" configuration. I am using Pin 10 "TB All Tally" and Pin 2 0V, as can be seen in my original schematic.  I am using the TB All Tally outputs because they are switched on with the talkback switch, and not the "Red Light Relay contacts", as those are not tied to the talkback and are actuated with a separate switch.

Thanks again for the help!!
 

Offline originalscottygTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Switching a relay with a transistor for 12V LED red light
« Reply #5 on: June 27, 2016, 09:37:39 pm »
Because the output is 'open collector', it is only capable of pulling a voltage down.  It does not pull the transistor base up.  It also doesn't provide voltage which is what your circuit requires.

So, assuming your output circuit can withstand 12V, use a 1k Ohm resistor to pull the base up and let the open collector pull it down directly.  Of course, this is logically backwards in that the open collector pulls the base down when it logically needs to rise.  You could reverse the contact connections on the relay but this is ugly.

You can use a PNP transistor.  Connect the emitter to +12V and connect the collector to one side of the relay coil and the other side of the coil to ground.  Connect a 10k resistor between the base and 12V and a 1k resistor between the base and the open collector output.

The 1k resistor could be larger if I knew what transistor you were using and how much current the coil took.

Like figure 8.2 here:
http://www.w9xt.com/page_microdesign_pt8_pnp_switching.html

The relay and transistor are external to the console, with the console's tally output is feeding the base of the transistor.  The 12V supply is an external SMPS that is powering the transistor and relay, as well as the supply for the red light.  The console's 0V pin is referenced to the negative side of the external 12V supply.  The transistor is 2N3904, the relay coil takes 37.5mA and is 320 ohms coil resistance.  I am not sure what the note about the open collector pulldown is referring to in the console's manual.
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: Switching a relay with a transistor for 12V LED red light
« Reply #6 on: June 27, 2016, 10:03:41 pm »
 
Quote
There is something we do not
understand about this output.

Yep. I'm wondering what kind of logic system uses 0.585V for a "high" logic state.

hint:
rstofer said:
Quote
Because the output is 'open collector', it is only capable of pulling a voltage down.  It does not pull the transistor base up.  It also doesn't provide voltage which is what your circuit requires.


« Last Edit: June 27, 2016, 10:21:43 pm by alsetalokin4017 »
The easiest person to fool is yourself. -- Richard Feynman
 

Offline MatthewEveritt

  • Supporter
  • ****
  • Posts: 136
  • Country: gb
Re: Switching a relay with a transistor for 12V LED red light
« Reply #7 on: June 27, 2016, 10:17:32 pm »
If its open collector with a pulldown R then its probably a PNP
pulling to the supply rail to generate the high voltage. Or a
MOSFET or.....manufacturer should show in its datasheet what
the interface signal path looks like.

Its also odd that the pull down is 47 ohms, the manufacturer
must think energy costs nothing. There is something we do not
understand about this output.

Regards, Dana.

I read it as meaning a transistor (npn) pulling down with \$47\Omega\$ in series between the connector and the collector for protection.

Yep. I'm wondering what kind of logic system uses 0.585V for a "high" logic state.
Sounds about right for bipolar open collector with no load.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Switching a relay with a transistor for 12V LED red light
« Reply #8 on: June 27, 2016, 10:20:50 pm »

I read it as meaning a transistor (npn) pulling down with \$47\Omega\$ in series between the connector and the collector for protection.

Sounds about right for bipolar open collector with no load.

That's the way I read it.  Some kind of open collector arrangement like an NPN transistor with a resistor in the collector to prevent overcurrent.
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: Switching a relay with a transistor for 12V LED red light
« Reply #9 on: June 27, 2016, 10:25:48 pm »
Quote
Sounds about right for bipolar open collector with no load

And where does this voltage come from? The collector is open, except it is pulled down to ground by the 47R, no? And the emitter is grounded, no?

« Last Edit: June 27, 2016, 10:31:02 pm by alsetalokin4017 »
The easiest person to fool is yourself. -- Richard Feynman
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: Switching a relay with a transistor for 12V LED red light
« Reply #10 on: June 27, 2016, 10:34:50 pm »

I read it as meaning a transistor (npn) pulling down with \$47\Omega\$ in series between the connector and the collector for protection.

Sounds about right for bipolar open collector with no load.

That's the way I read it.  Some kind of open collector arrangement like an NPN transistor with a resistor in the collector to prevent overcurrent.

This makes sense because the open-collector circuit is generally used to _sink_ current rather than to source it, isn't it? Turn the transistor with the open collector on and it provides a path to ground through the emitter.  So the example circuit provided to the OP by the technician is not correct for this application.
The easiest person to fool is yourself. -- Richard Feynman
 

Offline MatthewEveritt

  • Supporter
  • ****
  • Posts: 136
  • Country: gb
Re: Switching a relay with a transistor for 12V LED red light
« Reply #11 on: June 27, 2016, 10:42:49 pm »
And where does this voltage come from? The collector is open, except it is pulled down to ground by the 47R, no? And the emitter is grounded, no?



If it were a pull down resistor then you're right, there would be no voltage (0V), but that's not what I think is happening. I've attached a picture of how I think the output works. EDIT: Looks like you found one already. :) Note that in neither picture is there a resistor pulling the output directly down to ground.

Honestly I'm not entirely sure why this happens (but I am sure that it does). What I think happens is that the output is very weakly pulled high by the diode between the base and collector (the imperfect diode leaks a little current), and the action of the 'on' transistor can only pull down to about 0.6V as it has its own bandgap to contend with.
« Last Edit: June 27, 2016, 10:44:41 pm by MatthewEveritt »
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: Switching a relay with a transistor for 12V LED red light
« Reply #12 on: June 27, 2016, 10:56:50 pm »
Why call it a pulldown resistor then? Here's what I think is happening. I think rstofer nailed it.

The 47R is a pulldown resistor between the 'open collector' and ground. It forms one half of a voltage divider. The other half is the external pull-UP resistor connected from the positive rail to the base of the external switching transistor, and that pulls the base of the external switching transistor UP (and relay coil on) when the console logic output state is LOW. When the state goes HI, the open-collector transistor shorts the 47R, which allows the base of the switching transistor to go low, turning the relay coil off.

So why is it "ugly" to use the NC contacts of the relay instead of the NO to switch the LED?
« Last Edit: June 27, 2016, 10:58:55 pm by alsetalokin4017 »
The easiest person to fool is yourself. -- Richard Feynman
 

Offline MatthewEveritt

  • Supporter
  • ****
  • Posts: 136
  • Country: gb
Re: Switching a relay with a transistor for 12V LED red light
« Reply #13 on: June 27, 2016, 11:09:32 pm »
Why call it a pulldown resistor then?
They don't,  they call the transistor an open collector pulldown, and then say that it has a series resistor. No mention of pulldown resistors or pullup transistors.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Switching a relay with a transistor for 12V LED red light
« Reply #14 on: June 27, 2016, 11:14:20 pm »
I didn't mean to imply that I thought the internal 47 Ohm resistor went to ground, I meant that it probably was in series with the collector to limit the current.  Of course 47 Ohms and 12V is still a lot of current 256 mA.

I don't like using the NC contacts because this would mean the relay was energized when the sign was off - and vice versa.  If that's ok with the OP, it works for me!

We still don't know how much current the relay takes and lacking that, we are just stumbling around trying to size the base resistor.
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: Switching a relay with a transistor for 12V LED red light
« Reply #15 on: June 27, 2016, 11:25:05 pm »
Why call it a pulldown resistor then?
They don't,  they call the transistor an open collector pulldown, and then say that it has a series resistor. No mention of pulldown resistors or pullup transistors.

Ah... OK, I see now that I was misinterpreting the phrasing, thanks.  But even so, the system still appears to be designed to sink current rather than to source it. So this still means that the circuit provided by the console manufacturer's technician is incorrect for this application.

So you'd use the NPN switch circuitry that rstofer described (which I'm too lazy to draw out on my "DaveCAD" at the moment) and the NC contacts of the relay.

I didn't mean to imply that I thought the internal 47 Ohm resistor went to ground, I meant that it probably was in series with the collector to limit the current.  Of course 47 Ohms and 12V is still a lot of current 256 mA.
Sure, means 3 Watts dissipated in the series resistor, which surely isn't right, you can't apply 12 volts directly to the Pin 20. But the current will be limited by the external pullup resistor in your circuit.
Quote


I don't like using the NC contacts because this would mean the relay was energized when the sign was off - and vice versa.  If that's ok with the OP, it works for me!
It would seem to be the simplest solution...
Quote
We still don't know how much current the relay takes and lacking that, we are just stumbling around trying to size the base resistor.

Actually the current is specified as a bit under 40 mA.
« Last Edit: June 27, 2016, 11:32:42 pm by alsetalokin4017 »
The easiest person to fool is yourself. -- Richard Feynman
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2549
  • Country: us
Re: Switching a relay with a transistor for 12V LED red light
« Reply #16 on: June 27, 2016, 11:36:13 pm »
I would test the output by putting a 10k resistor from the output pin to 12V and measuring the output pin voltage when it's turn on and then off.

Assuming it's an open collector to GND, the driver could look like the attached circuit.
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: Switching a relay with a transistor for 12V LED red light
« Reply #17 on: June 27, 2016, 11:51:54 pm »
Makes sense. Eliminates the relay. Simple!
(But do we have a PNP transistor on hand?)    :)
The easiest person to fool is yourself. -- Richard Feynman
 

Offline originalscottygTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Switching a relay with a transistor for 12V LED red light
« Reply #18 on: June 28, 2016, 08:30:25 pm »
Hi all.  Thanks for all the responses!!
It will take me a little while to go through them and digest the info, most of which is a bit over my head at this point.  :-//

A few updates... 
I took my circuit home and put it on my bench last night to double check it.  It works perfectly when I feed it appropriate voltages from my bench supply.  The transistor turns on at about 0.6V to the base, and reaches saturation at about 0.7V, pulling about 40mA through the relay.  When I have the voltage to the base just slightly below 0.6V, to simulate the 0.585V that the console is putting out, the transistor stays in cut-off and the relay doesn't switch.

It is possible that the console is just not putting out the correct voltage.  I did have to replace one of the power supplies late last year, so it is possible that something is just broken.
Also, I haven't heard back from the tech at the manufacturer.  I thinks it's fair to let him have a chance to respond before I jump to any conclusions.  I just find it strange that he implied in his previous response that this circuit should be able to work with half a volt on the base.

Thanks once again to everybody that responded.  I'll take some time when I get home from work to try to wrap my head around all the ideas posted and of course I'll let everybody know how things turn out.  :-+
 

Offline originalscottygTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Switching a relay with a transistor for 12V LED red light
« Reply #19 on: July 01, 2016, 02:56:49 pm »
Hi everybody,
Thanks again for all the input.  Turns out the manufacturer had given me some incorrect info initially.  The circuit I built worked perfectly on the bench but not with the console because it is the wrong circuit for this application.

Quote
Sounds about right for bipolar open collector with no load

And where does this voltage come from? The collector is open, except it is pulled down to ground by the 47R, no? And the emitter is grounded, no?



This seems to be the correct internal configuration of the console's open collector output.  The tech told me that the 0.585V that I was measuring was most likely a voltage drop across my DMMs internal resistance.

So all I need to do is connect my relay and diode between my external power supply and the tally output (collector of internal transistor).  Hopefully I'll get a chance to test this out later tonight after all my recording sessions are done.

I attached a new schematic of how I plan to hook this up.
Thanks!!
« Last Edit: July 01, 2016, 02:58:21 pm by originalscottyg »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf