## quick logic level question

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Sambuchi
Posts: 366
Joined: Tue Jan 18, 2005 1:01 am
Location: Orlando FL
Contact:

### quick logic level question

I have 0 to 5 volt digital signal.

If I wanted to convert it to 0 to 3.3 volt...

Could I drop a diode in line to regulate it to 3.3?

The baud rate is 19200.

_____________

Tony

DocJC
Posts: 2
Joined: Fri Jan 23, 2009 6:27 pm
Contact:

### Re: quick logic level question

A better approach is to use two resistors to create a voltage divider.
Two resistors in series between the Input (5V) signal and Ground.
The output, (3V), is at the junction of the two resistors.

Code: Select all

``````-----    <-- Input Signal, (0 or 5 V)
|
R1  10K
|
______ Signal Output
|
R2   15K
|
---  Ground

``````
With this a 5 V input High will be converted to a 3 V High for the reset of your circuit.
0 remains 0.

JC

Bigglez
Posts: 1282
Joined: Mon Oct 15, 2007 7:39 pm
Contact:

### Re: quick logic level question

Sambuchi wrote:I have 0 to 5 volt digital signal.
If I wanted to convert it to 0 to 3.3 volt...
Could I drop a diode in line to regulate it to 3.3?
Probably not, although a short cut like that may work
in some cases. A single diode drop is not really enough.

A much better method is to drive an open-drain FET or
open collector transistor with the five volt signal and
connect the output from this to your 3.3V logic. The
circuit inverts, so a second inverter is needed if the
input can't be inverted first.

Bigglez
Posts: 1282
Joined: Mon Oct 15, 2007 7:39 pm
Contact:

### Re: quick logic level question

Sambuchi wrote:I have 0 to 5 volt digital signal.
If I wanted to convert it to 0 to 3.3 volt...
Could I drop a diode in line to regulate it to 3.3?
Probably not, although a short cut like that may work
in some cases. A single diode drop is not really enough.

A much better method is to drive an open-drain FET or
open collector transistor with the five volt signal and
connect the output from this to your 3.3V logic. The
circuit inverts, so a second inverter is needed if the
input can't be inverted first.

philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

### Re: quick logic level question

If you're going to use a mosfet. Try this instead. No inversion and it's bidirectional

EPA III
Posts: 39
Joined: Tue Aug 17, 2004 1:01 am
Location: Beaumont, TX
Contact:

### Re: quick logic level question

The best answer to this may depend on what you are doing with the signal after "converting" it. If you are going into a 3.3 Volt logic chip, a resistor dividing network may work just fine. As a further precaution you may want to add a diode between the 3.3 Volt input and the 3.3Volt supply to prevent it from ever going much above that 3.3 Volt level. Don't forget to include the input resistance of the 3.3 Volt logic chip in your resistor network calculation.

Also remember that a 5 Volt logic chip does not output a full 5 Volt signal. Even the best logic famlies will drop at least 0.25 Volts at their outputs, many will drop even more. So your output level may be as low as 3.5 Volts to begin with. In some situations, a direct connection would work just fine.

If you are doing something else with it, then details would be needed.
Paul A.

MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

### Re: quick logic level question

Hello,

A single diode will not work because the impedance is too asymmetrical. If you connect it
one way you get maybe close to 3.3v output for a 'high' but you get near open circuit
for a 'low', and if you connect it the other way you get near 0.6v for a 'low' and open circuit
for 'high'.

A diode might work however if you also use a resistor with it. The diode and resistor have
a few different configurations that may work...
Config 1 would be with the diode anode connected to the 5v logic side and the cathode to
the 3.3v logic side, and a resistor tied from the 3.3v side to ground.
Config 2 would be with the diode cathode connected to the 5v logic side and anode to
the 3.3v logic side, and a resistor tied from the 3.3v side to +3.3v.
Config 3 would be with the resistor connected to the 5v logic side and the other end
to the 3.3v logic side, with the diode connected with its anode to the 3.3v logic side
and cathode to +3.3v.

The diode should really be a Schottky type to reduce voltage drop to maintain
noise immunity, and the resistor value may be between 1k and 10k depending on
the logic type.

Of course there is always the NPN emitter follower circuit, which would always work.
The base goes to a 10k resistor with the other end to the the 5v logic side, emitter
to 3.3v logic side, 1k resistor from emitter to ground, collector to +3.3v.
This is a little better than the diode solutions.

Depending on the logic types the impedance levels may tolerate a simple resistive
divider as others have mentioned. You would make the values such that the 5v
logic side is not loaded too heavily, while the 3.3v logic side still has enough
drive. If these conditions can not be met then a resistive divider can not be used.
LEDs vs Bulbs, LEDs are winning.

Externet
Posts: 1862
Joined: Fri Feb 01, 2002 1:01 am
Location: Mideast USA
Contact:

### Re: quick logic level question

Sambuchi: there are very common ic's in the industry to perform that; do the search using the more proper term "level translator ic" to get multiple choices in brands, speeds and logic families.
Miguel
- Abolish the deciBel ! -

### Who is online

Users browsing this forum: No registered users and 34 guests