Maker Pro
Maker Pro

Need help with Transistor circuit design

D

Daniel Beer

Hello. I'm trying to build a circuit that slowly turns an LED on and off. I
am attaching this to a +5 V output of a Logic device. I want it to be so
that when the output pin goes to 1 or +5V, the LED starts to fade on until
it is at full brightness. When the pin goes to 0, the LED should slowly fade
off. I am using an RC network to create a gradual voltage change, but i need
this gradual voltage change to gradually change the current in the LED. The
LED I'm using has a forward voltage rating of 2.2 V and is at maximum
brightness when 20 mA of current are running through it.
So when the voltage across the capacitor is 0 (time = 0), the current
through the LED will be 0, and when the voltage across the capacitor
approaches 5 (time = later, determined by values of R,C) the current will
approach 20 mA. I've read that I need a transistor to accompish this, but I
am very vague on how to use them and which type to use. Can anyone point me
at a good explanation of transistor operation and types, or suggest a
transistor (and/or resistors) that i might put between the capacitor and the
LED to achieve this effect? Thanks

Daniel
 
J

Jim Thompson

Hello. I'm trying to build a circuit that slowly turns an LED on and off. I
am attaching this to a +5 V output of a Logic device. I want it to be so
that when the output pin goes to 1 or +5V, the LED starts to fade on until
it is at full brightness. When the pin goes to 0, the LED should slowly fade
off. I am using an RC network to create a gradual voltage change, but i need
this gradual voltage change to gradually change the current in the LED. The
LED I'm using has a forward voltage rating of 2.2 V and is at maximum
brightness when 20 mA of current are running through it.
So when the voltage across the capacitor is 0 (time = 0), the current
through the LED will be 0, and when the voltage across the capacitor
approaches 5 (time = later, determined by values of R,C) the current will
approach 20 mA. I've read that I need a transistor to accompish this, but I
am very vague on how to use them and which type to use. Can anyone point me
at a good explanation of transistor operation and types, or suggest a
transistor (and/or resistors) that i might put between the capacitor and the
LED to achieve this effect? Thanks

Daniel

Control *current*, NOT *voltage*.

...Jim Thompson
 
W

Walter Harley

Daniel Beer said:
Hello. I'm trying to build a circuit that slowly turns an LED on and off. I
am attaching this to a +5 V output of a Logic device. I want it to be so
that when the output pin goes to 1 or +5V, the LED starts to fade on until
it is at full brightness. When the pin goes to 0, the LED should slowly fade
off. I am using an RC network to create a gradual voltage change, but i need
this gradual voltage change to gradually change the current in the LED.


Look around for "voltage controlled current source" circuits.

Art of Electronics (Horowitz and Hill) is a superb reference.
 
B

Ban

Hello. I'm trying to build a circuit that slowly turns an LED on and
cmos-gate |
o-------+ V cmos-gate
| -
.-. +5|..25V
3k9| | V
| | -
'-' | upto 10
| ( V )LEDs
+----+ -
| | |
\| | |/
|--+--|
<| | |>
| | |
.-. | + .-.
1k| | ### | |47
| | --- | |
'-' | '-'
| | |
=== === ===
GND GND GND

1000uF/3V
created by Andy´s ASCII-Circuit v1.24.140803 Beta www.tech-chat.de

ciao Ban
 
J

John Popelish

Daniel said:
Hello. I'm trying to build a circuit that slowly turns an LED on and off. I
am attaching this to a +5 V output of a Logic device. I want it to be so
that when the output pin goes to 1 or +5V, the LED starts to fade on until
it is at full brightness. When the pin goes to 0, the LED should slowly fade
off. I am using an RC network to create a gradual voltage change, but i need
this gradual voltage change to gradually change the current in the LED. The
LED I'm using has a forward voltage rating of 2.2 V and is at maximum
brightness when 20 mA of current are running through it.
So when the voltage across the capacitor is 0 (time = 0), the current
through the LED will be 0, and when the voltage across the capacitor
approaches 5 (time = later, determined by values of R,C) the current will
approach 20 mA. I've read that I need a transistor to accompish this, but I
am very vague on how to use them and which type to use. Can anyone point me
at a good explanation of transistor operation and types, or suggest a
transistor (and/or resistors) that i might put between the capacitor and the
LED to achieve this effect? Thanks

Daniel

I don't know how slow 'slowly' is or how accurate the fade needs to
be, but here is a simple approximation of what you need. (make sure
you are set up to view this message in a fixed width font, like
courier)

+5 +5 .
| | .
R2 | .
| |/ .
--R1--+--| Q1 .
+| |V .
C1 | .
| LED .
| | .
| R3 .
| | .
0v 0v .

