Transistors as switch

D

Data888

Guest
Hi.
I have some data lines that use 0 or +5v logic. I can connect the line
to the base of the transistor, and a 12v line to the collector to
increase the voltage to run the data longer distances. However, I'm not
sure how to get it back to 5v at the other end. Do I just connect the
12v data line to the base and a 5v line to the collector?
Thanks
Nick
 
On Sat, 07 Feb 2004 19:25:26 +1100, Data888
<kcinSPAMBLOCK@bigfoot.com.au> wrote:

Hi.
I have some data lines that use 0 or +5v logic. I can connect the line
to the base of the transistor, and a 12v line to the collector to
increase the voltage to run the data longer distances. However, I'm not
sure how to get it back to 5v at the other end. Do I just connect the
12v data line to the base and a 5v line to the collector?
---
How long is the run?

--
John Fields
 
John Fields wrote:
On Sat, 07 Feb 2004 19:25:26 +1100, Data888
kcinSPAMBLOCK@bigfoot.com.au> wrote:


Hi.
I have some data lines that use 0 or +5v logic. I can connect the line
to the base of the transistor, and a 12v line to the collector to
increase the voltage to run the data longer distances. However, I'm not
sure how to get it back to 5v at the other end. Do I just connect the
12v data line to the base and a 5v line to the collector?

---
How long is the run?
20 to 30 meters.
 
On Sun, 08 Feb 2004 00:15:55 +1100, Data888
<kcinSPAMBLOCK@bigfoot.com.au> wrote:

John Fields wrote:
On Sat, 07 Feb 2004 19:25:26 +1100, Data888
kcinSPAMBLOCK@bigfoot.com.au> wrote:


Hi.
I have some data lines that use 0 or +5v logic. I can connect the line
to the base of the transistor, and a 12v line to the collector to
increase the voltage to run the data longer distances. However, I'm not
sure how to get it back to 5v at the other end. Do I just connect the
12v data line to the base and a 5v line to the collector?

---
How long is the run?


20 to 30 meters.
---
I'm sorry, I forgot to ask what kind of cable you're planning to use to
send the data over. That is, coax? Twisted pair? Do you have a part
number or some data for the cable?

--
John Fields
 
On Sun, 08 Feb 2004 00:15:55 +1100, Data888
<kcinSPAMBLOCK@bigfoot.com.au> wrote:


20 to 30 meters.
---
Also, how fast is the data?

--
John Fields
 
In article <4024E50B.80309@bigfoot.com.au>,
kcinSPAMBLOCK@bigfoot.com.au says...
John Fields wrote:
On Sat, 07 Feb 2004 19:25:26 +1100, Data888
kcinSPAMBLOCK@bigfoot.com.au> wrote:


Hi.
I have some data lines that use 0 or +5v logic. I can connect the line
to the base of the transistor, and a 12v line to the collector to
increase the voltage to run the data longer distances. However, I'm not
sure how to get it back to 5v at the other end. Do I just connect the
12v data line to the base and a 5v line to the collector?

---
How long is the run?


20 to 30 meters.
Put a resistor in series with the receiving transistor's base to
limit the current and a resistor from the receiving transistor's
collector to +5V. Depending on how fast you need to go, choose
the base and collector resistors accordingly.

As a quick off-the-cuff stab (sans calculator, so be nice ;-):



+5V
|
+12V .-.
| | |
| R4| |
+5V +---+ '-'
| | | +
.-. .-. | |
R1| | R2| | - +--------o
| | | | ^ CR1 +
'-' '-' | R3 |
| | | transmission line ___ |/
| +---+--------------------|___|-+--|
| | | |>
| | - |
| |/ CR2 ^ |
o----+----| | |
|> +----+
| |
| |
=== ===
GND GND
created by Andy´s ASCII-Circuit v1.22.310103 Beta www.tech-
chat.de

If you choose R2 of say 1Kohm, you'll have something like 10mA in
the collector of the transmitting transistor. R1 should be
perhaps 30K or so (assuming a beta min of 30). R3 could be say
10Kohm giving you a base drive of about 1mA. With R4 of 1K
you'll get about 5mA of current in the receiver's collector.

It might be more efficient to move R2 to the other end of the
line though.

