Controlling the brightness of LED's with a semiconductor - A simple circuit required please

wayneh

Joined Sep 9, 2010
18,184
In the picture below the top trace is the base pin / Pin 7 of the 555.
I wonder if you could indulge me one experiment? Put a resistor, say 1k-10kΩ, between the emitter and ground, in parallel with the LED load. See if that tail disappears.

The transistor should (and most likely does) cease conducting when its base is pulled low. Any voltage you measure after that instance may be a bit of a ghost and doesn't really indicate current flowing through the transistor.
 

phonic

Joined Sep 29, 2016
37
Hi Wayneh.
This is interesting because since posting the scope picture I've recreated the circuit on some Vero board and have got some different results.. In the picture below the top trace is the base pin / Pin 7 of the 555. The second trace is the emitter leg. So the distortion is coming from the BD139? Another phenomena Is that the pot control is no longer linear. When the duty cycle gets to about 30% it stops outputting all together. It flickers a little then it goes out. Strange. The original circuit is on a bread board with a LM555CN. The Vero version has a NE555P. Could this be the issue? (BTW: the pot, Cap and R are identical)


Hi NT,

The 'distortion' that you see on the negative edge of the output is just what you would expect from an emitter follower output- there is a simple explanation for this.

But the real problem is that the transistor will be distressed and possibly the 555.

phonic
 
Last edited:

GopherT

Joined Nov 23, 2012
8,009
Post a drawing of your circuit with values and exact number of LEDs you are driving. I am concerned that you say our 1N4148 were getting hot. There shouldn't be so much current on a timing circuit that they get hot. Something is connected wrong or you have too much current flowing.

Also, post a photo of your vero board and your bread board.
 

wayneh

Joined Sep 9, 2010
18,184
@GopherT raises a good point. I ignored your comment about the diode heating. I think that's a problem when the pot is all the way to one end or the other, and in that case there is no resistance in the current path. There should probably be a resistor in series with the wiper of the pot, so that there is some resistance in the current path even when the pot is at the extremes.
 

phonic

Joined Sep 29, 2016
37
@GopherT raises a good point. I ignored your comment about the diode heating. I think that's a problem when the pot is all the way to one end or the other, and in that case there is no resistance in the current path. There should probably be a resistor in series with the wiper of the pot, so that there is some resistance in the current path even when the pot is at the extremes.
Yes, that is correct, just like the PWM circuit that I posted.

(only one stopper is required because the pull up resistor on the discharge pin acts as the other stopper)

phonic
 

Thread Starter

Neville Thannhauser

Joined Dec 3, 2016
27
Good afternoon all.

A 5K resistor across the LED's does indeed clean up the output of Tr1.
There is still some random low voltage noise at the end of the 0v phase, but there was before too.

The non linearity of the control is still there in the Vero version - even with a series R on the wiper (from 1K-100K)
One line of investigation will be to look at the pin4-8 and pin6-2 links. On the Vero version they not too pretty and run beneath the IC.
Perhaps there is a short or a induced capacitance?? I'm slightly ashamed of the Vero pics but here goes? (don't all shout at once...)



Will the variance in the 555s have any bearing on the linearity issue? (BreadB= LM555CN vs Vero= NE555P)
 

GopherT

Joined Nov 23, 2012
8,009
What voltage are you running this at? Each LED will need 2volts so a series string of three will need 6 volts plus some head room for the resistor to limit current. This should be running in 8 or 9 volts, correct? I think you said something about 8 volts earlier. So, your operating current is about 30 mA per string. And, overall = 7 X (2/68) = 200 mA
 

Thread Starter

Neville Thannhauser

Joined Dec 3, 2016
27
Hi GT,
I've recreated the Vero circuit and made it a lot easier to fault find. I've put in an IC socket so I can swap between the two 555 versions and I think I have the answer to non linearity issue. The LM555CN works fine. The NE55P does not.