R1, R2 and C1 form most of the time constant that slows the changes
applied to the left end of R1.
R2 biases the logic low state near the turn on voltage of the LED.
R3 limits the maximum current.

I would use a high gain transistor like a 2N5089, but any NPN signal
transistor might serve.

You might try values like:
R1=4.7k
R2=4.7k
C1=100uf (larger is slower)
R3=100
 
M

Michael

Daniel Beer said:
Hello. I'm trying to build a circuit that slowly turns an LED on and off. I
am attaching this to a +5 V output of a Logic device. I want it to be so
that when the output pin goes to 1 or +5V, the LED starts to fade on until
it is at full brightness. When the pin goes to 0, the LED should slowly fade
off. I am using an RC network to create a gradual voltage change, but i need
this gradual voltage change to gradually change the current in the LED. The
LED I'm using has a forward voltage rating of 2.2 V and is at maximum
brightness when 20 mA of current are running through it.
So when the voltage across the capacitor is 0 (time = 0), the current
through the LED will be 0, and when the voltage across the capacitor
approaches 5 (time = later, determined by values of R,C) the current will
approach 20 mA. I've read that I need a transistor to accompish this, but I
am very vague on how to use them and which type to use. Can anyone point me
at a good explanation of transistor operation and types, or suggest a
transistor (and/or resistors) that i might put between the capacitor and the
LED to achieve this effect? Thanks

Daniel



If your 5 volts comes from a 5volt reg, and you have a voltage into
the regulator of around 7-20V I would do it like this.



V+ (>7V)
PORT LINE ---+
| |
.-. |
| | |
4k7 | | V
'-' - LED
| |
+-----+
| |
| |/
+ -| BC547 or BC337
| |>
| |
--- |
100uF ### .-.
| + | |
| | |
| '-'
| |
GND GND

created by Andy´s ASCII-Circuit v1.24.140803 Beta www.tech-chat.de

If V+ is high, and your fading is slow, and you switch it often
(flashing), watch out for the heat dissapation in the transistor.


Michael.....
 
B

Byron A Jeff

Daniel Beer said:
[Snipped]

John and others have posted circuits to solve this problem. I want to spend
a minute or two talking about how and why it works. The reason for this is
that many of us are simply not blessed with an analog EE education. So when
digital/programmer types can get some insight, I feel it helps. I'm going to
explain from an intuitive standpoint. Anyone who would like to jump in and
correct this analog "Bubba" please fee

The key component to each of these circuits is the emitter resistor. It
facilitates a controllable current along the CE path.

Here's a quick fixed font example:

+5V
|
Led
|
C
I-R-B
E
|
X
|
Re
|
Gnd

Where B,C,E are the transistor leads, R and Re are resistors, X is our test
point of interest and I is our input.

For an intuitive standpoint in this circuit the voltage at point X tries to
follow the voltage at point I. In effect the base drags the emitter. Now much
of the time in digital transistor circuits the emitter is grounded and so
the base cannot move beyond the 0.6V difference between the base and the
emitter. In this case as the base voltage attempts to rise (but cannot), the
base simply draws more and more current as the voltage at point I rises.

But this isn't the case here. Because of Re, the voltage at point X can in
fact rise from ground and follow the base by that 0.6V difference. So if
the voltage at point I is 1.6V, then the voltage at point X rises to 1V with
the transistor and LED dropping the rest of the 4V of voltage between +5V and
point X in the CE path.

Now Ohm's law comes into play. V=IR and R (Re in this instance) is fixed. So
as the voltage at point X rises, then the current through Re, and the
transistor, and the LED through the CE path will rise too.

So now we have the perfect vehicle for controlling the brightness of the LED,
whose brightness is determined by the amount of current that flows through it.
In short as the voltage at point I rises, the voltage a point X rises, the
current through Re rises, and therefore the current through the LED rises,
making it brighter.

Now the funny thing is that I analyzed this exact same circuit for a fixed
current battery charger. Say for the sake of argument that Re is 1 ohm. If
I is set to 1.6V then 1V is developed across the the 1 ohm Re. By Ohm's law
1V = I * 1ohm, so 1A is drawn across the resistor (and any other component in
the CE path). So this circuit gives me a settable current regulator for
charing my battery.

BAJ
 
T

TuT

Daniel Beer said:
[Snipped]

John and others have posted circuits to solve this problem. I want to spend
a minute or two talking about how and why it works. The reason for this is
that many of us are simply not blessed with an analog EE education. So when
digital/programmer types can get some insight, I feel it helps. I'm going to
explain from an intuitive standpoint. Anyone who would like to jump in and
correct this analog "Bubba" please fee

The key component to each of these circuits is the emitter resistor. It
facilitates a controllable current along the CE path.

