0
\$\begingroup\$

I was wondering if I can convert 3.3v to 5v when the 3.3v part isn't 5v tolerant.

I was thinking of using this layout: diagram with npn transistor

However I'm not sure if the gpio pin will get 5v "for a second" or if this is safe? Additionally, I'm not sure how to work out if 1MHz or 10MHz is possible here.

Would it be better to use a pnp transistor instead (SS8050?) so that the gpio could trigger the base directly?

If this is the wrong way to do this, is there a cheap unidirectional 3.3v to 5v converter IC which ideally has a schematic in Eagle?

EDIT: To clarify. I'm hoping to use the 5v to communicate with a shift register (which needs around 3.7v input minimum). Not to power the shift register.

\$\endgroup\$
8
  • \$\begingroup\$ To avoid any wrong assumptions, what is the 5V part that you want to drive from the 3.3V GPIO? If this is a one-off, where you have some flexibility, could you use a 74HCTxx part which has a lower input voltage threshold (low 0.8V, high 2.0V) threshold that a 3.3V GPIO could drive directly? \$\endgroup\$
    – gbulmer
    Sep 18 '16 at 22:52
  • \$\begingroup\$ Also when it says '5V out to supply a shift register', do you mean '5V out to drive an input pin of a shift register' or do you want to supply 5V power source for a shift register, and control that power with a 3.3V GPIO? I read your question as you wanted to drive an input pin of a shift register, controlling a 5V device input pin from a 3.3V device. However rtstorm seems to read the question differently, so it may be unclear. \$\endgroup\$
    – gbulmer
    Sep 18 '16 at 23:01
  • \$\begingroup\$ Gblumer. Your correct. I'm hoping to send data to a shift register. Not power it. At the moment I'm wanting to use the 74hc595. When this is run at 5v it seems to need around 3.7v for an input. I'd rather not run the shift register at a lower voltage as I'm wanting to use the shift register to control servos which require 5v input. The datasheet for the servos doesn't have a minimum input so I'd rather control the servos with the full 5v if possible. \$\endgroup\$ Sep 18 '16 at 23:12
  • 1
    \$\begingroup\$ A 74HCT595 would also run at 5V. However, its input pins will register a LOW at 0.8V, and a HIGH at 2.0V. Assuming your 3.3V device is CMOS, it will drive its GPIO outputs close to the power rails, 0V and 3.3V, so it has reasonable headroom. \$\endgroup\$
    – gbulmer
    Sep 18 '16 at 23:28
  • \$\begingroup\$ Thank you for the reply. The HCT is definitely a nice! I'll probably end up using that, although it seems to be around double the price. It doesn't matter that much now, but I'm quite interested in price cutting for larger volume (if that ever happens) as I'm planning to use at least 3 shift registers. Thanks again. \$\endgroup\$ Sep 18 '16 at 23:55
1
\$\begingroup\$

A 74HC595 has the characteristics of 74HC logic families, and so has an input LOW maximum of 1.0V, and an input HIGH minimum of 3.5V.

So the circuit does need a signal level shifter to drive the 74HC595 inputs from a 3.3V GPIO.

However 74HCT will register a LOW at 0.8V, and a HIGH at 2.0V.

See table "Characteristics of Selected 7400 Series Families" at Wikipedia 7400 series for the signal thresholds.

A 74HCT595 would also run at 5V. Assuming your 3.3V device is CMOS, it will drive its GPIO outputs close to the power rails, about 0.6V LOW and 2.7V HIGH for modest current, so it has some headroom.

If you need to drive several inputs of the 74xx595 shift register, then the 74HCT595 would save a set of signal level shifting components.

If the extra cost of the 74HCT595 is an issue, you could use the fact that 74HCTxx logic inputs would work with your 3.3V while the outputs would drive a 74HC595. Effectively use 74HCTxx logic as a level shifter.

So, for example, a 74HCT04 hex inverter could be used to level shift 6 signals, which might be enough to interface to several 74HC595 shift registers. Hence, 6 sets of signal level shifting components could be replaced with a 74HCT04 plus a decoupling capacitor.

\$\endgroup\$
0
\$\begingroup\$

is there a cheap unidirectional 3.3v to 5v converter IC which ideally has a schematic in Eagle?

Here is the link to TI's product comparison page for unidirectional level shifters. Most of them are cheap less than 0.7 USD per shifter and have switching frequency up to 50 MHz. Some of them are available as free samples too (Though terms and conditions are applied)

http://www.ti.com/lsds/ti/logic/unidirectional-voltage-translation-products.page

TI provides CAD models for most of their products along with data sheet.

Hope, you find it useful.

\$\endgroup\$
-1
\$\begingroup\$