I've been running the circuit on 12V (for reasons below). The output of the TR1 (unloaded) is 9.25V @ 100% duty cycle.

The amber LEDs have been running in series sets of 3 with a 68ΩR. In the test breadboard setup (photographed) the LEDs are in a 3x7 array.

The measured voltage drop across each LED is 1.5V in this arrangement. The total current being pulled at 100% is 110mA (according to my bench supply)
So: (110mA/21 LEDs = 5.24mA per LED) Less I guess as the 555 will be taking a bit of the total current.

I was planning to adjust the LED array and series resistor once we'd nailed the PWM part of the circuit - which I guess we have. Thanks Chaps :D

I have a drawer full of old "12V" wall warts which appear to output voltages way above 12V so I planned to incorporate a L7812CV regulator which will output a steady 12V.

Is that a plan?

Thanks again for all your help and support.
 
Last edited:

Thread Starter

Neville Thannhauser

Joined Dec 3, 2016
27
Hi Phonic,

I've just assembled your LED_String_Controller_Iss2 and it works just fine but can't my head around how it's altering the LED intensity.

When I probe the circuit I'm getting some really interesting waveform's, and not was I was expecting (when compared to the 555 circuit).
Ch1 below is showing Pin1 output of the LM358.
Ch2 is the drain pin of the MOSFET



When I alter the brightness of the LED's using the pot, the waveform appears to change amplitude but the relationship between high and low does not seem to alter greatly. Also I notice that the waveform frequency is really high (100K) when compared to the previous circuit.

All very interesting... Or have I got something wrong in the circuit?
 

wayneh

Joined Sep 9, 2010
18,184
A 5K resistor across the LED's does indeed clean up the output of Tr1.
Thanks for performing that experiment. It confirms what @phonic suggested, that the LED strings have some reactance that prevents the voltage at that point from falling immediately after the transistor has turned off. There's no reason to leave the resistor connected, but it's nice to know what caused that trace.
 

hp1729

Joined Nov 23, 2015
2,304
POST ISSUE 02 of 2017_01_09 PLEASE SEE POST #34 FOR A REVISED VERSION OF THIS CIRCUIT

Hi NT,

Below is a circuit I came up with.

It is a bit more complex than you requested and you will need to arrange the LEDs in a 4 by 12 array, instead of a 6 by 8 array.

Design guidelines for that 2R7 ohm resistor, please. Current? Voltage?
In the OP's circuit he has a 1 ohm resistor so he must be real close to the power rail as it is.

phonic

 

phonic

Joined Sep 29, 2016
37
Hi Phonic,

I've just assembled your LED_String_Controller_Iss2 and it works just fine but can't my head around how it's altering the LED intensity.

When I probe the circuit I'm getting some really interesting waveform's, and not was I was expecting (when compared to the 555 circuit).
Ch1 below is showing Pin1 output of the LM358.
Ch2 is the drain pin of the MOSFET



When I alter the brightness of the LED's using the pot, the waveform appears to change amplitude but the relationship between high and low does not seem to alter greatly. Also I notice that the waveform frequency is really high (100K) when compared to the previous circuit.

All very interesting... Or have I got something wrong in the circuit?
Hello NT,

Well, that is interesting that you built the circuit of post #34 (is that correct).

What you are seeing appears to be a classic case of parasitic oscillation: post #34 is is a linear circuit and there should be no AC signal on the drain of the NMOSFET. Parasitic oscillations are often caused by stray reactive components: capacitors and inductors.

I had to smile because, after all the debate about a linear versus PWM approach, the linear circuit of post #34 has, in fact, turned into a pulse circuit, but not PWM.:)

There are a number of ways to eliminate parasitic oscillations in linear circuits but the main ones are:
(1) Shape the open loop response of the feedback system: in this case limit the frequency response to a very low frequency where the parasitic effects are negligible.
(2) Change the physical layout of the circuit: long wires, especially around the inverting and non-inverting inputs of the opamp, are particularly troublesome.
(3) Re-order the 0V points on the physical layout to eliminate positive feedback.

