5V to 3.3V TTL conversion

Thread Starter

Kihun Song

Joined Nov 23, 2017
16
Eric's solution at #11 can help. Outputs usually also have protection diodes, so you can't passively pull an input to more than a diode drop above the positive supply of the outputting device - so around 3.9 to 4 V with 3.3 V circuits. Again you must be careful not to exceed the current handling of the diodes and you have that risk of powering an unpowered circuit through the diode. But 10k limits the maximum current under any circumstances to half a milliamp. 4 volts is going to be a good clean logic HIGH for any standard input for CMOS running on 5 V. You definitely would not use the resistor in series between the output and the input.

I'm curious about the first three lines in the table at #16. How is direct connection safe/functional for those signals?
AUX signal is LoRa output to Arduino input, meaning 3.3V to 5V so no problem there.
The manufacturer states the module can stand 5V but 3.3V is recommended, so I just connected M0 and M1 pins directly to 5V output of the arduino. They output HIGH or LOW cpntonuously and work in combination to decide one of 4 working modes.

Whether I should use 5V or 3.3V was unclear to me, and some people suggested to lower the voltage into 3.3V, so I decided to connect a resistor to the UART pins where the data would be sure to go directly into the MCU of the LoRa module

I attached a datasheet if somebody is looking for one.
 

Attachments

Thread Starter

Kihun Song

Joined Nov 23, 2017
16

ericgibbs

Joined Jan 29, 2010
21,509
hi KS,
All a series resistor from a 5v output to a 3.3v input would do is limit the the current flowing from the 5v into the 3.3v pin, a series resistor is often used in this way.
A resistor from a 3.3v output to a 5v input will do nothing, unless the 5v input pin has a an internal pull up enabled.
The internal pull up resistor a high value, approx 20k+, so all the series resistor would do is limit the very small current.

If you want a better solution use a ready made bidirectional voltage up/down module.
I use a module that has 3 bidirectional level shifters, running at 20Mhz.

E
I will post a link.

https://www.ebay.co.uk/sl/node?title=5v to 3.3v level shifter&caty=4660&catyIdPath[]=12576&catyIdPath[]=92074&catyIdPath[]=182412&catyIdPath[]=4660&catyNamePath[]=Business, Office & Industrial&catyNamePath[]=Electrical Equipment & Supplies&catyNamePath[]=Electronic Components & Semiconductors&catyNamePath[]=Other Electronic Components&isHG=true&isUid=false

Update:
Added the circuit diagram for the Level Shift module.
You can make your own with a BSS138 FET etc...
 

Attachments

Last edited:

ebp

Joined Feb 8, 2018
2,332
You can confirm 5 volt tolerance of inputs by using a series resistor and measuring the voltage across it. If the measurement confirms very low current, the input is tolerant.

Unfortunately, the datasheet for the module is not helpful. It says "The modules 3.3V TTL output." [sic]. This is something of a nonsense statement.

The processor on the Nano requires 0.6 x Vdd for logic high, so if an input is driven to close to 3.3 V it should be OK, though not with a great deal of noise margin. Usually CMOS outputs will swing very close to the supply rails if lightly loaded, so 3.2 V or more is not an unreasonable expectation. The internal pullup (20k - 50k) could be turned on for a little improvement.
 

BobaMosfet

Joined Jul 1, 2009
2,211
No, it is a common base level shifter. The voltage at the emitter will be Vbe below the voltage at the base - it cannot be higher or the transistor would turn off. It is rather like a common collector circuit with the base voltage fixed. A common base circuit like this can be used to shift hundreds of volts if a suitable transistor is used. It is simpler than using two common emitter stages for non-inverting up shifting. One drawback is that the current gain is less than unity.

Generality that is not important to the problem at hand:
If implemented with two transistors, particularly as a linear amplifier, it is commonly called a "cascode" circuit. A similar circuit is sometimes used with power bipolar transistors where the base voltage on the upper transistor is not fixed. Properly done this can sometimes result in better overall safe operating area than using transistors in parallel because it "shifts Vce left" from the second breakdown part of the curve into the power limited part of the curve. In the days when power MOSFET voltage ratings were not great and high voltage bipolar transistors were slow, you would sometimes see the BJT switched by a low voltage FET in the emitter. You could make a fast high voltage switch that way. The BJT is kept of out saturation, so it switches off fast.
Um... no. First of all, when you say something is 'common', you are referring to the fact that it is tied to ground. Please review the schematic provided by Dana, and you'll see that the base in this case is tied 3.3V by a 4K7 pullup resistor. I'm only discussing the schematic shown, not another or extended design.

I ran this through a simulator, and it matches what I'm saying, but in case there is an issue with the sim, I'm just going to mock this up on a breadboard. I'll use a different BJT, because I don't have the one spec'd, but that should not be a detriment.
 
Last edited:

ebp

Joined Feb 8, 2018
2,332
I don't need to simulate it and I don't know what you did, but the circuit works as I described previously.

