Driving two transistors with same signal

V

vic

Guest
Hi,

I have two common anode 7-segments displays, and only one wire to drive
them. I need to achieve the following : when the control signal is +5V,
display1 is ON and display2 is OFF. When the signal is 0V, display1 is
OFF and display2 is ON. When the signal is not connected (high
impedance), both displays are OFF.

I tried using a NPN transistor for display1 and a PNP for display2,
connecting their bases together. It works when the driving signal is
present, but when the signal is floating current flows from the base of
the PNP to the base of the NPN and both transistors turn each other on,
resulting in both displays being ON.

The circuit that didn't work :

VCC
+
|
|
___ |<
o---------------------|___|--|
| |\
| VCC |
| + |
| | Display2
| | |
| ___ |/ |
Input---o---|___|--| GND
|>
|
|
Display1
|
|
GND



Is there a way to achieve this ?

Thanks.
 
vic wrote:
Hi,

I have two common anode 7-segments displays, and only one wire to drive
them. I need to achieve the following : when the control signal is +5V,
display1 is ON and display2 is OFF. When the signal is 0V, display1 is
OFF and display2 is ON. When the signal is not connected (high
impedance), both displays are OFF.

I tried using a NPN transistor for display1 and a PNP for display2,
connecting their bases together. It works when the driving signal is
present, but when the signal is floating current flows from the base of
the PNP to the base of the NPN and both transistors turn each other on,
resulting in both displays being ON.

The circuit that didn't work :

VCC
+
|
|
___ |
o---------------------|___|--|
| |\
| VCC |
| + |
| | Display2
| | |
| ___ |/ |
Input---o---|___|--| GND
|
|
|
Display1
|
|
GND



Is there a way to achieve this ?

Thanks.
Add diodes to isolate the bases, and resistors
to bias the transistors off when the desired
on signal is not present.

Ed

see below



VCC
+
|
+-------------+
| |
[R] |
| ___ |<
o--------|<------+----|___|--|
| |\
| VCC |
| + |
| | Display2
| | |
| ___ |/ |
Input---o--->|-+-|___|--| GND
| |>
[R] |
| |
| Display1
| |
+----------+
|
GND
 
On Thu, 08 May 2008 15:21:04 -0700, Dan Coby wrote:

A simpler solution is to remove the diodes, change the
locations of the added resistors, and move Display1. I.e.:

VCC
+
|
+---------+
| |
[R1] |
| |
o-------------[R2]---+-------|
| |\
| VCC |
| + |
| | Display2
| Display1 |
| | |
| |/ |
Input---o-----[R2]-+--------| GND
| |
[R1] |
| |
+----------+
|
GND

The R1 / R2 resistor pairs need to be chosen so that
there is only about 0.5 volts across the transistors'
base-emitter junctions when the input is floating.
When the input is floating, the various resistors
will pull the input to VCC/2. The value of 0.5 volts was
chosen to be low enough to keep the transistors from
turning on when the input is floating but still allow the
transistors to be turned on when the input is being driven
to VCC or ground.
This looks a little iffy - when there's no drive, then both
bases will still be forward biased unless you divide the
drive down so dramatically that you don't^H^H^H^H^Hmight not
get full saturation when it's supposed to be on.

A much more elegant solution uses two NPN's (the same thing could be
done with two PMP's, just turn the arrows around and the power
supply upside down. ;-) )


Vcc Vcc
| |
| [Display 2]
| |
[Display 1] |
| |/
+--[R]---+---|
| | |>
|/ [R] |
Control --[R]--+--| | |
| |> | |
[R] | | |
| | | |
gnd gnd gnd gnd

The resistors can be anything from around 4.7K to maybe 22K.

Cheers!
Rich
 
Dan Coby wrote:
"ehsjr" <e.h.s.j.r.removethespampunctuation@bellatlantic.net> wrote in message
news:cxHUj.28009$zw.4986@trnddc04...

vic wrote:

Hi,

