Connect with us

Fading Lights

Discussion in 'Electronic Basics' started by Peter, Jul 23, 2004.

Scroll to continue with content
  1. Peter

    Peter Guest

    I want to turn on multiple 35V AC lights with a PIC then have them
    fade off. ie. fast turn on, slow turn off. The lights draw betweem
    500mA and 1 amp of current each. I was originally thinking of doing it
    with an SCR or triac and doing PWM using the PIC for the fading but I
    decided it was probably much simpler to just do it with analogue

    I was thinking of connecting the PIC to a ULN2803 then to MJE2955's
    via a base resistor. (Absolute max PIC output is 100mA or 12.5mA per
    output pin which I thought was a bit low for turning on the
    MJE2955's). Rectified 35V AC goes to the MJE2955 then to the light
    then to ground. Capacitor between rectified 35V and the junction of
    the ULN2803 and base resistor.
    - Is the circuit correct?
    - Any better alternatives?
    - What base resistor value (approx) for full saturation?
    - What capacitor value to give a fade time of about 2 seconds?

    35vAC---bridge rect---------.
    | |
    cap = /
    | |<
    PIC-ULN2803--.---/\/\----| MJE2955 PNP Power
    res |\
  2. Dan Fraser

    Dan Fraser Guest

    PWM is better. And a lot less heat dissipation.
  3. I did that idea 10 years back using Motorola HC05 and later HC08. No
    trick involved. Just bring in the zero cross of the AC line as an
    interrupt to synchronize the proc and use internal timers to subdivide
    the half cycles. I drove SCRs directly from the proc and used a full
    wave bridge so the SCR only saw positive peaks.
  4. Peter

    Peter Guest

    Well I tried it out on the weekend. Actually the reverse setup just
    for the test. ie. I used a MJE3055 NPN instead of the PNP and a
    positive (5v) source on the base. It worked fine and gave a 2 second
    fade using a 1k base resistor and a 2200uF cap. Only problem was the
    transistor got very hot during the fade, even when only driving about

    The reason I was using a transistor rather than a mosfet was because
    of that problem. I knew that mosfets don't like having the gate turned
    down but I thought transistors were ok. Isn't that the whole point of
    a transistor, being able to vary the base current to vary the drive
  5. Hmm... Well, the simple view is that when a transistor "gradually turns down
    the current" it does this by gradually increasing the voltage drop across itself
    -- the V(CE) drop. When "fully on" or saturated, this V(CE) is about .15V-.35V
    and the current gain is not so good, usually somewhere in the 10-20 range.

    Saturated, with I(C) = 1A on a MJE3055, V(CE) is about 0.21V and the base
    current is about -40mA (gain is about 25.) V(BE) is well above V(CE), at about
    0.78V. Dissipation is .78*.04+.21*1 (plus a tiny bit of heating, perhaps 1mW,
    from I(BC)) or about 250mW. Most of this power is from the V(CE) difference and
    the I(C) -- 210mW. That's not bad when the NPN is fully on, but this is your
    focus for understanding why it gets hot when the NPN isn't fully on.

    The full 35V sits across your lamp load and the NPN's CE connection. Combined,
    they have to pick up this entire voltage. When most of it is working on the
    lamp, the lamp is dissipating the heat. Fine, that means the transistor doesn't
    have to carry much dissipation. But as you remove voltage across the lamp,
    while still maintaining some current flow, then the rest of the voltage has to
    be picked up by your NPN.

    Ignoring base current and just focusing on the V(CE)*I(C) power consumption of
    your NPN:

    V(Supply) = 35V
    V(Gnd) = 0V
    V(C) = V(Supply) - R(Load) * I(Load)
    V(CE) = V(C) - V(Gnd), in the NPN switch config I'm assuming you used
    I(C) = I(Load)


    P(NPN) = V(CE) * I(C) = (V(C) - V(Gnd)) * I(Load)
    = V(C) * I(Load)
    = (V(Supply) - R(Load) * I(Load)) * I(Load)
    = V(Supply)*I(Load) - R(Load)*I(Load)^2

    You can see that this is the difference of a power varying linearly with load
    current and a power varying on the square of the load current. The latter term
    will go down faster than the first term.

    The maximum can be found by taking the differential and setting it equal to
    zero, or:

    d P(NPN) / d I(Load) = V(Supply) - 2 * R(Load) * I(Load)
    V(Supply) - 2 * R(Load) * I(Load) = 0
    V(Supply) = 2 * R(Load) * I(Load)


    I(Load) = (1/2) * (V(Supply) / R(Load))

    for maximum power dissipation in the NPN.

    Or when you are at half of your full-on current, roughly speaking. So let's
    look at that. At that level, about 1/2 the total supply voltage is sitting on
    the NPN transistor. That's about 17.5V. The current though the load at this
    point is 1/2A, too. So the transistor must dissipate about 17.5V * 0.5A or
    8.75W. That's a lot more than 0.25W! Some 35 times as much.

    In other words, it's exactly during the slow turn-off that you should expect the
    higher dissipations!

    It won't matter, by the way, if you substitute in a MOSFET (which you could do,
    as well, and perhaps more easily.) The above calculations don't really care.
    The MOSFET will have to carry that dissipation, too.

    This is one reason why some folks suggested PWM. With PWM, you either operate
    the transistor in the full-on mode or the full-off mode, keeping the dissipation
    low in the NPN. Then, you flicker it fast enough so that the human eye doesn't
    see the pulsing.

    With regular filament lamps on AC, they are actually flickering a little,
    because of the 60Hz/50Hz zero crossing, but the filament takes a much longer
    time to radiate and reduce its temperature so the power is already increasing
    again by the time it gets slightly cooler. I've "scope'd" this with a detector
    and, for example, might see variations from 95% to 105% at 120Hz due to the
    zero-cross of AC on tungsten lamps. If you DC regulate your V(Supply) you
    should pulse your PWM fast enough to get some decent averaging going on in
    either the filament, your eye, or both. If you just supply the AC directly, a
    triac can be used along with a simple zero-cross detect for your CPU and you can
    use either full half-cycle control or else phase control to adjust the
    intensity. Some protection circuitry (RC snub) may be needed to keep your
    control pin safe, though.

    LEDs can turn full-off very fast, so the variations are greater with them and
    the need for somewhat faster flickering to get our eye to do the averaging,
    rather than depending somewhat on the thermal mass of a filament.

    I'm a hobbyist and not a professional designer, so take what I say with a grain
    of salt. Someone else may wish to correct me or else add considerations of
    which I failed to take note.

  6. Yes, but you're using a linear control system and the type of control
    device (mosfet, BJT) won't make a bit of difference. They will all
    heat up the same. The PWM (which is not at all difficult at 50/60 Hz)
    can run at any brightness indefinitely and with no more heat output
    than at full on. You can DEFINITELY do your task with a 68HC08JK1 (<$4
    Digikey) and a sensitive gate SCR in 3 square inches. That proc can do
    8 channels light dimming easily.
  7. Peter

    Peter Guest

    I changed to using a 16A Mosfet (2SK2175) with a 0.01uF cap on the
    gate instead of the 10A NPN MJE3055 and 2200uF cap and it works fine.
    Only gets slightly warm with the same current and fade time. Makes the
    circuit much simpler since I can drive them directly from the PIC. It
    is only switching on/off once every 10 seconds so no heat problems and
    no need to go to the extra trouble of doing PWM. PWM is not feasible
    anyway as I am using a PICAXE ( which is not fast
    enough to do PWM properly, and definitely not fast enough to do it
    when driving the mosfets via several 74HC595 shift registers which I
    am doing.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day