CR1 and CR2 (may or may not be needed) are used as a free-
wheeling diodes to limit voltage spikes from the 20-30 meters of
cable, which might be quite inductive.

--
Keith
 
Keith R. Williams wrote:
In article <4024E50B.80309@bigfoot.com.au>,
kcinSPAMBLOCK@bigfoot.com.au says...
John Fields wrote:
On Sat, 07 Feb 2004 19:25:26 +1100, Data888
kcinSPAMBLOCK@bigfoot.com.au> wrote:



Hi.
I have some data lines that use 0 or +5v logic. I can connect the line
to the base of the transistor, and a 12v line to the collector to
increase the voltage to run the data longer distances. However, I'm not
sure how to get it back to 5v at the other end. Do I just connect the
12v data line to the base and a 5v line to the collector?

---
How long is the run?


20 to 30 meters.


Put a resistor in series with the receiving transistor's base to
limit the current and a resistor from the receiving transistor's
collector to +5V. Depending on how fast you need to go, choose
the base and collector resistors accordingly.

As a quick off-the-cuff stab (sans calculator, so be nice ;-):



+5V
|
+12V .-.
| | |
| R4| |
+5V +---+ '-'
| | | +
.-. .-. | |
R1| | R2| | - +--------o
| | | | ^ CR1 +
'-' '-' | R3 |
| | | transmission line ___ |/
| +---+--------------------|___|-+--|
| | | |
| | - |
| |/ CR2 ^ |
o----+----| | |
|> +----+
| |
| |
=== ==> GND GND
created by Andy´s ASCII-Circuit v1.22.310103 Beta www.tech-
chat.de

If you choose R2 of say 1Kohm, you'll have something like 10mA in
the collector of the transmitting transistor. R1 should be
perhaps 30K or so (assuming a beta min of 30). R3 could be say
10Kohm giving you a base drive of about 1mA. With R4 of 1K
you'll get about 5mA of current in the receiver's collector.

It might be more efficient to move R2 to the other end of the
line though.

CR1 and CR2 (may or may not be needed) are used as a free-
wheeling diodes to limit voltage spikes from the 20-30 meters of
cable, which might be quite inductive.
Don't forget a series resistor into the base of the first transistor.
And there's no reason for R3 because R2 will limit that current. R1
may not be necessary, either, depending on your circuit's drive. FETs
would be more efficient. There are probably line driver chips that do
what you're trying to do, also.

--Jeff

--
Ho, ho, ho, hee, hee, hee
and a couple of ha, ha, has;
That's how we pass the day away,
in the merry old land of Oz.
 
In article <102bg4t1tqpi345@corp.supernews.com>,
jturner@localnet.com says...
Keith R. Williams wrote:
In article <4024E50B.80309@bigfoot.com.au>,
kcinSPAMBLOCK@bigfoot.com.au says...
John Fields wrote:
On Sat, 07 Feb 2004 19:25:26 +1100, Data888
kcinSPAMBLOCK@bigfoot.com.au> wrote:



Hi.
I have some data lines that use 0 or +5v logic. I can connect the line
to the base of the transistor, and a 12v line to the collector to
increase the voltage to run the data longer distances. However, I'm not
sure how to get it back to 5v at the other end. Do I just connect the
12v data line to the base and a 5v line to the collector?

---
How long is the run?


20 to 30 meters.


Put a resistor in series with the receiving transistor's base to
limit the current and a resistor from the receiving transistor's
collector to +5V. Depending on how fast you need to go, choose
the base and collector resistors accordingly.

As a quick off-the-cuff stab (sans calculator, so be nice ;-):



+5V
|
+12V .-.
| | |
| R4| |
+5V +---+ '-'
| | | +
.-. .-. | |
R1| | R2| | - +--------o
| | | | ^ CR1 +
'-' '-' | R3 |
| | | transmission line ___ |/
| +---+--------------------|___|-+--|
| | | |
| | - |
| |/ CR2 ^ |
o----+----| | |
|> +----+
| |
| |
=== ===
GND GND
created by Andy´s ASCII-Circuit v1.22.310103 Beta www.tech-
chat.de

If you choose R2 of say 1Kohm, you'll have something like 10mA in
the collector of the transmitting transistor. R1 should be
perhaps 30K or so (assuming a beta min of 30). R3 could be say
10Kohm giving you a base drive of about 1mA. With R4 of 1K
you'll get about 5mA of current in the receiver's collector.