I have two common anode 7-segments displays, and only one wire to drive them. I need to achieve
the following : when the control signal is +5V, display1 is ON and display2 is OFF. When the
signal is 0V, display1 is OFF and display2 is ON. When the signal is not connected (high
impedance), both displays are OFF.

I tried using a NPN transistor for display1 and a PNP for display2, connecting their bases
together. It works when the driving signal is present, but when the signal is floating current
flows from the base of the PNP to the base of the NPN and both transistors turn each other on,
resulting in both displays being ON.

The circuit that didn't work :

VCC
+
|
|
___ |
o---------------------|___|--|
| |\
| VCC |
| + |
| | Display2
| | |
| ___ |/ |
Input---o---|___|--| GND
|
|
|
Display1
|
|
GND



Is there a way to achieve this ?

Thanks.

Add diodes to isolate the bases, and resistors
to bias the transistors off when the desired
on signal is not present.

Ed

see below



VCC
+
|
+-------------+
| |
[R] |
| ___ |
o--------|<------+----|___|--|
| |\
| VCC |
| + |
| | Display2
| | |
| ___ |/ |
Input---o--->|-+-|___|--| GND
| |
[R] |
| |
| Display1
| |
+----------+
|
GND


The revised circuit does not solve the problem. Both diodes
will be conducting when the input is floating. As a result both
displays will still be on.
You're right - my circuit fails. Thanks
for spotting the error.

Ed
 
petrus bitbyter wrote:
The displays may need GND on one side. The OP did not said so, but his
schematic suggests it.
Yes, as I said I'm driving common-anode 7 segments displays, so I can
only use transistors on the "plus" side of the displays. This is part of
my problem :)
 
BobW wrote:
"BobW" <nimby_NEEDSPAM@roadrunner.com> wrote in message
news:B7mdnSJSKb17P77VnZ2dnUVZ_obinZ2d@giganews.com...
"vic" <news@bidouille.org> wrote in message
news:48233453$0$20289$426a74cc@news.free.fr...
Hi,

I have two common anode 7-segments displays, and only one wire to drive
them. I need to achieve the following : when the control signal is +5V,
display1 is ON and display2 is OFF. When the signal is 0V, display1 is
OFF and display2 is ON. When the signal is not connected (high
impedance), both displays are OFF.

I tried using a NPN transistor for display1 and a PNP for display2,
connecting their bases together. It works when the driving signal is
present, but when the signal is floating current flows from the base of
the PNP to the base of the NPN and both transistors turn each other on,
resulting in both displays being ON.

The circuit that didn't work :

VCC
+
|
|
___ |
o---------------------|___|--|
| |\
| VCC |
| + |
| | Display2
| | |
| ___ |/ |
Input---o---|___|--| GND
|
|
|
Display1
|
|
GND



Is there a way to achieve this ?

Thanks.
Try this:
5V
| 5V
R5 |
| |<---
|/-------------| Q3
----| Q1 |\--------- (to display 1 and then to GND)
| |>-- 5V
| | |
| | R3
| | |
---R1-----R2----------
| | |
| | R4
| |<--- |
|--| Q2 GND
|\
| |/--------- (to display 2 and then to 5V)
-------------| Q4
| |>----
R6 |
| GND
GND

Q1 and Q2 form a comparator so that when the input is floating they will
both be off. R3 and R4 set the input threshold.

When the input is high (5V) then Q1 will be on and that will turn on Q3.
When the input is low (GND) then Q2 will be on and that will turn on Q4.

You can figure out the resistor values. They shouldn't be too critical,
but R3 and R4 need to be small enough to ensure enough drive for the four
transistors.

I hope I got the ascii art right as I had to compose it in a separate word
processor.

Bob
--
== NOTE: I automatically delete all Google Group posts due to uncontrolled
SPAM ==

I see, now, that your displays are both common anode. You'll need to add
another PNP (common emitter mode) driven by Q4.

As Monica Lewinsky used to say, "Close, but no cigar."

Bob
*gasp* 5 transistors needed to do what seemed simple at first glance ...