Here's a quick fixed font example:

+5V
|
Led
|
C
I-R-B
E
|
X
|
Re
|
Gnd

Where B,C,E are the transistor leads, R and Re are resistors, X is our test
point of interest and I is our input.

For an intuitive standpoint in this circuit the voltage at point X tries to
follow the voltage at point I. In effect the base drags the emitter. Now much
of the time in digital transistor circuits the emitter is grounded and so
the base cannot move beyond the 0.6V difference between the base and the
emitter. In this case as the base voltage attempts to rise (but cannot), the
base simply draws more and more current as the voltage at point I rises.

But this isn't the case here. Because of Re, the voltage at point X can in
fact rise from ground and follow the base by that 0.6V difference. So if
the voltage at point I is 1.6V, then the voltage at point X rises to 1V with
the transistor and LED dropping the rest of the 4V of voltage between +5V and
point X in the CE path.

Now Ohm's law comes into play. V=IR and R (Re in this instance) is fixed. So
as the voltage at point X rises, then the current through Re, and the
transistor, and the LED through the CE path will rise too.

So now we have the perfect vehicle for controlling the brightness of the LED,
whose brightness is determined by the amount of current that flows through it.
In short as the voltage at point I rises, the voltage a point X rises, the
current through Re rises, and therefore the current through the LED rises,
making it brighter.

Now the funny thing is that I analyzed this exact same circuit for a fixed
current battery charger. Say for the sake of argument that Re is 1 ohm. If
I is set to 1.6V then 1V is developed across the the 1 ohm Re. By Ohm's law
1V = I * 1ohm, so 1A is drawn across the resistor (and any other component in
the CE path). So this circuit gives me a settable current regulator for
charing my battery.

BAJ
When emitter voltage rises to 5V minus LED forward voltage, transistor
will saturate, (pedants be quiet), and LED will extinguish.

If there was a more +ve voltage to drive LED, cct would work fine, but
with just 5V, achieving required result is a challenge with a single
transistor and realistic component values - John Popefish's cct
works, but has significant dead band, (delay between starting charging
cap and LED starting to light), and poorly defined LEDcurrent when
lit.

Doable in a reasonably controlled manner with two transistors -
inbalanced current mirror, ( can't think of proper name for it but
it's late now and I'm off to bed), two resistors and the timing cap.

T
 
T

TuT

When emitter voltage rises to 5V minus LED forward voltage, transistor
will saturate, (pedants be quiet), and LED will extinguish.

If there was a more +ve voltage to drive LED, cct would work fine, but
with just 5V, achieving required result is a challenge with a single
transistor and realistic component values - John Popefish's cct
works, but has significant dead band, (delay between starting charging
cap and LED starting to light), and poorly defined LEDcurrent when
lit.

Doable in a reasonably controlled manner with two transistors -
inbalanced current mirror, ( can't think of proper name for it but
it's late now and I'm off to bed), two resistors and the timing cap.

T

Sorry John - should have known better where you are concerned.

Just re-read you post and can see that there is more to your cct than
I originally thought. Trouble I have is that all ccts I see posted
here have all left-hand spaces lost so all symbols fall to left hand
side of screen making them pretty well illegible. Still can't see
your cct properly, but read enough in text to understand you've
already addressed problems I thought it had.

By the way - how do I view ccts without this problem. Would
appreciate any pointers.

T
 
J

John Popelish

TuT wrote:
(snip)
By the way - how do I view ccts without this problem. Would
appreciate any pointers.
The important setting is the font. You must set your news reader to
display messages in a fixed width (per character) font, like courier.
Proportional fonts scramble the spacing grid the circuits are built
on.

By the way, if I was making this circuit, I would use an opamp and a
transistor to make a voltage to current converter, with the RC
filtered waveform from the logic divided by 5 or so with a high
resistance divider, and have the opamp control the conduction of a
transistor (and LED) to force the current through a current sense
resistor to equal that small replica of the filtered waveform. But
the OP did not sound ready for that level of precision and
complexity. At least, not till he defined 'slowly'.
 
J

John Popelish

TuT wrote:
(snip)
Just re-read you post and can see that there is more to your cct than
I originally thought. Trouble I have is that all ccts I see posted
here have all left-hand spaces lost so all symbols fall to left hand
side of screen making them pretty well illegible. Still can't see
your cct properly, but read enough in text to understand you've
already addressed problems I thought it had.

By the way - how do I view ccts without this problem. Would
appreciate any pointers.
It came out looking right on Google, this time, so you can see what it
is supposed to look like.

http://groups.google.com/[email protected]&output=gplain
 
R

Roger Johansson

TuT said:
By the way - how do I view ccts without this problem. Would
appreciate any pointers.