It might be more efficient to move R2 to the other end of the
line though.

CR1 and CR2 (may or may not be needed) are used as a free-
wheeling diodes to limit voltage spikes from the 20-30 meters of
cable, which might be quite inductive.

Don't forget a series resistor into the base of the first transistor.
Depending on what's driving it, sure. I was assuming a 5V OC
logic gate. Good point though, we need more information here.

And there's no reason for R3 because R2 will limit that current.
Then you're only driving .7ish volts on the line. The OP wanted
to drive 12V on the line. If you get rid of R3, you can also get
rid of the first transistor and drive the current out of a 5V TTL
gate (of course 15V and 30V TTL drivers are a possibility).

R1 may not be necessary, either, depending on your circuit's drive.
Like the series resistor you brought up first, sure. It depends
on what's driving the circuit. My <unstated> assumption was an
OC TTL gate. Bad assumption, of course.

FETs would be more efficient.
That wasn't in the OP's question.

There are probably line driver chips that do what you're trying to do, also.

Again the OP specified a transistor, and I think the receiver was
really what he was interested in. OTOH, I'm sure there are a
thousand different variations on the theme, each valid for some
set of conditions (this solution is going to suck eggs at any
kind of frequency). Of course, there isn't enough information to
determine the best solution.

--
Keith
 
Keith R. Williams wrote:

In article <102bg4t1tqpi345@corp.supernews.com>,
jturner@localnet.com says...

Keith R. Williams wrote:

In article <4024E50B.80309@bigfoot.com.au>,
kcinSPAMBLOCK@bigfoot.com.au says...

John Fields wrote:

On Sat, 07 Feb 2004 19:25:26 +1100, Data888
kcinSPAMBLOCK@bigfoot.com.au> wrote:




Hi.
I have some data lines that use 0 or +5v logic. I can connect the line
to the base of the transistor, and a 12v line to the collector to
increase the voltage to run the data longer distances. However, I'm not
sure how to get it back to 5v at the other end. Do I just connect the
12v data line to the base and a 5v line to the collector?

---
How long is the run?


20 to 30 meters.


Put a resistor in series with the receiving transistor's base to
limit the current and a resistor from the receiving transistor's
collector to +5V. Depending on how fast you need to go, choose
the base and collector resistors accordingly.

As a quick off-the-cuff stab (sans calculator, so be nice ;-):



+5V
|
+12V .-.
| | |
| R4| |
+5V +---+ '-'
| | | +
.-. .-. | |
R1| | R2| | - +--------o
| | | | ^ CR1 +
'-' '-' | R3 |
| | | transmission line ___ |/
| +---+--------------------|___|-+--|
| | | |
| | - |
| |/ CR2 ^ |
o----+----| | |
|> +----+
| |
| |
=== ==>>> GND GND
created by Andy´s ASCII-Circuit v1.22.310103 Beta www.tech-
chat.de

If you choose R2 of say 1Kohm, you'll have something like 10mA in
the collector of the transmitting transistor. R1 should be
perhaps 30K or so (assuming a beta min of 30). R3 could be say
10Kohm giving you a base drive of about 1mA. With R4 of 1K
you'll get about 5mA of current in the receiver's collector.

It might be more efficient to move R2 to the other end of the
line though.

CR1 and CR2 (may or may not be needed) are used as a free-
wheeling diodes to limit voltage spikes from the 20-30 meters of
cable, which might be quite inductive.

Don't forget a series resistor into the base of the first transistor.

Depending on what's driving it, sure. I was assuming a 5V OC
logic gate. Good point though, we need more information here.
True.

And there's no reason for R3 because R2 will limit that current.

Then you're only driving .7ish volts on the line. The OP wanted
to drive 12V on the line. If you get rid of R3, you can also get
rid of the first transistor and drive the current out of a 5V TTL
gate (of course 15V and 30V TTL drivers are a possibility).
I thought the problem was voltage drop in the transmission line.
Surely adding a series resistance isn't going to help. Using a totem
pole driver rather than R2 could also improve things if line drop is
a major problem.

--Jeff

--
Ho, ho, ho, hee, hee, hee
and a couple of ha, ha, has;
That's how we pass the day away,
in the merry old land of Oz.
 
