Low and High

Thread Starter

Edmunds

Joined Sep 27, 2010
85
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
 

THE_RB

Joined Feb 11, 2008
5,438
...
The output remains at 0.65V no matter what.
...
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.
:)
 

AnalogKid

Joined Aug 1, 2013
11,045
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
 

crutschow

Joined Mar 14, 2008
34,452
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:

Thread Starter

Edmunds

Joined Sep 27, 2010
85
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
 

Attachments

Thread Starter

Edmunds

Joined Sep 27, 2010
85
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
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
 

MrChips

Joined Oct 2, 2009
30,810
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:

crutschow

Joined Mar 14, 2008
34,452
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).
 

AnalogKid

Joined Aug 1, 2013
11,045
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
 

shteii01

Joined Feb 19, 2010
4,644
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.
 

crutschow

Joined Mar 14, 2008
34,452
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.
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.
 

sirch2

Joined Jan 21, 2013
1,037
Friends,

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

djsfantasi

Joined Apr 11, 2010
9,163
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.
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.
 

shteii01

Joined Feb 19, 2010
4,644
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.
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.
 

djsfantasi

Joined Apr 11, 2010
9,163
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.
 

Thread Starter

Edmunds

Joined Sep 27, 2010
85
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
 

THE_RB

Joined Feb 11, 2008
5,438
... 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. ...
Good luck with that timeline! We'll be waiting. :)
 
Top