I don't quite understand what R5 and R6 are for, when Q1 and Q2 do not
conduct, the base current of Q3 and Q4 would be zero so the ressitors do
not seem necessary ?

Well I guess I could just try it and see if it works :)
 
Dan Coby wrote:
"ehsjr" <e.h.s.j.r.removethespampunctuation@bellatlantic.net> wrote in message
news:cxHUj.28009$zw.4986@trnddc04...
vic wrote:
Hi,

I have two common anode 7-segments displays, and only one wire to drive them. I need to achieve
the following : when the control signal is +5V, display1 is ON and display2 is OFF. When the
signal is 0V, display1 is OFF and display2 is ON. When the signal is not connected (high
impedance), both displays are OFF.

I tried using a NPN transistor for display1 and a PNP for display2, connecting their bases
together. It works when the driving signal is present, but when the signal is floating current
flows from the base of the PNP to the base of the NPN and both transistors turn each other on,
resulting in both displays being ON.

The circuit that didn't work :

VCC
+
|
|
___ |
o---------------------|___|--|
| |\
| VCC |
| + |
| | Display2
| | |
| ___ |/ |
Input---o---|___|--| GND
|
|
|
Display1
|
|
GND



Is there a way to achieve this ?

Thanks.
Add diodes to isolate the bases, and resistors
to bias the transistors off when the desired
on signal is not present.

Ed

see below



VCC
+
|
+-------------+
| |
[R] |
| ___ |
o--------|<------+----|___|--|
| |\
| VCC |
| + |
| | Display2
| | |
| ___ |/ |
Input---o--->|-+-|___|--| GND
| |
[R] |
| |
| Display1
| |
+----------+
|
GND

The revised circuit does not solve the problem. Both diodes
will be conducting when the input is floating. As a result both
displays will still be on.
Would it work if, instead of diodes, I used Zener diodes of voltage
around Vcc/2 ?
 
On Thu, 08 May 2008 19:11:47 +0200, vic <news@bidouille.org> wrote:

Hi,

I have two common anode 7-segments displays, and only one wire to drive
them. I need to achieve the following : when the control signal is +5V,
display1 is ON and display2 is OFF. When the signal is 0V, display1 is
OFF and display2 is ON. When the signal is not connected (high
impedance), both displays are OFF.

I tried using a NPN transistor for display1 and a PNP for display2,
connecting their bases together. It works when the driving signal is
present, but when the signal is floating current flows from the base of
the PNP to the base of the NPN and both transistors turn each other on,
resulting in both displays being ON.

The circuit that didn't work :

VCC
+
|
|
___ |
o---------------------|___|--|
| |\
| VCC |
| + |
| | Display2
| | |
| ___ |/ |
Input---o---|___|--| GND
|
|
|
Display1
|
|
GND



Is there a way to achieve this ?
---
Yes. View in Courier:



+5V>-------+-----------+-----------+-----------+
| | | |
[100k] [100K] | |
| | | E
+-----------|-----------|---------B 2N3906
| | | C
| | E |
| +--[10K]--B 2N3906 |
[10k] | C |
| | | |
| C |A |A
VIN>-------+--[10k]--B 2N3904 [DISPLAY] [DISPLAY]
E | |
| [150R] [150R]
| | |
GND>-------------------+-----------+-----------+


