LED Driver with a Square Wave

Discussion in 'Homework Help' started by Pedro Vilas-Boas, Oct 27, 2015.

  1. Pedro Vilas-Boas

    Thread Starter New Member

    Oct 27, 2015
    14
    0
    Hello,

    i am a electronics student and i need to built an light emittor where a array of LEDs have to flick with a certain frequency and have a "constant" current of max200mA, to drive the leds im using an opamp and a transistor as a current regulator, and to provide the square signal im using a 555 circuit as shown in figure below.

    circuit_Pedro Vilas-Boas.png
    http://postimg.org/image/p8c9qfdkx/full/

    In Pspice simulator everything works as expected, however, i ve tried this circuit in pratic and the 555 oscilator works good but the signal that is in the '-' input of the opamp is not even a square wave similar to the one that entered the '+' input of the opamp, which causes the leds to emitt light but not with the square wave expected. The opamp used is an LM741.

    Any idea why this is not working?
     
  2. dl324

    Distinguished Member

    Mar 30, 2015
    3,250
    626
    This is the homework forum. You must post your analysis of the problem. Many people will know the answer, but it won't simply be given to you...

    Look up the specs for the opamp being used and study anything that might effect output voltage swing. Why are you using an opamp?

    Since you are just starting electronics, I'll offer a critique of your schematic. Avoid unnecessary wire jogs, minimize white space, position the power source such that it doesn't obscure circuit intent. Draw the timer so the intent is clearer. If you don't understand, say so and I'll give you an example.
     
  3. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
    Questions:

    What is the required design frequency of the oscillator?
    What is the duty cycle of that oscillator?
    How many LEDs are in the array?
    What current do you expect to flow in each LED?
     
  4. crutschow

    Expert

    Mar 14, 2008
    13,052
    3,244
    An op amp constant current circuit is generally overkill for controlling LED current and the frequency response of your op amp limits the rise and fall time of the current.
    You just need one or two transistors for the constant current.
    If you Google constant current circuit or current limit circuit you will find some to chose from.
     
  5. Pedro Vilas-Boas

    Thread Starter New Member

    Oct 27, 2015
    14
    0
    I am using an opamp because the Hfe of the transistor can variate which causes changing in collector current. I think this way the collector current will be constant because the opamp will give the necessary current that the transistor's base asks.
    I checked the opamp specs and i chose this one because it fufills my needs it has slew rate 0.3 V/uS and 0.5uS of rise time. It s rail to rail so i think it shouldnt have problem in the output swing.
    Pratical circuit has timer with clear intent and power source is as close as possible.

    My analysis to the problem is that im doing something wrong and i cant figure what :p
     
    Last edited: Oct 27, 2015
  6. Pedro Vilas-Boas

    Thread Starter New Member

    Oct 27, 2015
    14
    0


    frequency can be anything in order of KHz with 50% duty cycle.
    I have 4 Cree XP-C Leds in series that with 200mA cause 3.5V each to fall.
     
    Last edited: Oct 27, 2015
  7. Pedro Vilas-Boas

    Thread Starter New Member

    Oct 27, 2015
    14
    0

    I understand the opamp can cause some problems with time but from specs of opamp this really shouldnt be a problem i think. And isnt it "dangerous" to connect the timer output directly do base of transistor? I think some small variation in Hfe can cause the collector current to change.
     
  8. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Are you running all four LEDs in series? You circuit doesn't show the connection of the LED(s)?
     
  9. Pedro Vilas-Boas

    Thread Starter New Member

    Oct 27, 2015
    14
    0

    Ah i forgot to mention, just for simulation purposes the R8 resistor in the transistor's collector is the 4 LEDs.
     
  10. Pedro Vilas-Boas

    Thread Starter New Member

    Oct 27, 2015
    14
    0
    i forgot to mention, just for simulation purposes the R8 resistor in the transistor's collector is the 4 LEDs.
     
  11. dl324

    Distinguished Member

    Mar 30, 2015
    3,250
    626
    The beta of a 2N2222 will not vary much at a relatively constant current and the bipolar 555 timer (LM555) can source/sink 200mA so base drive shouldn't be a limiter.
    I don't know how you're getting a rise time of 0.5uS; 0.3V/uS means about 5uS rise/fall times.
    A 741 is not rail to rail. That notion was virtually nonexistent when the 741 was designed.
    As clear as this?
    schExamp.jpg
    I substituted an LM358 so the compensation terminals don't obscure the intent. I added an LED to show that this is indeed an LED driver. I took the liberty of connecting the 555 in a more typical astable configuration.

    Notice how I drew the timing components in a line so it's easy to follow the charge and discharge paths. I understand that you're probably using the stock 555 timer from your simulator. The stock one from my schematic editor is poor and I modified it to convey intent more clearly.
    I cringe when I see people just starting out in electronics depending so heavily on simulators. I liken it to giving a calculator to a first grader who doesn't yet know the concepts of basic arithmetic and expecting that they will understand them anyway.

    Why are you using diodes to limit the input to the opamp? At the frequency you're switching the LED, does it really matter if the LED is being driven by a more perfect square wave?
     
    Last edited: Oct 27, 2015
  12. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
    You originally stated ...
    And your frequency you state as:
    Do you really expect the LEDs to "flick"?
     
  13. Pedro Vilas-Boas

    Thread Starter New Member

    Oct 27, 2015
    14
    0
    im limiting because i dont want to have a square wave with a lot of amplitude. 1.4V will limit the current in transistor's emitter to 140mA.

    At this frequency it doesnt matter that the square wave is not perfect of course but the signal emitted by the LEDs will later be received by a photodetector that is checking the frequency. (this is part of a big project).
     
    Last edited: Oct 27, 2015
  14. Pedro Vilas-Boas

    Thread Starter New Member

    Oct 27, 2015
    14
    0
    By flick i dont mean i will see them go on and off, sorry if it's not the right word. I meant that i want the LEDs to emit a signal with a frequency of some KHz.
     
  15. dl324

    Distinguished Member

    Mar 30, 2015
    3,250
    626
    Can you think of a better way that would allow the current to be adjusted?
    What did you mean by the square waves on the opamp inputs were different?
     
  16. dl324

    Distinguished Member

    Mar 30, 2015
    3,250
    626
    In general, the human eye can't perceive flicker above about 100Hz.
     
  17. Pedro Vilas-Boas

    Thread Starter New Member

    Oct 27, 2015
    14
    0
    Im going to check.

    Tomorrow i will post a photo of it. Im afraid to describe it with words, a digital osciloscope can get the frequency with no problems. But im afraid the receiver im using wont as it s a photodiode based circuit connected to a PIC32. Anyway i would like to see more of a square wave than whatever is giving now.
     
  18. ian field

    Distinguished Member

    Oct 27, 2012
    4,415
    784
    Its a perfectly valid way of going about it - and much clearer for a novice to see what's going on.

    I'd use more series diodes for a higher Vref and use a MOSFET to shunt them rather than rely on the 555 Vout-low to cut the op-amp off.

    That of course means that anything other than 50:50 mark space ratio in the 555 has to be thought of in reciprocal terms.
     
  19. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Here is another way to make a pulsed constant-current LED driver.

    I'm assuming that the pulser is the 555. Do not operate the 555 on more than 15V; that is getting close to its rated VccMax. It's output pin will swing from~1V to ~14V, see red trace.

    Q1, M1, R1 and R3 constitute a constant-current LED driver. Current through the LEDs is Vbe(Q1)/R1 = 0.67/3.3, or about 0.2A, see yellow trace I(D4), which is in units of mA.

    The addition of Q2 gates the CC driver on/off. See V(g), orange trace.

    The power dissipation in M1 is a modest ~0.5W, which doesn't require much heatsinking... See green trace, which is in units of Watts.

    135.gif

    This simulation shows what you can expect for an upper limit of pulsing frequency using this circuit. Note that the turn-on time is dominated by how long it takes to charge the gate capacitance of M1 through R3. Turn-off is much faster. Good enough to pulse at ~200KHz....
     
  20. dl324

    Distinguished Member

    Mar 30, 2015
    3,250
    626
    This is the Homework forum. Guiding the student to a solution will help him learn.
     
    Pedro Vilas-Boas likes this.
Loading...