The voltage at the emitter, relative to circuit common (ground) will NEVER be higher than the base voltage. It the resistance between the emitter and ground is extremely high, the voltage at the emitter will be only two or three hundred millivolts less than the base voltage with common small signal transistors. The base voltage will be very nearly 3.3 V because the base current required is minuscule. If the emitter resistor is moderate, 1k for example, then the base-emitter voltage will be higher and the voltage across the resistor will be about 0.6 V less than 3.3 V. It cannot be otherwise.

It is common base. "Common" in transistor (or vacuum tube for that matter) circuits does not mean connected to ground. An NPN common collector circuit has the collector tied to the positive supply, as does a N-channel common drain circuit. With an NPN common base circuit with the base tied to "ground", the only way you would make it conduct is to pull the emitter negative with respect to ground. In this use, the base must be connected through a resistor because the emitter can be pulled fully to 0 V which would result in excessive base current without the limiting resistor.

And I did simulate it and it works exactly as I describe. The voltage at the emitter can never exceed the voltage at the base and will always be lower than the voltage at the base. With a 2N3904 with the base tied directly to 3.3 V, the collector at 30 V and 1 GΩ between emitter and zero, the voltage at the emitter relative to zero is 3.015 V with the model I'm using (standard supplied with Tina TI).
 

BobaMosfet

Joined Jul 1, 2009
2,211
I don't need to simulate it and I don't know what you did, but the circuit works as I described previously.

The voltage at the emitter, relative to circuit common (ground) will NEVER be higher than the base voltage. It the resistance between the emitter and ground is extremely high, the voltage at the emitter will be only two or three hundred millivolts less than the base voltage with common small signal transistors. The base voltage will be very nearly 3.3 V because the base current required is minuscule. If the emitter resistor is moderate, 1k for example, then the base-emitter voltage will be higher and the voltage across the resistor will be about 0.6 V less than 3.3 V. It cannot be otherwise.

It is common base. "Common" in transistor (or vacuum tube for that matter) circuits does not mean connected to ground. An NPN common collector circuit has the collector tied to the positive supply, as does a N-channel common drain circuit. With an NPN common base circuit with the base tied to "ground", the only way you would make it conduct is to pull the emitter negative with respect to ground. In this use, the base must be connected through a resistor because the emitter can be pulled fully to 0 V which would result in excessive base current without the limiting resistor.

And I did simulate it and it works exactly as I describe. The voltage at the emitter can never exceed the voltage at the base and will always be lower than the voltage at the base. With a 2N3904 with the base tied directly to 3.3 V, the collector at 30 V and 1 GΩ between emitter and zero, the voltage at the emitter relative to zero is 3.015 V with the model I'm using (standard supplied with Tina TI).
@ebp-

I don't disagree with you at this point. :) I mocked it up on a breadboard, and it worked. And makes sense now. It's not a common-base circuit, it's a common-emitter circuit. My problem with the simulation was in how I generated the pulse train on the 3.3V line. So after the real circuit worked, I re-evaluated the simulation and found the error. After correcting that, it works as expected.

In fact, I think it's quite clever. Each side floats at it's natural 3.3V or 5.0V level until the circuit is pulled to ground.... I like this circuit again.

Thank you for taking the time to walk through the specifics of it again.
 
Last edited:

ArakelTheDragon

Joined Nov 18, 2016
1,366
You can confirm 5 volt tolerance of inputs by using a series resistor and measuring the voltage across it. If the measurement confirms very low current, the input is tolerant.

Unfortunately, the datasheet for the module is not helpful. It says "The modules 3.3V TTL output." [sic]. This is something of a nonsense statement.

The processor on the Nano requires 0.6 x Vdd for logic high, so if an input is driven to close to 3.3 V it should be OK, though not with a great deal of noise margin. Usually CMOS outputs will swing very close to the supply rails if lightly loaded, so 3.2 V or more is not an unreasonable expectation. The internal pullup (20k - 50k) could be turned on for a little improvement.
You are dealing with Arduino, nonsense is something normal.
 

ebp

Joined Feb 8, 2018
2,332
Dragon, I think everyone at AAC has had enough of your opinion of Arduino. People do interesting and fun things and learn some electroncis and programming by using the Arduino and all the things made to work with it. The datasheet in question has nothing to do with the Ardunio.
I DO NOT CARE ONE TINY LITTLE BIT WHAT YOU THINK ABOUT ARDUINO!


 

ArakelTheDragon

Joined Nov 18, 2016
1,366
Dragon, I think everyone at AAC has had enough of your opinion of Arduino. People do interesting and fun things and learn some electroncis and programming by using the Arduino and all the things made to work with it. The datasheet in question has nothing to do with the Ardunio.
I DO NOT CARE ONE TINY LITTLE BIT WHAT YOU THINK ABOUT ARDUINO!
Thank you for the big RED letters ! I will not bother you anymore !!!
 
Top