Version 4
SHEET 1 880 680
WIRE -112 -128 -272 -128
WIRE 144 -128 -112 -128
WIRE 384 -128 144 -128
WIRE 624 -128 384 -128
WIRE -112 -80 -112 -128
WIRE 144 -80 144 -128
WIRE 624 0 624 -128
WIRE -112 48 -112 0
WIRE 560 48 -112 48
WIRE 384 96 384 -128
WIRE -112 112 -112 48
WIRE 144 144 144 0
WIRE 192 144 144 144
WIRE 320 144 272 144
WIRE 144 176 144 144
WIRE 624 192 624 96
WIRE -112 224 -112 192
WIRE -32 224 -112 224
WIRE 80 224 48 224
WIRE -272 256 -272 -128
WIRE -112 256 -112 224
WIRE 384 288 384 192
WIRE 624 288 624 256
WIRE 384 384 384 352
WIRE -272 512 -272 336
WIRE -112 512 -112 336
WIRE -112 512 -272 512
WIRE 144 512 144 272
WIRE 144 512 -112 512
WIRE 384 512 384 464
WIRE 384 512 144 512
WIRE 624 512 624 368
WIRE 624 512 384 512
WIRE -272 592 -272 512
FLAG -272 592 0
SYMBOL pnp 560 96 M180
SYMATTR InstName Q1
SYMATTR Value 2N3906
SYMBOL LED 608 192 R0
SYMATTR InstName D1
SYMATTR Value QTLP690C
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL res 608 272 R0
SYMATTR InstName R1
SYMATTR Value 150
SYMBOL voltage -272 240 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value 5
SYMBOL res -128 -96 R0
SYMATTR InstName R2
SYMATTR Value 100k
SYMBOL voltage -112 240 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V2
SYMATTR Value PULSE(0 5 0 1e-6 1e-6 .1 .2)
SYMBOL res -128 96 R0
SYMATTR InstName R3
SYMATTR Value 10k
SYMBOL res 64 208 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R4
SYMATTR Value 10k
SYMBOL npn 80 176 R0
SYMATTR InstName Q2
SYMATTR Value 2N3904
SYMBOL res 128 -96 R0
SYMATTR InstName R5
SYMATTR Value 100k
SYMBOL pnp 320 192 M180
SYMATTR InstName Q3
SYMATTR Value 2N3906
SYMBOL LED 368 288 R0
SYMATTR InstName D2
SYMATTR Value QTLP690C
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL res 368 368 R0
SYMATTR InstName R6
SYMATTR Value 150
SYMBOL res 288 128 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R7
SYMATTR Value 10k
TEXT -232 536 Left 0 !.tran 1 uic

JF
 
On Sat, 10 May 2008 08:35:11 -0500, John Fields
<jfields@austininstruments.com> wrote:

On Thu, 08 May 2008 19:11:47 +0200, vic <news@bidouille.org> wrote:

Hi,

I have two common anode 7-segments displays, and only one wire to drive
them. I need to achieve the following : when the control signal is +5V,
display1 is ON and display2 is OFF. When the signal is 0V, display1 is
OFF and display2 is ON. When the signal is not connected (high
impedance), both displays are OFF.

I tried using a NPN transistor for display1 and a PNP for display2,
connecting their bases together. It works when the driving signal is
present, but when the signal is floating current flows from the base of
the PNP to the base of the NPN and both transistors turn each other on,
resulting in both displays being ON.

The circuit that didn't work :

VCC
+
|
|
___ |
o---------------------|___|--|
| |\
| VCC |
| + |
| | Display2
| | |
| ___ |/ |
Input---o---|___|--| GND
|
|
|
Display1
|
|
GND



Is there a way to achieve this ?

---
Yes. View in Courier:



+5V>-------+-----------+-----------+-----------+
| | | |
[100k] [100K] | |
| | | E
+-----------|-----------|---------B 2N3906
| | | C
| | E |
| +--[10K]--B 2N3906 |
[10k] | C |
| | | |
| C |A |A
VIN>-------+--[10k]--B 2N3904 [DISPLAY] [DISPLAY]
E | |
| [150R] [150R]
| | |
GND>-------------------+-----------+-----------+
---
Oops...

Missed the part about when the input signal floats.

JF
 
On Sat, 10 May 2008 08:52:53 -0500, John Fields
<jfields@austininstruments.com> wrote:

On Sat, 10 May 2008 08:35:11 -0500, John Fields
jfields@austininstruments.com> wrote:

On Thu, 08 May 2008 19:11:47 +0200, vic <news@bidouille.org> wrote:

Hi,

I have two common anode 7-segments displays, and only one wire to drive
them. I need to achieve the following : when the control signal is +5V,
display1 is ON and display2 is OFF. When the signal is 0V, display1 is
OFF and display2 is ON. When the signal is not connected (high
impedance), both displays are OFF.

