Flyback diodes & common grounds

Discussion in 'The Projects Forum' started by leonhart88, Oct 17, 2011.

  1. leonhart88

    Thread Starter Senior Member

    Feb 23, 2007
    118
    1
    I am building a relay circuit to control 12 solenoid valves (or other non-inductors). I've placed flyback diodes across each solenoid valve output (power & ground). Please see the attached picture.

    This PCB will be put inside a box and connected via a cable to another box which contains all my solenoid valves. Since there are 12 valves, I do not really want to have 12 ground wires in my cable.

    I plan to just take ground from 2 of the terminal block outputs. I just want to double check that doing this won't affect the flyback diode protection for the other valves. Since the grounds are all common, I don't expect any detrimental effects...but I just want to be sure. Is what I plan to do alright?

    Thanks!
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    As long as the diodes are connected across the individual coils, they'll be fine.

    As long as you have large enough gauge wire for the grounds to handle the current for however many solenoids you plan to have on at once, you should be OK.
     
  3. leonhart88

    Thread Starter Senior Member

    Feb 23, 2007
    118
    1
    Thanks SgtWookie. I realize that the picture did not upload properly...here is a very crude drawing of what I am trying to illustrate (I will upload the proper picture tomorrow).

    Having the diodes connected across individual solenoid coils is what I am concerned about. Will the diodes not work properly for protection if the valves are connected in the drawing I illustrated?

    The 24V is coming from a electromechanical relay.

    Thanks.
     
  4. leonhart88

    Thread Starter Senior Member

    Feb 23, 2007
    118
    1
    Here is a better drawing of part of my schematic.
     
  5. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    That should work.

    The 1N4000 series are pretty slow. Some will say that the slowness doesn't matter. However, if you start getting blown solenoid drivers with no apparent reason, switch to a fast or ultrafast diodes, or put very small caps (~330pF) across the diodes. The small caps will make the voltage rise time longer, so the diodes will have more time to turn on. Don't make the caps much larger than that, as otherwise the transistor will get a big surge of current when it turns on.
     
  6. leonhart88

    Thread Starter Senior Member

    Feb 23, 2007
    118
    1
    Thanks SgtWookie. I assumed it would work but just wanted to double check.

    I will keep your suggestion of a fast diode in mind when I am building a prototype. The transistor I'm using (STD845DN40) is a high voltage transistor so hopefully even if the diode is slow, it will be OK.

    I've attached the rest of my schematic in case you are interested in looking at it. The relay part is PCJ-124D3MH,000. I plan to have all the solenoid outputs (V1-V12) and two grounds go through a cable to the external box which the valves are mounted on. If you spot any errors, please let me know, and thanks for your help.
     
  7. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    The relays have 24v coils, and need 8.3mA current to energize.
    If your input logic to turn the transistors on and off is 24v, the base resistors are OK at 7.5k. If your input logic is other than ~24v, you will likely have problems.

    If those LEDs are rated for a Vf of 2v to 4v ~20mA, the resistors are OK in value, but should be rated for at least 645mW for long life, 1/2 Watt absolute minimum - that's if you're also powering them via 24v. It is a shame that you are only powering one LED per "string", as you could operate several in series. As it is, you will be wasting most of the power in heating up the current limiting resistors instead of producing light.

    If you will be using super-bright LEDs, consider using 3k current limiting resistors instead of 1.2k. That way you can use 1/4 Watt rated current limiting resistors, and the LEDs should still be plenty bright enough to see. It will also help reduce the risk that a spike from the solenoids will "zap" your LEDs.
     
  8. leonhart88

    Thread Starter Senior Member

    Feb 23, 2007
    118
    1
    Thanks SgtWookie.

    I forgot to mention, the input signal is a 5V signal coming from a small USB DAQ controller. I calculated the values with 5V in order to fully saturate the transistors and got 7.5k as my resistor value...can you explain why I will have problems with voltages other than 24V?

    Thanks for mentioning about the LED resistors...I forgot to double check those. I will probably pick super bright 2mA LEDs (WP7104LSRD) and stick with 1/4W resistors. I assume moving the LEDs to the transistor collector side won't really lessen the risk of zapping the LEDs, since I'll just be moving it from the solenoid valve to the relay.

    I'm not 100% sure what you mean by this, could you elaborate?

    Thanks.
     
    Last edited: Oct 19, 2011
  9. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Those transistors you're using have a very low gain. You need to use 5 for the hFE when calculating base current. See the saturation tables; they used Ib=Ic/5 for gain.
    Rbase = (Vsupply - Vbe) / (Ic / 5)
    where:
    Rbase is the base current limiting resistor
    Vsupply will be the 5v output of your USB DAQ controller.
    Vbe is the base-emitter voltage for the transistors; use 0.7v for this.
    Ic is the desired collector current; 8.3mA
    5 = hFE for Vce(sat)
    Substituting:
    Rbase = (5v - 0.7v) / (8.3mA / 5) = 4.3 / 1.66mA = ~2,590 Ohms.
    A standard table of resistance values is here:
    http://www.logwell.com/tech/components/resistor_values.html
    Bookmark that page.
    In E24 values, the closest are 2.4k and 2.7k. You should test a few to see if the Vce is low enough if you are using 2.7k Ohms. If you don't want to test them, use 2.4k Ohms - that will work.

    7.5k would not have been adequate for standard transistors that used Ib=Ic/10 for saturation. You would have needed to use 5.1k Ohm resistors.

    OK then, use 22v/2mA = 11k Ohm resistors. 1/4 Watt would be considerable overkill. You could use 1/10th Watt and still have plenty of margin.

    Well, you really want to know if the relay is operating correctly, right? If you moved the LED to the coil side of the relay, you would no longer be monitoring the relay contacts.

    Re: LED strings
    I was just remarking on how much power you were going to be wasting in the LED current limiting resistors. Since you've changed to 2mA LEDs, this is no longer an issue. You didn't want the LEDs for lighting anyway, just as indicators.
     
  10. leonhart88

    Thread Starter Senior Member

    Feb 23, 2007
    118
    1
    I should mention that each 5V output from the USB DAQ can only output 2.5mA. Assuming HFE = 5, that gives me 1.66mA. Is this too close to the max for reliable operation?

    Also, I am a little confused with the transistor graphs. The datasheet says the HFE minimum at Ic=10mA, Vce=5V, is 10. However, in Figure 3, it looks like it's around 30 (which is what I used to calculate). Also, doesn't HFE depend on the collector current? I don't really see or understand why HFE is a constant 5 (although I see they have it on several of the graphs...). I'm also not sure how I'm supposed to find HFE for a Vce of 24V instead of the 5V they list.

    Unfortunately, I'm using all through-hole parts so I will stick with 1/4W. I've never used those 2mA super-bright LEDs. I've used normal 2mA LEDs before and they are not very bright at all. How do the super-bright ones compare to normal 20mA LEDs?

    Yes, that's correct.

    Thanks again for your help and patience!
     
  11. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You'll have to see what the output voltage is when it's sourcing 1.66mA current. The 2.4k resistors may be too high in resistance. If you don't get 1.66mA current into the transistor base, the transistor won't be saturated. The relay might still engage though; it's hard to tell from here.

    You're using the transistors as saturated switches, so you ignore all of the other hFE's except those shown in figure 4 and figure 5; where hFE=5. You want Vce to be small. If you use the higher hFE's, you'll have a large Vce.

    That's fine.
    You'll have to see for yourself. I couldn't do a good job trying to explain it in text.
     
  12. leonhart88

    Thread Starter Senior Member

    Feb 23, 2007
    118
    1
    I think I will try to look for a different transistor then...I know that some people want the base current to be around twice as much as the current needed for saturation. If I can find a transistor with a higher HFE then I think that will be on the safer side.

    OK.

    I'll pick out a new transistor and I'll run it by you again when I'm done. Thanks again!
     
  13. leonhart88

    Thread Starter Senior Member

    Feb 23, 2007
    118
    1
    OK, so I've picked new transistors and resistor values. I will be using resistor arrays for both the 27k and 10k (4308R-102-273LF and 4608X-102-103LF) in order to save space on my PCB. I'm also planning to mount the diodes vertically. I think I'll also remove one of the 12 pin terminal blocks. Instead of having one ground pin for each output, I can put all valve outputs onto one 12-pin terminal block and have a separate 3-pin terminal block for ground. I would only be taking 2 or 3 grounds through my cable anyway.

    For the transistor, I plan to use the ZTX694B. This has a HFE of 100. To saturate, I need 0.083mA. I multiplied this by two for a safety margin and calculated a resistor value of 27k (0.3W).

    I'm also using the WP7104LSRD 2mA LED along with a 0.3W 10k resistor (10k because it is more common for resistor arrays than 11k).

    I believe this should work. Do you have any other suggestions, or see any other flaws in the design?

    Thanks!
     
    Last edited: Oct 19, 2011
Loading...