Just two questions:
(1) Is the spare opamp in the LM358 connected as shown on post #34? Spare sections of chips need to be put in a defined and safe state or they can get up tp all sorts of antics and cause havoc inside the whole chip.
(3) Is there a 100nF ceramic capacitor connected directly across the supply line pins (4 & 8) of the LM358?

Would it be possible to post an image of the physical layout of the circuit of post #34.

Funnily enough, on another forum, yesterday I sorted out an oscillating LM358 audio amplifier built with long wires on a breadboard. That was cured by a more compact layout and shorter component leads.

In case your wondering why a DC circuit should oscillate, the answer is that the opamp does not know where it is or what it is supposed to do. A typical opamp has a voltage gain of one million at low frequencies so only one microvolt between the opamp input pins will produce a one volt output- you can induce one microvolt into a circuit just by looking at it.:D

I have only just woken up but, after a coffee, I will consider the best approach to sort out the oscillations.

In the meantime, would you like to try the following, one at a time, and see if the square wave on the drain of the NMOSFET ceases or changes character:
(1) Connect your scope probe to the drain of the NMOSFET and connect the earth of the probe near to the OV point at the lower end of the source resistor.
(2) Without shorting any points, put your finger on the body of the LM358 and generally around the circuit.
(3) Connect a 100pF capacitor with short leads between the non-inverting and inverting inputs of the LM358. try a range of capacitor values.
(4) Increase the value of the source resistor

Don't worry: opamps oscillating on breadboards is quite normal.:D

phonic
 
Last edited:

phonic

Joined Sep 29, 2016
37
Hi again NT,

As promised, here are some more thoughts about eliminating the square-wave at the drain of the NMOSFET.

I just realized that that the wave-shape looks suspiciously like noise from a switch mode power supply (SMPS) and the frequency is about right too. On reflection, the square wave looks a bit too solid to be caused by parasitic oscillations. Of course, this is only another theory.

Are you, in fact, using a switch-mode power supply, say a wall-wart?

To see if this is the problem, can you try putting a good sized capacitor, say 47UF, across the LED brightness control potentiometer, in parallel with the 100nF ceramic capacitor.

Also, is the 470UF capacitor (C2) connected across the 12V supply line?

phonic
 
Last edited:

Thread Starter

Neville Thannhauser

Joined Dec 3, 2016
27
Hi Phonic and others,

Here are some pictures of the circuit posted in post #34. I plan to address your points in #75&76 later today/tomorrow when I get some time. BTW. I did not have a 3R9 for the R8 so used 2x 2R2 in series.
Thanks & BW.


 

dannyf

Joined Sep 13, 2015
2,197
When I probe the circuit I'm getting some really interesting waveform's, and not was I was expecting (when compared to the 555 circuit).
most novice designers don't do an AC analysis when they design a DC circuit and that's what you see.

You have a fairly fast opamp with feedback in the circuit, a beefy mosfets with high Cgs, and lots of loose wires -> you got an oscillator.
 

phonic

Joined Sep 29, 2016
37
most novice designers don't do an AC analysis when they design a DC circuit and that's what you see.
Great speech and applies to professional and amateur circuit designers equally well as witnessed by many circuits you see on the net, in magazines and in books.
The other thing that is missed out is decoupling and ground ordering.
It would be great to see the circuit that you propose that is of a professional standard- that would be a real help!
You have a fairly fast opamp with feedback in the circuit, a beefy mosfets with high Cgs, and lots of loose wires -> you got an oscillator.
I have already said or implied most of this.
There LM358 is not a fast opamp- if anything it is slow by comparison
There is more capacitance to consider than just Cgs. The gate node is made up from many capacitances both real an virtual: Cdg miller capacitance for example which can be a big source of problems, especially with a reactive drain load.

phonic
 
Last edited:
Top