Low and High

Discussion in 'The Projects Forum' started by Edmunds, Jun 9, 2014.

  1. Edmunds

    Thread Starter Active Member

    Sep 27, 2010
    85
    0
    Dear all,

    I have an unusual situation. One of my "boards" has an output that produces 5.00V when high and 2.10V when low (brrr). I need that signal to drive another "board", that is inverted - on low, it should receive high of 5.0V. I was hoping a transistor inverter would do the job and made a simple circuit with two resistors and npn transistor on a breadboard. It did not really help. The output remains at 0.65V no matter what. I guess, 2.10V is not really "low" for the transistor and thus it produces "low" on the output.

    Without understanding the heart and soul of it, I tried a 120k resistor on the input to lower the input voltage, but that did not help. Obviously, there is something I don't understand :). Can you help, pls?

    Edmunds
     
  2. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    I give it a 90% probability that you wired the transistor pins wrong.

    Please post a schematic, even just a photo of a pen and paper drawing will do.

    A photo of the wiring and info about the transistor type will also help.

    It's a simple task, and you should only need one NPN transistor and 3 resistors to make it work.
    :)
     
  3. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,378
    494
    Why not use logic gate? Like the 7404 chip?
     
  4. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    Because 2.10V is not low enough to turn off a transistor or be seen by a TTL gate as a low input.

    What is the source of the 5.00V / 2.10V signal? If it can source 12 mA, try this:

    5V source through 390 ohm resistor to the base
    100 ohm resistor from base to to GND
    Emitter to GND
    Collector resistor for whatever the load is

    This will give you about 4.6 mA of base current when on, and about 0.4V on the base when off. Increasing the 390 will decrease the base current and decrease the off voltage.

    ak
     
    Edmunds likes this.
  5. crutschow

    Expert

    Mar 14, 2008
    12,981
    3,221
    Here's a simulation of AK's circuit. I arbitrarily used a 1kΩ collector resistor and increased the value of the input resistors accordingly.

    New-3.gif
     
    Last edited: Jun 10, 2014
    Edmunds likes this.
  6. Edmunds

    Thread Starter Active Member

    Sep 27, 2010
    85
    0
    Friends,

    Thank you all for your input. I had 2N3904, 2.2k and 1.3k resistors at hand instead of the exact values proposed. Nevertheless, it all works now with the board assembled and ready to be installed in place. FYI, you helped me with the last bit remaining in getting the necessary 4th axis controller working for my cnc router that is now also a 3d printer.

    Photo attached.

    Edmunds
     
  7. Edmunds

    Thread Starter Active Member

    Sep 27, 2010
    85
    0
    It works now and thank you once again for that. Could you please explain how the circuit works or point to a good reference, so I know better next time?

    Regards,

    Edmunds
     
  8. MrChips

    Moderator

    Oct 2, 2009
    12,418
    3,355
    Simple, the 100Ω resistor from base to ground drains away some of the current so that the transistor is turned off even when the input voltage is at 2V.

    Another way of looking at it, the two resistors (390Ω and 100Ω) form a voltage divider that reduces the input voltage by a factor of 5. Hence 5V is reduced to 1V and 2V is reduced to 0.4V.

    The switching point of the transistor is 0.7V, just at the midpoint between 0.4 and 1V.
     
    Last edited: Jun 10, 2014
  9. crutschow

    Expert

    Mar 14, 2008
    12,981
    3,221
    I don't see how your circuit can work with 2.2kΩ and 1.3kΩ input resistors (if that's what you used) since that means the transistor starts turning on at about 1.7V. :confused:

    An alternate way to do the circuit would be to connect a 3.0V zener diode in series with the input with a resistor from the base to ground of perhaps 1kΩ. The diode will drop 3V giving a turn-on threshold of about 3.5V (including the transistor base-emitter drop).
     
  10. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    One way to think of a transistor in a low power logic circuit is as a strange inverter. It needs a pull up resistor on the output and a current limiting resistor on the input, but from a voltage-mode point of view it is an inverter:

    Any input below 0.65V, the output is high.
    Any input above 0.65V, the output is low.

    Of course there is a bit more to it, but this is the thinking that led to my resistor values. You need a 2-resistor attenuator that attenuates 2.1V down to something below 0.65V, while making sure the same attenuator does not attenuate the 5.0V so much that it can't remain above 0.65V. Plus, the base current for the 5V condition must be a safe value (I start at 5 mA and see what happens.).

    Ohm's Law + Thevenin's Theorem + 0.65V + 3rd grade arithmetic.

    ak
     
  11. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,378
    494
    I still think a NOT gate ic with voltage divider in front (to set High/Low input voltages to NOT gate) is simpler and easier to understand solution.
     
  12. crutschow

    Expert

    Mar 14, 2008
    12,981
    3,221
    But a digital IC wants 0V for a logic 0 and 5V for a logic 1, which can't be achieved with a voltage divider and the given voltages. They are not designed to operate with voltages in between.
     
  13. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
    I've been thinking about getting a CNC router with a view to making it into a 3D printer. Is there any chance you could start a new thread with a few details and you experiences. I'm sure I'm not the only one who would be interested.

    Thanks!
     
    Edmunds likes this.
  14. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,793
    829
    C, digital ICs aren't so black and white. There is a range of voltages for high and low signals plus an indeterminate region. A CMOX hex inverter (4049) running at 5V will accept 0-1.5V as a low; 3.5-5V as a high signal.

    I didn't calculate the voltage divider required (or even if it's possible) but wanted to clarify that digital logic isn't really 0 or 1! It's a range of voltage values. So at its most basic level, digital is analog.
     
  15. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    ak

    (note - the number of ! = 42)
     
  16. MrChips

    Moderator

    Oct 2, 2009
    12,418
    3,355
    Bingo!!!!!!!
     
  17. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,378
    494
    That is not correct.
    Example:
    TI SN7404
    * Input High is 2 Volts or more. If you power the chip with typical 5 volts, then any input between 2-5 volts will be interpreted as inputing digital 1 to the input of the NOT gate and the output of the NOT will be digital 0, but in reality output will be 0.2-0.4 volts.
    * Input Low is 0.8 volts or less. So I am sending 0.8 volts or less to the input of the NOT gate, this is digital 0. The output of the NOT gate will be digital 1, but in reality the output will be 2.4-3.4 volts and maybe even higher since we are powering the chip with 5 volts.

    This is straight from the datasheet: http://hibp.ecse.rpi.edu/~connor/education/EIspecs/sn7404.pdf

    But the idea that digital 0 is exactly 0 volts and digital 1 is exactly 5 volts is not supported by the datasheet.
     
  18. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,793
    829
    It depends on which inverter you choose. I believe the link shteil01 provided is for TTL; my ranges are for a 4000 series CMOS hex inverter. I mention this to avoid confusion between our two posts. They are apples and oranges.

    However, the basic point is the same. Digital values defined as an analog range.
     
  19. Edmunds

    Thread Starter Active Member

    Sep 27, 2010
    85
    0
    Hei,

    Thank you for the suggestion, at some point I will definitely find a way of sharing what I have done during the past 6 months with this. Basically, I should be done with a full SMD PCB prototyping cycle (double sided milling, drilling, solder paste stencil laser cutter and component pick and place), 3D printer and laser engraving in one, small and reliable machine by the end of the summer. I was more thinking of a separate blog series, but let's see where I end up.

    Edmunds
     
  20. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Good luck with that timeline! We'll be waiting. :)
     
Loading...