Close, but no cigar. Try your luck again.

You have the general idea correct, just need to swap some pins. The 3.3V GPIO should be connected to R27. The transistor Emitter (or mosfet drain) should be connected to the common ground.

This is a typical n - channel level translator that's in use everywhere. The only thing about it is that logic is inverted. That's simple to fix in code. When your GPIO is logic high, the transistor pulls the collector and thus the 5V input IC pin to ground.

\$\endgroup\$
-1
\$\begingroup\$

However I'm not sure if the gpio pin will get 5v "for a second" or if this is safe?

Where your schematic sayas "3.3 V supply" you should actually connect a 3.3 V logic signal. And where the schematic says "GPIO 3v supply" you should just connect to ground.

With that in mind...

If the 5 V supply is turned on very (very) quickly, the gate-drain capacitance of the FET could deliver a small amount of power back to the 3.3 V circuit. But it is very very unlikely there would be enough energy involved to damage the 3.3 V circuit.

Once the power supplies are turned on, normal operation of this circuit does not ever connect the 3.3 V circuit to 5.5 V.

This is in fact a very common way to translate low voltage logic levels to higher voltage levels. Depending on the load and the switching speed needed, you could even possibly increase R29 to 5, 10, or even 50 kohms and reduce the power consumed when the output is in the low state.

Additionally, I'm not sure how to work out if 1mhz or 10mhz is possible here.

For 1 MHz, with 1 kohm pull up and a single IC loading the output there will be no problem.

For 10 MHz, you should determine the load capacitance (due to the MOSFET, the load IC, and the traces between them) and verify that the rise time when the MOSFET releases the line will be fast enough.

Would it be better to use a pnp transistor instead (SS8050?) so that the gpio could trigger the base directly?

This would most likely not work. Whether you mean to use the PNP in common emitter (emitter tied to 5 V) or common collector (collector tied to ground, emitter pulled up to 5 V) configuration, then this circuit will expose the 3.3 V circuit to over-voltage (~4.5 V).

At the moment I'm wanting to use the 74hc595. When this is run at 5v it seems to need around 3.7v for an input.

You should look at the datasheet for 74HCT595. With \$V_{ih}\$ minimum of 2 V, you could avoid the level translation problem altogether.

\$\endgroup\$
2
  • \$\begingroup\$ Thank you for the long, well considered reply. I'm quite tempted by the HCT and will probably end up using that! However it does seem to be about double the price and I'm looking to use 3 shift registers in this PCB, so I'm quite interested in price cutting for scale (if that ever happens). Am I right in thinking that with your modifications the 5v output is inverted? I was thinking I was making something similar to this question? electronics.stackexchange.com/questions/82104/… But inverting in software may be the way to go. \$\endgroup\$ Sep 19 '16 at 0:02
  • \$\begingroup\$ @ShaneeVanstone, On Octopart I see NXP's 74HC595,112 for $0.28 at qty 1000, or 74HCT595,112 for $0.38 at the same quantity. Remembering that you'll pay a few cents extra for placement of each added part at your assembly shop, I wouldn't worry too much about this price difference. And yes, the common source translator circuit does invert the signal. You could also use something like a 74LVC1G07 which won't cost you much more than a single FET but won't invert the signal and will have specs that make it easier to prove your circuit will operate at speed. \$\endgroup\$
    – The Photon
    Sep 19 '16 at 1:29
-3
\$\begingroup\$

I think you need to use buck converter. Basicly you need a IC that will control opening and closing Gate on transistor. That IC should have referance point in desired voltage (5V). Also on output it is good thing that you insert coil that will absorbe shock caused by transistor.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ I'm unclear. Why would you use a 'buck converter'? Why does it need an IC to control the gate on the transistor, the GPIO should be able to control the gate directly. Where does the 'shock' come from that a 'coil' is needed to "absorbe"? Are you reading the question as needing a DC-DC converter? \$\endgroup\$
    – gbulmer
    Sep 18 '16 at 22:55
  • \$\begingroup\$ Yes i see now, he need a step up conveter. To convert 3.3V to 5V (sorry my english is not good) \$\endgroup\$
    – rtstorm
    Sep 18 '16 at 23:04
  • 2
    \$\begingroup\$ AFAICT, the question seems to be about translating a signal, not a power source. OP appears to already have a 5 V source available. \$\endgroup\$
    – The Photon
    Sep 18 '16 at 23:14
  • \$\begingroup\$ @rtstorm - no problem. We all make mistakes. Welcome to ee.se! I hope you enjoy contributing, which may be a great way to help your English. \$\endgroup\$
    – gbulmer
    Sep 19 '16 at 1:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.