Connect with us

Transistors as switch

Discussion in 'Electronic Basics' started by Data888, Feb 7, 2004.

Scroll to continue with content
  1. Data888

    Data888 Guest

    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?
  2. John Fields

    John Fields Guest

  3. Data888

    Data888 Guest

    20 to 30 meters.
  4. John Fields

    John Fields Guest

  5. John Fields

    John Fields Guest

  6. 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 ;-):

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

    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.
  7. 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.

  8. Depending on what's driving it, sure. I was assuming a 5V OC
    logic gate. Good point though, we need more information here.
    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).
    Like the series resistor you brought up first, sure. It depends
    That wasn't in the OP's question.

    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.
  9. 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.

  10. John Fields

    John Fields Guest

  11. 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.

  12. John Larkin

    John Larkin Guest

    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?

  13. 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
    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.
  14. He was asking for the receiver. The OP had already decided upon
    12V switching. least as far as I could tell.
  15. 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.
    Think current. The receiver will have ~12V swing, R3 included.
    Sure, the beta of the receiver is important, but the OP asked
    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.
    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.
  16. John Larkin

    John Larkin Guest

    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.

  17. John Fields

    John Fields Guest

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day