I tried using a NPN transistor for display1 and a PNP for display2,
connecting their bases together. It works when the driving signal is
present, but when the signal is floating current flows from the base of
the PNP to the base of the NPN and both transistors turn each other on,
resulting in both displays being ON.

The circuit that didn't work :

VCC
+
|
|
___ |
o---------------------|___|--|
| |\
| VCC |
| + |
| | Display2
| | |
| ___ |/ |
Input---o---|___|--| GND
|
|
|
Display1
|
|
GND



Is there a way to achieve this ?

---
Yes. View in Courier:



+5V>-------+-----------+-----------+-----------+
| | | |
[100k] [100K] | |
| | | E
+-----------|-----------|---------B 2N3906
| | | C
| | E |
| +--[10K]--B 2N3906 |
[10k] | C |
| | | |
| C |A |A
VIN>-------+--[10k]--B 2N3904 [DISPLAY] [DISPLAY]
E | |
| [150R] [150R]
| | |
GND>-------------------+-----------+-----------+

---
Oops...

Missed the part about when the input signal floats.
---
This works:


Vcc>----+------+-----+----+-----------+---------+
| | | | | |
[10K] [10K] | | | |
| | | [10K] | |
+------|----|-\ | E |
| | | >--+--[10k]--B 2N3906 |
Vin>----+ +----|+/U1A C |
| | LM393 | |
| | | |
| [30K] Vcc | |
| | | | |
| | [10K] | |
| +----|-\ | | E
| | | >--+--[10K]----|-------B 2N3906
+------|----|+/U1B | C
| | | LM393 |A |A
| | | [7SEG] [7SEG]
[10K] [10K] | | |
| | | [150R] [150R]
| | | | |
GND>----+------+-----+----------------+---------+


Or, using LT1017's:

Version 4
SHEET 1 916 680
WIRE 0 -128 -400 -128
WIRE 112 -128 0 -128
WIRE 240 -128 112 -128
WIRE 304 -128 240 -128
WIRE 576 -128 304 -128
WIRE 784 -128 576 -128
WIRE 0 -80 0 -128
WIRE 112 -80 112 -128
WIRE 576 16 576 -128
WIRE 304 32 304 -128
WIRE 0 48 0 0
WIRE 272 48 0 48
WIRE 384 64 336 64
WIRE 512 64 464 64
WIRE 112 80 112 0
WIRE 272 80 112 80
WIRE 112 96 112 80
WIRE 240 112 240 -128
WIRE -176 128 -288 128
WIRE 0 128 0 48
WIRE 0 128 -96 128
WIRE 240 144 304 96
WIRE 304 160 240 112
WIRE 784 160 784 -128
WIRE 304 176 304 160
WIRE 112 192 112 176
WIRE 272 192 112 192
WIRE 384 208 336 208
WIRE 720 208 464 208
WIRE 0 224 0 128
WIRE 272 224 0 224
WIRE 576 288 576 112
WIRE 784 288 784 256
WIRE -400 320 -400 -128
WIRE -288 320 -288 128
WIRE -160 320 -160 176
WIRE 0 320 0 224
WIRE 112 320 112 192
WIRE 576 384 576 352
WIRE 784 384 784 352
WIRE -400 496 -400 400
WIRE -288 496 -288 400
WIRE -288 496 -400 496
WIRE -160 496 -160 400
WIRE -160 496 -288 496
WIRE -112 496 -112 176
WIRE -112 496 -160 496
WIRE 0 496 0 400
WIRE 0 496 -112 496
WIRE 112 496 112 400
WIRE 112 496 0 496
WIRE 240 496 240 144
WIRE 240 496 112 496
WIRE 304 496 304 240
WIRE 304 496 240 496
WIRE 576 496 576 464
WIRE 576 496 304 496
WIRE 784 496 784 464
WIRE 784 496 576 496
WIRE -400 576 -400 496
FLAG -400 576 0
SYMBOL Comparators\\LT1017 304 208 R0
SYMATTR InstName U1
SYMBOL res 96 -96 R0
SYMATTR InstName R1
SYMATTR Value 10k
SYMBOL res 96 80 R0
SYMATTR InstName R2
SYMATTR Value 30k
SYMBOL res 96 304 R0
SYMATTR InstName R3
SYMATTR Value 10K
SYMBOL Comparators\\LT1017 304 64 R0
SYMATTR InstName U3
SYMBOL res -16 -96 R0
SYMATTR InstName R4
SYMATTR Value 10k
SYMBOL res -16 304 R0
SYMATTR InstName R5
SYMATTR Value 10k
SYMBOL voltage -288 304 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value PULSE(0 5 0 1e-6 1e-6 .1 .2)
SYMBOL voltage -400 304 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V2
SYMATTR Value 5
SYMBOL pnp 512 112 M180
SYMATTR InstName Q1
SYMATTR Value 2N3906
SYMBOL pnp 720 256 M180
SYMATTR InstName Q2
SYMATTR Value 2N3906
SYMBOL LED 560 288 R0
WINDOW 0 -46 32 Left 0
WINDOW 3 -116 72 Left 0
SYMATTR InstName D1
SYMATTR Value QTLP690C
SYMBOL res 560 368 R0
SYMATTR InstName R6
SYMATTR Value 150
SYMBOL res 768 368 R0
SYMATTR InstName R7
SYMATTR Value 150
SYMBOL LED 768 288 R0
WINDOW 0 -46 32 Left 0
WINDOW 3 -116 72 Left 0
SYMATTR InstName D2
SYMATTR Value QTLP690C
SYMBOL res 480 48 R90
WINDOW 0 -36 60 VBottom 0
WINDOW 3 -34 58 VTop 0
SYMATTR InstName R10
SYMATTR Value 10k
SYMBOL res 480 192 R90
WINDOW 0 -36 59 VBottom 0
WINDOW 3 -33 56 VTop 0
SYMATTR InstName R11
SYMATTR Value 10k
SYMBOL sw -80 128 M270
WINDOW 0 32 15 Left 0
WINDOW 3 32 44 Left 0
SYMATTR InstName S1
SYMBOL voltage -160 304 R0
WINDOW 0 -49 16 Left 0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V3
SYMATTR Value PULSE(5 0 .5 1e-6 1e-6 .5 1)
TEXT -392 552 Left 0 !.tran 2 uic
TEXT 16 136 Left 0 ;2.5V
TEXT 72 80 Left 0 ;4V
TEXT 72 192 Left 0 ;1V
TEXT -392 520 Left 0 !.model SW SW(Ron=1 Roff=10Meg Vt=0.5Vh=0)

JF
 
petrus bitbyter wrote:
Didn't you see my four transistors, four resistors solution yesterday?

+--------+------------------+-------+--Vcc
| | | |
___ |< | ___ |/ |
in----+--|___|---| | +--|___|--| |
| |\ | | |> |
| | | | | |
| | |< | | |
| +------| | +-----|
| | |\ | | |\
| .-. | | .-. |
| | | .---. | | | .---.
| | | | | | | | | |
| '-' | D | | '-' | D |
| | | | | | | |
| | '---' | | '---'
| | | | | |
------)------------+--------+------)-----------+-------+--GND
| |
+----------------------------+
created by Andy´s ASCII-Circuit v1.24.140803 Beta www.tech-chat.de

Sorry I missed your post. Looks like a good solution. Thanks !
 
Thank you to all for your support.

I solved my problem temporarily by using the "bias Vbe to 0.5V"
solution. However I had some issues with the transistors still leaking
some current when OFF, and not having the same current when ON. I
reduced Vbe even more to make the OFF current not visible on the
displays, and ON current almost equal. Still not as pleasing visually as
separate drives for each transistor.

The 5 transistors solution seems definately more reliable and less
sensitive to resistor values.

Next time, I'll make sure to use one signal to control each display :)

Thanks again.
 

Welcome to EDABoard.com

Sponsor

Back
Top