5v to 3.3v level converter with MOSFET

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi.

i have been working on a SD card related project for a while and unfortunately i do not have access to good SD card modules so i decided to build one.

as we  all know micro controllers work with 5v(logic 1) and SD cards work with 3.3v(logic 1) so we need a level converter here.

i google and found this on the web:

https://www.sparkfun.com/products/12009

 

i simulated this circuit with Orcad Pspice9.2 and i replaced BSS138 with 2N7002 and with a frequency 250KHz

here is the schematics and result:

 

 

 

 

as you can see there is a peak at rising edge of the output signal

my question is this circuit can be used to interface a SD card to a micro controller or not?

Last Edited: Mon. Aug 21, 2017 - 11:11 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I've found these Mosfet voltage translators unreliable. I'm really not sure what is their attraction, apart from some people thinking they are a "cool trick". If you want a simple, reliable voltage translator use a 4050 or similar, and then you don't even have to bother with Spice models.

Bob.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

donotdespisethesnake wrote:
I'm really not sure what is their attraction

Likewise.

 

Proper, purpose-designed voltage translator ICs are widely available ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

K-AVR wrote:
we all know micro controllers work with 5v(logic 1)

We also know that microcontrollers can operate very reliably with a 3.3volt supply and therefore would not need a level converter.

 

Which uC are you thinking of using?

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Probably the majority of microcontrollers these days work at "3V" - or even less ...

 

Outside hobby circles, I'd guess that 5V operation is now (and, in fact, has been for some time) the exception - not the rule?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

K-AVR wrote:
as we all know micro controllers work with 5v logic

This is of course complete and utter bollocks.

Most AVR's work perfectly well from a powersupply of 1.8V (Although wit a educed clock frequency).

Why would you want to use 2 different voltage regulators and then also add even more circuitry to ty chips on different power supply voltages together?

 

This MOSfet circuit also has a disadvantage that one side can only pull the other to GND and the pullup is passive by the 2 10k Resistors.

I believe the origin of this circuit is from a philips I2C application note where it is used to ty bidirectional I2C lines from different power supply's together.

In that case is is quite an elegant circuit Partly because you already need the pullup resistors anyway and ony have to add the fet's.

 

the 2n7002 is also not the best fet for this circuit. It's Ugs (threshold) is too high.

Ideally you would want a fet with a threshold voltage of below 2V.

Tip: If you make the flanks of your simulation real slow, you can see the voltage levels on which the fet switches.

 

If you still want to go on, this circuit works.

If you start increasing the input voltage of an AVR beyond Vcc then eventually the ESD diode's in the AVR will start conducting.

My DMM measures 0.71V on a m8. These diodes can also handle a few mA coninuous (MUCH higher peak currents).

If you want a reliable simulation you also have to add the equivalent of the input of an AVR pin to te simulation.

 

The voltage "spikes" are probably from the paracitic capacitors in the Fet.

Current is about 0.5V/10k = 50uA peak which is ... not much.

 

Fun homework assignment:

Calculate the capacitance from the RC constant of your "peak" and compare that with the Fet parameters in your model.

 

@awneil:

One of the old guys here stated that 5V logic is often used in the automotive industry because of better noise immunity.

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Paulvdh wrote:
@awneil:

One of the old guys here stated that 5V logic is often used in the automotive industry because of better noise immunity.

Indeed; but that is one of the exceptions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I remember we discussed this type of level shifter some time ago: http://www.avrfreaks.net/forum/l...

I made one out of junk and did some measurements at 500KHz. I don't know exactly which MOSFET it was, but in practice they had slower response than the simulation. Still usable, though.

 

But I don't see any problem with this configuration, reputable manufacturers sell ICs that have this circuit internally, for example http://www.ti.com/product/TXS0102

If you really want to make a version with discrete components, post #6 has good advice, for example, the threshold, that's why BSS138 is better for this.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thank you all

i made this schematics using a line driver/buffer IC 74HC244

please tell me if something wrong or missing

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

donotdespisethesnake wrote:
 use a 4050

 

I think you mean 4504.  No 4050's on DigiKey.

 

My mistake.  4504's are unidirectional.

Last Edited: Mon. Aug 21, 2017 - 06:10 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your simulation may work better with load resistors on the two outputs.

 

Jim

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MarkThomas wrote:

donotdespisethesnake wrote:
 use a 4050

 

I think you mean 4504.  No 4050's on DigiKey.

 

 

Nope, none at al!. Completely non-existent part. I just pulled a random number out of my ass to make it look like I knew what I was talking about. If you do see one, you are probably on crack or something.

 

https://www.digikey.co.uk/products/en?keywords=cd4050

 

 

Bob.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For bi-directional level shifter, TXB0108

Just in case someone is looking for it!

Jim