0

I'm working with a product that provides an I/O signal, which connects the output to a digital common when the relevant output is true. The product also provides a 50mA max +5 Power source. The top image is a recreation from product info on how to connect a load.

I would like to use this output so that when conditions are true (output connected to ground) it turns ON a 12V solenoid, powered from a different rail. I utilized this example Example Link as an example of how to reverse the logic. I'm just not clear if this represents the same condition as what I have originally. Does my sample circuit look correct?

--Edit-- The controlling device is an open-collector output that can switch up to 30V, but it can't source enough current to power the solenoid I've chosen.

5v to 12v switching diagram

  • They're called open-collector outputs and, to get lowest component count you should provide more data about the output. A link to a data sheet might suffice. – Andy aka May 22 '23 at 18:32
  • Just like Andy said it above, you didn't give us enough information to be able to answer you correctly. Your "product" may be capable of withstanding up to 20V or 40V and sink enough current to power the solenoid, but we can't know it without more info from you. I am giving you an answer below which assumes 0V when output is active (LOW) and 5V when output is high. – Edin Fifić May 22 '23 at 19:27
  • The maximum continuous collector current rating for a 2N3904 is 200 mA. That may be enough to drive a small solenoid. It may be insufficient for a larger solenoid. Check the solenoid's current rating and/or test the DC resistance of the solenoid with an multi-meter and divide 12 V by your measurement. – Math Keeps Me Busy May 22 '23 at 19:31
  • Sorry, should have specified that the solenoid is 55 mA but the output can only source 30 mA. – user2059972 May 22 '23 at 19:59
  • 1
    Please _edit your question_. Do you have a datasheet for the device? The language "pulled low when active" suggests an open-collector output -- that's not going to turn on your first transistor. Also, some open-collector outputs can handle a higher voltage than the device's power rail -- if that open-collector output can be pulled up to 12V, then viable circuits are a lot easier to come by. While you're editing, let us know how much current your solenoid draws. – TimWescott May 22 '23 at 22:13
  • @TimWescott, updated... it could switch 12V but can't provide enough current for the solenoid. – user2059972 Jun 03 '23 at 03:33

2 Answers2

3

Assuming 5V when output is high, and 0V when output is low, you could use the circuit below:

schematic

simulate this circuit – Schematic created using CircuitLab

  1. D1 is a 10V zener which ensures the Q1 transistor is off until the voltage between its base and the "product" output is at least 10V. Without it, the transistor would be on whenever the "output" is 0.6V lower than its emitter connected to 12V, which means a voltage from 0V to 11.4V would keep it on.
  2. R3 limits the current through the zener and the base of the transistor.
  3. D2 is a rectifier diode which blocks current in the forward direction (when Q1 is on).
  4. D3 is a zener diode which keeps the D2 from immediately shorting out the relay/solenoid and its zener voltage should be lower than Q1 maximum Vce rating to prevent its damage. The reason for this zener is a better relay/solenoid action when it's being turned off.
Edin Fifić
  • 5,188
  • 7
  • 24
0

I am showing your open-collector output as a switch to ground.

Choose Q1 such that it has enough current capacity to drive the solenoid, and a VCE rating of at least 24V (that should be easy).

Choose the base current to be \$I_b = I_s \frac {10}{H_{FE}}\$, where \$I_s\$ is the current needed by the solenoid. If that current is more than your driver can sink, stop and have a re-think. If you're looking at drive transistors from the 1970's, look at real electronics distributors catalogs (i.e. DigiKey or Mouser in the US) -- there are transistors with just awesome \$H_{FE}\$ ratings compared to the old power transistors. If you still aren't there, then re-think the circuit (you could always use a P-channel MOSFET here).

Choose R1 to pass your desired \$I_b\$ when there's about a 10V drop across it (that's your 12V supply minus the base-emitter drop minus some wiggle room).

R2 is there to make the transistor stay turned off, you can choose anything between R1/10 to R1.

Chose D1 to have a steady current rating of at least 1/10 the solenoid's current rating (equal is better). I'd also choose a diode that's intended to be a power diode.

schematic

TimWescott
  • 44,867
  • 1
  • 41
  • 104
  • Thank you, much appreciated! I feel like I'm missing something, however. Per the math, Ib=Is*(HFE/10), the larger HFE, the larger Ib is. You mentioned if this exceeds the sinking current of the driver, I need to re-think the circuit. However, only extremely small HFe values will actually reduce Ib to be less than Is... meaning I'd be better off not using the transistor at all. To user numbers, my driver can sink 30 mA but I need 70mA for the solenoid. It seems to defeat the purpose of using a transistor if I'm amplifying the current required, do I have something backwards? – user2059972 Jul 14 '23 at 20:08
  • I had my fraction inverted -- sorry. Out of saturation, the collector current is $I_c = I_b H_{FE}$. Solving that (correctly, he says, blushing) you get $I_b = I_c / H_{FE}$. _In_ saturation, increasing the base current doesn't strongly increase the collector current, but it does lower the collector-emitter voltage. It's a rule of thumb to increase the design base current by a factor of ten to insure saturation -- hence my (corrected) rule. – TimWescott Jul 17 '23 at 01:03