I can see from your message headers that you use Forte Free Agent so
you can use the Fixed pitch Font choice in the Message menu when you
want to look at an ascii schematic.

I don't use Free Agent myself, I use Agent, but I hope it works like
that in your program too.
 
B

Ben Bradley

In sci.electronics.design said:
Sorry John - should have known better where you are concerned.

Just re-read you post and can see that there is more to your cct than
I originally thought. Trouble I have is that all ccts I see posted
here have all left-hand spaces lost so all symbols fall to left hand
side of screen making them pretty well illegible. Still can't see
your cct properly, but read enough in text to understand you've
already addressed problems I thought it had.

By the way - how do I view ccts without this problem. Would
appreciate any pointers.

You need to use a "monospaced" font. If you don't want to change
the font in your newsreader, you could copy-and-paste the circuit to
notepad, wordpad, or some word processor program that's set up with a
monospaced font by default, otherwise you have to also select the text
and select a monospaced font.
Does your program (or something) actualy delete leading spaces? My
paragraphs are indented three spaces. You should see at least a little
indentation with a proportional font, otherewise something in your
system/newsfeed DOES eat leading spaces, and that's a bad thing.
 
T

TuT

Daniel Beer said:
[Snipped]

John and others have posted circuits to solve this problem. I want to spend
a minute or two talking about how and why it works. The reason for this is
that many of us are simply not blessed with an analog EE education. So when
digital/programmer types can get some insight, I feel it helps. I'm going to
explain from an intuitive standpoint. Anyone who would like to jump in and
correct this analog "Bubba" please fee

The key component to each of these circuits is the emitter resistor. It
facilitates a controllable current along the CE path.

Here's a quick fixed font example:

+5V
|
Led
|
C
I-R-B
E
|
X
|
Re
|
Gnd

Where B,C,E are the transistor leads, R and Re are resistors, X is our test
point of interest and I is our input.

For an intuitive standpoint in this circuit the voltage at point X tries to
follow the voltage at point I. In effect the base drags the emitter. Now much
of the time in digital transistor circuits the emitter is grounded and so
the base cannot move beyond the 0.6V difference between the base and the
emitter. In this case as the base voltage attempts to rise (but cannot), the
base simply draws more and more current as the voltage at point I rises.

But this isn't the case here. Because of Re, the voltage at point X can in
fact rise from ground and follow the base by that 0.6V difference. So if
the voltage at point I is 1.6V, then the voltage at point X rises to 1V with
the transistor and LED dropping the rest of the 4V of voltage between +5V and
point X in the CE path.

Now Ohm's law comes into play. V=IR and R (Re in this instance) is fixed. So
as the voltage at point X rises, then the current through Re, and the
transistor, and the LED through the CE path will rise too.

So now we have the perfect vehicle for controlling the brightness of the LED,
whose brightness is determined by the amount of current that flows through it.
In short as the voltage at point I rises, the voltage a point X rises, the
current through Re rises, and therefore the current through the LED rises,
making it brighter.

Now the funny thing is that I analyzed this exact same circuit for a fixed
current battery charger. Say for the sake of argument that Re is 1 ohm. If
I is set to 1.6V then 1V is developed across the the 1 ohm Re. By Ohm's law
1V = I * 1ohm, so 1A is drawn across the resistor (and any other component in
the CE path). So this circuit gives me a settable current regulator for
charing my battery.

BAJ

I must resist the urge to post on a Friday night after I've been to
the pub. Seemed like a good idea at the time, but, in the cold light
of Saturday, I realise that I'd lapsed into talking fluent bollocks!

Unless the base resistor and the emitter resistor are of similar
value, (not a lot of point when you are trying to achieve a longish
time constant), the LED will not extinguish as I suggested, but will
simply cease to get any brighter when the transistor approaches
saturation and things wil just settle into equilibrium with the
transistor pulling just enough base current to continue driving the
LED.

Appologies all round.

Thanks to John and Roger for the info regarding fixed fonts - can now
see the circuits properly, so hopefully no more foot in mouth! :)

Regards

T
 
Y

YD

TuT wrote:
(snip)
The important setting is the font. You must set your news reader to
display messages in a fixed width (per character) font, like courier.
Proportional fonts scramble the spacing grid the circuits are built
on.

By the way, if I was making this circuit, I would use an opamp and a
transistor to make a voltage to current converter, with the RC
filtered waveform from the logic divided by 5 or so with a high
resistance divider, and have the opamp control the conduction of a
transistor (and LED) to force the current through a current sense
resistor to equal that small replica of the filtered waveform. But
the OP did not sound ready for that level of precision and
complexity. At least, not till he defined 'slowly'.

Next step: Use a PIC and PWM a single output. :)

- YD.
 
Top