On Sun, 08 Feb 2004 17:21:06 -0500, Jeffrey Turner
<jturner@localnet.com> wrote:


I thought the problem was voltage drop in the transmission line.
Surely adding a series resistance isn't going to help. Using a totem
pole driver rather than R2 could also improve things if line drop is
a major problem.
---
The resistance of 200 feet of transmission line is going to be the least
of the problems associated with it if the data rate is going to be high
enough for the impedance of the line to become a factor.

--
John Fields
 
John Fields wrote:
On Sun, 08 Feb 2004 17:21:06 -0500, Jeffrey Turner
jturner@localnet.com> wrote:


I thought the problem was voltage drop in the transmission line.
Surely adding a series resistance isn't going to help. Using a totem
pole driver rather than R2 could also improve things if line drop is
a major problem.

---
The resistance of 200 feet of transmission line is going to be the least
of the problems associated with it if the data rate is going to be high
enough for the impedance of the line to become a factor.
If the impedance of the wire wasn't a factor then an additional driver
stage wouldn't have been needed. We need more information to develop
a complete solution.

--Jeff

--
Ho, ho, ho, hee, hee, hee
and a couple of ha, ha, has;
That's how we pass the day away,
in the merry old land of Oz.
 
On Sat, 7 Feb 2004 11:52:36 -0500, Keith R. Williams
<krw@attglobal.net> wrote:

In article <4024E50B.80309@bigfoot.com.au>,
kcinSPAMBLOCK@bigfoot.com.au says...
John Fields wrote:
On Sat, 07 Feb 2004 19:25:26 +1100, Data888
kcinSPAMBLOCK@bigfoot.com.au> wrote:


Hi.
I have some data lines that use 0 or +5v logic. I can connect the line
to the base of the transistor, and a 12v line to the collector to
increase the voltage to run the data longer distances. However, I'm not
sure how to get it back to 5v at the other end. Do I just connect the
12v data line to the base and a 5v line to the collector?

---
How long is the run?


20 to 30 meters.

Put a resistor in series with the receiving transistor's base to
limit the current and a resistor from the receiving transistor's
collector to +5V. Depending on how fast you need to go, choose
the base and collector resistors accordingly.

As a quick off-the-cuff stab (sans calculator, so be nice ;-):



+5V
|
+12V .-.
| | |
| R4| |
+5V +---+ '-'
| | | +
.-. .-. | |
R1| | R2| | - +--------o
| | | | ^ CR1 +
'-' '-' | R3 |
| | | transmission line ___ |/
| +---+--------------------|___|-+--|
| | | |
| | - |
| |/ CR2 ^ |
o----+----| | |
|> +----+
| |
| |
=== ===
GND GND
created by Andy´s ASCII-Circuit v1.22.310103 Beta www.tech-
chat.de

If you choose R2 of say 1Kohm, you'll have something like 10mA in
the collector of the transmitting transistor. R1 should be
perhaps 30K or so (assuming a beta min of 30). R3 could be say
10Kohm giving you a base drive of about 1mA. With R4 of 1K
you'll get about 5mA of current in the receiver's collector.

It might be more efficient to move R2 to the other end of the
line though.

CR1 and CR2 (may or may not be needed) are used as a free-
wheeling diodes to limit voltage spikes from the 20-30 meters of
cable, which might be quite inductive.

This is horrible. The receive threshold is dependent of R3 and the
beta of Q2, and could be very low. You'd have better noise margins
just using 5 volt CMOS logic levels on both ends.

If you really need 12 volt swings, the receiver ought to have a
well-defined 6-volt threshold; a differential or opto receiver would
be even better ig ground loops are an issue.

The cable will be dominantly capacitive; it will *not* overshoot in
the pullup direction.

Why not just buy some proper RS-485 driver and receiver chips?

John
 
In article <102ddiv22fsv80@corp.supernews.com>,
jturner@localnet.com says...
Keith R. Williams wrote:

In article <102bg4t1tqpi345@corp.supernews.com>,
jturner@localnet.com says...

Keith R. Williams wrote:

In article <4024E50B.80309@bigfoot.com.au>,
kcinSPAMBLOCK@bigfoot.com.au says...

John Fields wrote:

On Sat, 07 Feb 2004 19:25:26 +1100, Data888
kcinSPAMBLOCK@bigfoot.com.au> wrote:




Hi.
I have some data lines that use 0 or +5v logic. I can connect the line
to the base of the transistor, and a 12v line to the collector to
increase the voltage to run the data longer distances. However, I'm not
sure how to get it back to 5v at the other end. Do I just connect the
12v data line to the base and a 5v line to the collector?

---
How long is the run?


20 to 30 meters.


Put a resistor in series with the receiving transistor's base to
limit the current and a resistor from the receiving transistor's
collector to +5V. Depending on how fast you need to go, choose
the base and collector resistors accordingly.

As a quick off-the-cuff stab (sans calculator, so be nice ;-):



+5V
|
+12V .-.
| | |
| R4| |
+5V +---+ '-'
| | | +
.-. .-. | |
R1| | R2| | - +--------o
| | | | ^ CR1 +
'-' '-' | R3 |
| | | transmission line ___ |/
| +---+--------------------|___|-+--|
| | | |
| | - |
| |/ CR2 ^ |
o----+----| | |
|> +----+
| |
| |
=== ===
GND GND
created by Andy´s ASCII-Circuit v1.22.310103 Beta www.tech-
chat.de

If you choose R2 of say 1Kohm, you'll have something like 10mA in
the collector of the transmitting transistor. R1 should be
perhaps 30K or so (assuming a beta min of 30). R3 could be say
10Kohm giving you a base drive of about 1mA. With R4 of 1K
you'll get about 5mA of current in the receiver's collector.

It might be more efficient to move R2 to the other end of the
line though.

CR1 and CR2 (may or may not be needed) are used as a free-
wheeling diodes to limit voltage spikes from the 20-30 meters of
cable, which might be quite inductive.

Don't forget a series resistor into the base of the first transistor.

Depending on what's driving it, sure. I was assuming a 5V OC
logic gate. Good point though, we need more information here.

True.

And there's no reason for R3 because R2 will limit that current.

Then you're only driving .7ish volts on the line. The OP wanted
to drive 12V on the line. If you get rid of R3, you can also get
rid of the first transistor and drive the current out of a 5V TTL
gate (of course 15V and 30V TTL drivers are a possibility).

I thought the problem was voltage drop in the transmission line.
If the voltage drop across the line were a problem, one wouldn't
be using a current into essentially a voltage switch for
signaling. I thought noise was the problem, but again it wasn't
specified.

Surely adding a series resistance isn't going to help. Using a totem
pole driver rather than R2 could also improve things if line drop is
a major problem.
I never considered the resistance of a few tens of meters of wire
to be the issue. Noise, and ground difference would seem to be
to be far more important, thus the large voltage swing. Of
course there are better solutions, but they weren't asked for.
....nor could they be offered sans more information.

--
Keith
 
In article <102dmjq5ft7vj16@corp.supernews.com>,
jturner@localnet.com says...
John Fields wrote:
On Sun, 08 Feb 2004 17:21:06 -0500, Jeffrey Turner
jturner@localnet.com> wrote:


I thought the problem was voltage drop in the transmission line.
Surely adding a series resistance isn't going to help. Using a totem
pole driver rather than R2 could also improve things if line drop is
a major problem.

---
The resistance of 200 feet of transmission line is going to be the least
of the problems associated with it if the data rate is going to be high
enough for the impedance of the line to become a factor.

If the impedance of the wire wasn't a factor then an additional driver
stage wouldn't have been needed. We need more information to develop
a complete solution.
He was asking for the receiver. The OP had already decided upon
12V switching. ...at least as far as I could tell.

--
Keith
 
In article <nood20lfic1nq9l7q7tb6tg1kdqrt5vbhv@4ax.com>,
jjlarkin@highlandSNIPtechTHISnologyPLEASE.com says...
On Sat, 7 Feb 2004 11:52:36 -0500, Keith R. Williams
krw@attglobal.net> wrote:

In article <4024E50B.80309@bigfoot.com.au>,
kcinSPAMBLOCK@bigfoot.com.au says...
John Fields wrote:
On Sat, 07 Feb 2004 19:25:26 +1100, Data888
kcinSPAMBLOCK@bigfoot.com.au> wrote:


Hi.
I have some data lines that use 0 or +5v logic. I can connect the line
to the base of the transistor, and a 12v line to the collector to
increase the voltage to run the data longer distances. However, I'm not
sure how to get it back to 5v at the other end. Do I just connect the
12v data line to the base and a 5v line to the collector?

---
How long is the run?


20 to 30 meters.

Put a resistor in series with the receiving transistor's base to
limit the current and a resistor from the receiving transistor's
collector to +5V. Depending on how fast you need to go, choose
the base and collector resistors accordingly.

As a quick off-the-cuff stab (sans calculator, so be nice ;-):



+5V
|
+12V .-.
| | |
| R4| |
+5V +---+ '-'
| | | +
.-. .-. | |
R1| | R2| | - +--------o
| | | | ^ CR1 +
'-' '-' | R3 |
| | | transmission line ___ |/
| +---+--------------------|___|-+--|
| | | |
| | - |
| |/ CR2 ^ |
o----+----| | |
|> +----+
| |
| |
=== ===
GND GND
created by Andy´s ASCII-Circuit v1.22.310103 Beta www.tech-
chat.de

If you choose R2 of say 1Kohm, you'll have something like 10mA in
the collector of the transmitting transistor. R1 should be
perhaps 30K or so (assuming a beta min of 30). R3 could be say
10Kohm giving you a base drive of about 1mA. With R4 of 1K
you'll get about 5mA of current in the receiver's collector.

It might be more efficient to move R2 to the other end of the
line though.

CR1 and CR2 (may or may not be needed) are used as a free-
wheeling diodes to limit voltage spikes from the 20-30 meters of
cable, which might be quite inductive.


This is horrible. The receive threshold is dependent of R3 and the
beta of Q2, and could be very low. You'd have better noise margins
just using 5 volt CMOS logic levels on both ends.
Horrible, perhaps. It was what the OP wanted, more or less. Try
inducing some noise in there at these currents. ;-). There is
lots of space in here for ground differences, and injected noise
since the currents are rather huge. Certainly I wouldn't do such
a thing for anything other than (very close to) DC, but this is
what the OP asked for.
If you really need 12 volt swings, the receiver ought to have a
well-defined 6-volt threshold; a differential or opto receiver would
be even better ig ground loops are an issue.
Think current. The receiver will have ~12V swing, R3 included.
Sure, the beta of the receiver is important, but the OP asked
for...

The cable will be dominantly capacitive; it will *not* overshoot in
the pullup direction.
Nonsense. I've seen multi-million dollar mainframes *flame* for
such assumptions (and many mucky-mucks pretend to be engineers
after the FD leaves). Black-wire is *inductive*. If it's coax,
or other controlled interface, you're right (notice I attached
the may or may not tag). The cabling was not specified, so
random wire was assumed.

Why not just buy some proper RS-485 driver and receiver chips?
Because that's not what the OP asked for? Hell, why not offer a
current-loop? ...that's pretty much what I did. Crude, but it
is what he asked for.

The question was *not* what's the best way to transmit a 1MHz
signal 100ft using RG58AU. Gee, John, I even stated that I
wouldn't do this, were it my design and understood all the
parameters. I gave the OP the information he asked for.
....silly thing to do .basics, I realize.

--
Keith
 
On Sun, 8 Feb 2004 21:38:10 -0500, Keith R. Williams
<krw@attglobal.net> wrote:
The cable will be dominantly capacitive; it will *not* overshoot in
the pullup direction.

Nonsense. I've seen multi-million dollar mainframes *flame* for
such assumptions (and many mucky-mucks pretend to be engineers
after the FD leaves). Black-wire is *inductive*. If it's coax,
or other controlled interface, you're right (notice I attached
the may or may not tag). The cabling was not specified, so
random wire was assumed.
Any transmission line in this universe, including a random wire, is
going to have an impedance way below 1K. The lumped model of a short
such line will be capacitive, and the risetime of this circuit will be
slow compared to the transit time of such a short line.

Try it.

John
 
On Sun, 08 Feb 2004 19:55:09 -0500, Jeffrey Turner
<jturner@localnet.com> wrote:


If the impedance of the wire wasn't a factor then an additional driver
stage wouldn't have been needed. We need more information to develop
a complete solution.
---
Go back and actually _read_ what the OP wants.

--
John Fields
 

Welcome to EDABoard.com

Sponsor

Back
Top