More 555 PWM Questions

Discussion in 'General Electronics Chat' started by Bonden, Jan 26, 2011.

  1. Bonden

    Thread Starter New Member

    Jan 25, 2011

    Hello all. Am very glad to have found this forum! Been reading and studying, trying to relearn some of my electronics skills from the 2 year electronics engineering program I took at a community college in the mid 1980s. Never used it much, but was very glad to have done it.

    My project is replacing the 12V, 20W (2x10W) halogen bulbs in light fixtures (in my old sailboat project) with dimmable LED modules I hope to build.

    Have been reading here a dozen hours or so total and find many helpful articles on PWM, LEDs and so on, but still have a few questions.

    The driver I selected uses this chip:

    To use the dimming function it wants a PWM signal on the DIM pin. If I'm reading the spec correctly (bottom of pg 2, "DIMMING"), the wave should be about 1 kHz, at least 3.5V high.

    Have looked at two simple 555 PWM circuits:

    Any ideas on which may be more suited to my application, and why?

    In the first circuit, I see no spec for CR1 and CR2? The second circuit uses 1N5818 - would these also work in the first?

    The driver chip datasheet says, "The high voltage of DIM pin is 3.5V." Does this mean it needs to be a minimum of 3.5V to trigger reliably, or what might be the implied min/max voltage spec?

    I guess the output of a 555 PWM running on ~12VDC will be ~10.3V (read somewhere that 555 output is Vcc - 1.74...), no? Is this too much for the DIM pin, and if so, what is the best way to reduce it to an acceptable range?

    My order with Allied is mostly made up with all the stuff to get going to breadboard these (or other) circuits, depending on what advice I get here. Already have a soldering iron and VOM, but other than that I'm starting from scratch in this hobby. Pretty exciting for me!

    Any advice or comments will be much appreciated.
  2. Jaguarjoe

    Active Member

    Apr 7, 2010
    The beauty part of using the top circuit is that the author is on this board.

    Otherwise, there is no fundamental difference between the two except for the things hanging off the output (pin 3). Bill's circuit has LED's to let you see what's happening and he properly protected the motor driver transistor with the diode across the motor.
    CR1 & 2 are probably 1N4148 or 1N914 plain jane diodes with 0.7v forward drop. I believe that if you use 0.2v Schottky diodes like an SB160 (among others) instead, you'll get a slightly wider PWM range.

    The data sheet info on the DIM pin is too vague to tell for sure what that 3.5 number really means.
    Last edited: Jan 26, 2011
  3. Bonden

    Thread Starter New Member

    Jan 25, 2011
    Thanks much Joe. I've added (4) SB160s to my Allied order. I'm not planning to use the motor but am definitely hooking up the indicator LEDs.

    Guess I'll breadboard them both after I place and receive an Allied order (I don’t even have a breadboard yet). I'm looking at a used oscilloscope, and can even spell oscilloscope now without double checking... But the advice I'll need for that is another topic, I guess...

    Edited: Stupid stuff I wrote here deleted...
    Last edited: Jan 27, 2011
  4. Wendy


    Mar 24, 2008
    My personal favorite is this one, LEDs, 555s, Flashers, and Light Chasers, Chapter 5 -The 555 and PWM. It is a little more complex, but this is better IMO because of the frequency stability and the ability to cover the entire range of PWM (0% to 100%). The driver shown in this schematic isn't bad either, and it can be amped up with a MOSFET for much higher power levels (Chapter 10 - Transistor Drivers). It can be controlled via variable voltage or with a resistor as shown.


    I need to update the article to use the LM393, a 8 pin dual compariter that is very similar to the quad LM339.
    Last edited: Jan 28, 2011
  5. Bonden

    Thread Starter New Member

    Jan 25, 2011
    Very interesting - will definitely breadboard this. Thanks much! Have added some of the new components to my order list, but others are not so easy to select...

    Just picked up a cheap used EZ Digital 5060A scope and am waiting on probes from Ebay so, after learning how, I can see if it’s a keeper. It displayed the .5v calibration square wave correctly on both channels with just a clip lead held to the BNC inputs, but there's a lot more to it, I realize.

    My questions are below. Would be very grateful for any discussion, but if my inquiries are too basic or tedious, any links in the correct direction would be much appreciated as well. Have read Chapters 5 (555 & PWM) & 10 (Transistor Drivers) and the links therein, also watched the Video Lecture on voltage comparators - it sure doesn't soak in like it used to...

    - R8 controls the current through Q1? What is R8 called in this application?

    - Is R7 necessary as pull-up resistor, even if just feeding comparator PWM output to different driver?

    - I guess the LM393 is a straight swap with the LM339, with no change of other component values?

    - What is the Vout of the LM339/LM393? I see the 16 mA Iout max, but don’t see Vout listed in the datasheet... Its proly there, but in some form I don’t understand.

    - Are one of these caps more suitable (and why, if you have time)? ...big price difference. I do note you spec the Radio Shack version, but are either of these just as good, or almost as good?

    - Is this type of 1/4 watt pot generally OK, or do you suggest a different one (I want a turning-knob-type for control)? Is the 20% tolerance OK?

    - Will this circuit produce much RF interference noise? There may be 16 of these in use on board and the radios and other RF gear function has high priority over dimming the lighting.

    Any advice, comments or discussion will be appreciated.
  6. SgtWookie


    Jul 17, 2007
    R8 is a "base return" resistor. When the output of the comparator is not sinking current, R8 ensures that Q1, a PNP transistor, is turned off

    R7 is a current limiting resistor to ensure that the LED does not receive too much current.

    That is correct.

    Both of those comparators have open collector outputs; they can sink current, but cannot source current. A pull-up resistor is needed to source current. The resistor should allow a maximum of 6mA current flow into the output of the comparator, or the output saturation voltage will be rather high, and the comparator will start to dissipate power as heat.

    Ignore the "16mA typical" rating. If you want to be certain that your circuits will work, use the 6mA rating; and stay at or below that wherever possible. I suggest a range of 3mA to 4.5mA is a good target for a low Vsat(out).

    Go with the Cornell-Dubilier 168104J50A-F.

    That's a REALLY small pot. The pins are 0.1" on center, which gives you an idea on how small the rest of it is. It would be fine for plugging into a breadboard, but you'd really want something larger if you're going to put a knob on it.

    Bill's schematic is simplified; it doesn't show the bypass capacitors across the power pins. Each and every IC requires a minimum of a 0.1uF capacitor across it's supply pins, and many require more than just that one cap. I suggest that you also include a 100uF electrolytic capacitor near the 555 timer, rated for 16v to 35v. The 555 timer can cause "glitches" on the power rail due to the way it toggles states; there is an instantaneous and momentary dead short across the supply. Good bypassing and keeping the wiring very short in length will help reduce or eliminate any RFI.
    Last edited: Jan 31, 2011
  7. Wendy


    Mar 24, 2008
    One of the common themes we get here at AAC is people trying to use op amps as comparitors. They are close, but not the same. Occasionally you can use an op amp for a comparitor, but with questionable results.

    Comparitors are fast, they are funtimentally digital gates with analog inputs. They are also known as single bit A/D converters. As Wookie mentioned, they are also open collector, which helps thier speed considerably. Because op amps are fundimentally analog, they tend to be slower. Old op amps much more so.
  8. Bonden

    Thread Starter New Member

    Jan 25, 2011
    Thanks much, Bill and Sarge, for all that!

    I did see that R7 keeps D1 from popping, but wondered if it had another role and so must be considered in the event D1, and mayhap Q1, was not wanted in the ckt - Bill says in his write up:
    "The LM339 comparator shown absolutely requires a pull up resistor as shown with R7, usually a 10KΩ resistor." Does that mean 'requires' if the output is to be used where sourcing current is needed, or 'requires' to prevent a bad thing from happening to LM339? Or am I missing the point completely? That wouldn’t surprise me... Thanks to you both for your patience.

    I read up a little... Is this true for open collector, occurring at the output of the comparator: "[current flows] whether the output logic is HI or LO (although the current is very small if the output is HI)"?

    If so, is it true that Q1 is on when LM339 output is LO and off when it is HI?

    So, there is no way to directly drive the DIM pin of the driver chip to +5v with the LM339 output because it can't source current and so never rises above 0v?

    The datasheet for the driver chip wasn't too clear, but the datasheet for the ready-made driver device I was considering specifies:
    "PWM terminal. When applied with +5v or suspended, full amount of current will be output and when connected with ground, output current will be 0."

    Guessing to drive DIM pin HI, Q1 is not needed, since current will be limited to ~3mA, as disscussed, and a pull-up resistor will suffice?

    Fishing here: Does a "pulled up" >+5v on the LM339 output stay "unsunk" when output is HI, but get sunk when the output is LO?

    If I'm on the right track here, to limit LM339 output to 3mA, Vin is 12.5v and 5v output is wanted, the pull-up R (not considering the LM339 output path, which is unknown to me) should look like this: (12.5-5)/.003 = 2.5K?

    Is there some sort of a LM339 output path bias or other factor to consider in calculating pull up R? The datasheet specs on that are Greek to me.

    I found and read the sticky on Bypass Capacitors and added a handful to my order.
  9. Wendy


    Mar 24, 2008
    When an output is "open collector" it is usually a logic gate. Since comparators are about speed and not linear response they used the concept for them. Not all comparators are open collector, just the easy to buy ones.

    Open collector refers to a BJT transistor who collector is hanging out there with nothing else on it.


    If there is no collector resistor to Vcc there can be no output. However, if you tie another open collector output to the first (and there is a collector pullup resistor), it will become a logic NOR function. As with everything, it is about tradeoffs.

    10KΩ for the open collector pullup resistor is a default, not a requirement. You should not exceed 16ma though the transistor however, and less is better for speed. The more current you try to make the transistor absorb, the slower it will switch.
  10. Wendy


    Mar 24, 2008
    Another circuit I am quite fond of is the Common Collector circuit, AKA an Emitter Follower. The base input resistance it the gain of the transistor X the emitter resistance. This allows for some really high impedance circuits.

    Logic families like CMOS are designed for high input impedance, low output impedance (with very little drive). I use this circuit a lot with them.


    If you look very close you will see a resemblance to the PWM driver. If the LED is using 20ma the input of this circuit is using around 0.1ma.