5
rocketnumbernine Andrew's Project Blog: Hardware, Software, Stuff I find Interesting 5V-3.3V bidirectional level converter by Andrew on 10 Apr 2009 More and more interesting devices seem to be using 3.3V rather than the usual 5V that micro-controllers run at. I find that level conversion circuitry often clutters the rest of the circuit and has to be tweaked for the characteristics of the device being interfaced with. This posting details the research for and construction of a reusable, plug-n-play power drop and bi-directional level converter for use in prototyping. By far the easiest solution is to also run the micro-controller at 3.3V, but this can affect maximum frequency of the device and can complicate interfacing with USB. The alternative is to use a small regulator to down shift the 5V to 3.3V supply voltage (if not using an Arduino like board which has one built in) and an ad-hoc level conversion circuit for the logic lines. Power Conversion The Circuit below uses a Microchip MCP1700 LDO Voltage Regulator , which is fairly cheap, and available in a number of output voltages and case styles, the device can provide upto 250mA, but unless cooled I wouldn't draw more than 10s of mA through it - particularly in the SOT23-3 style case (see here for more). Logic Level Conversion Techniques for converting the digital logic levels depends on whether the line is unidirectal - like SPI - where one side of each line always acts as the output, or bi-directional - like I2C - where both sides can drive the line. Obviously, a unidirectional converter is much simpler and the specific technique depends on whether

conversor Mosfet 5V-3v3

Embed Size (px)

DESCRIPTION

Conversor de nive lógico

Citation preview

Page 1: conversor Mosfet 5V-3v3

rocketnumbernineAndrew's Project Blog: Hardware, Software, Stuff I find Interesting5V-3.3V bidirectional level converterby Andrew on 10 Apr 2009

More and more interesting devices seem to be using 3.3V rather than the usual 5V that micro-controllers runat. I find that level conversion circuitry often clutters the rest of the circuit and has to be tweaked for thecharacteristics of the device being interfaced with. This posting details the research for and construction of areusable, plug-n-play power drop and bi-directional level converter for use in prototyping.

By far the easiest solution is to also run the micro-controller at 3.3V, but this can affect maximum frequencyof the device and can complicate interfacing with USB. The alternative is to use a small regulator to downshift the 5V to 3.3V supply voltage (if not using an Arduino like board which has one built in) and an ad-hoclevel conversion circuit for the logic lines.

Power Conversion

The Circuit below uses a Microchip MCP1700 LDO Voltage Regulator, which is fairly cheap, and availablein a number of output voltages and case styles, the device can provide upto 250mA, but unless cooled Iwouldn't draw more than 10s of mA through it - particularly in the SOT23-3 style case (see here for more).

Logic Level Conversion

Techniques for converting the digital logic levels depends on whether the line is unidirectal - like SPI - whereone side of each line always acts as the output, or bi-directional - like I2C - where both sides can drive theline. Obviously, a unidirectional converter is much simpler and the specific technique depends on whether

Page 2: conversor Mosfet 5V-3v3

we're shifting up or down (if the driving line is the low or high level respectively).

Unidirectional Level Conversion: Low-to-High

Connecting a 3.3V digital output pin to a 5V input pin is often straightforward. Most devices are fairlytolerant to the minimum voltage that they will accept as a digital high value. Most Atmel microcontrollers, forexample, accept anything above 0.6Vcc as high, so the 3.3V device must output a level above 3V(0.65V).

The electrical characteristics section of both devices datasheets needs to be checked (for example). Note,that the voltage out of many devices will drop if the load current is increased. Most digital devices draw lessthan 1μA but it may become an issue if the line is also driving something else. For example, the datasheet ofthe Color Nokia Knock-Off LCD sold by SparkFun states that the minimum value possible for a high level isthe supply voltage - 0.4V = 2.9Volts. Although this is a minimum and the device is likely to output anacceptably high value this isn't a kind of error that will be easy to debug in a finished system.

Unidirectional Level Conversion: High-to-Low

Converting 5V to 3.3V is more interesting. Many devices can accept higher voltage inputs than their supplyvoltages or an external clamping diode and current limiting resistor can be used to provide the same,alternatively a simple voltage dividers can be used - (see SparkFun Sensor Interfacing Tutorial) again this willrely on the characteristics of the circuit and devices being used.

There are also some off the shelf IC bidirectional level converters available, although most appear to be for aset direction (all high to low or all low to high), for example:

1. HCF40109 - A single 16 pin DIP that can shift 4 lines in one direction.2. SN741VC425 - bidirectional (although all the same way) 8-way bus shifter.

Bidirectional Conversion

Bidirectional Level conversion is more complex, as either end of the line can be driving the circuit. There arealso some bidirectional IC level shifters available, for example the Maxim Range of level shifters lookinteresting but these don't yet appear to be very cheaply priced in small quantities.

The circuit below shows a bidirectional voltage shifter that first appeared in an Application Note by HermanSchutte at Philips. The technique is unique in that it uses a single MOSFET transistor, is bi-directional, andcan work with a fairly large range of voltages.

The resistors are only required if the lines are open-collector (not connected to GND or +V), which is not thecase on the 5V side if connected to an AVR output pin or an input pin with the internal pull up resistorenabled). But adding does no harm and allows the circuit to be used in other situations.

Page 3: conversor Mosfet 5V-3v3

Auto Refresh: Off refresh now

Below is a prototype soldered onto vero board, the power shift is electrically separate from the level shiftersallowing an external 3.3V to be used if available.

.

The soldered SMD components aren't pretty but usable until a PCB version is ready.

References

1. MCP1700 LDO Voltage Regulator datasheet2. MCP1700 Thermal issues.3. STMicroelectronics HCF40109B Quad Low-to-High shifter4. Maxim Range of level shifters5. D Holmes on level shifting6. MOSFET Bi-directional level shifter Application Note7. BSS138 MOSFET datasheet

15 Comments - Add yours hideSergei @ 13/8/2009 16:36:23 ReplyA small correction: "Maxim MCP1700 LDO Voltage Regulator" should be "Microchip MCP1700 LDOVoltage Regulator" (the link correctly points to the web site of Microchip).andrew @ 14/8/2009 5:55:12 in response to Sergei ReplyThanks - I've edited the main entryanon @ 12/3/2010 6:10:47 ReplyGreat stuff, thanks! The link to Herman Schutte's article doesn't work, the first result from Google does,though: http://ics.nxp.com/support/documents/interface/pdf/an97055.pdf Also, I think I've seen Maxim orsomeone selling an IC that actually only has a MOSFET and two resistors inside, in this specificconfiguration.andrew @ 13/3/2010 8:46:07 in response to anon ReplyThanks, looks like philips have moved everything under the NXP domain, I've edited the link. Maxim sell theMAX3370 single and MAX3372 double (http://www.maxim-ic.com/app-notes/index.mvp/id/3007), but theydon't appear to be widely available or cheap in small quantities.david @ 30/8/2010 16:53:48 ReplyIs this the same circuit as the Sparkfun Logic Level Converter (http://www.sparkfun.com/commerce/product_info.php?products_id=8745 )?andrew @ 31/8/2010 2:51:52 in response to david ReplyYes (ignoring Sparkfuns voltage convertor for the 5V->3.3V conversion) they're both from Herman Schutte's

Page 4: conversor Mosfet 5V-3v3

application note: http://www.semiconductors.philips.com/acrobat/applicationnotes/an97055.pdfRMR @ 14/4/2011 19:56:11 ReplyUnder the first appearance of "Unidirectional Level Conversion: Low-to-High" the paragraph begins with:"Connecting a 3.3V digital output pin to a 5V input pin..." Under the SECOND appearance of"Unidirectional Level Conversion: Low-to-High" the paragraph begins with: "Converting 5V to 3.3V is moreinteresting."andrew @ 15/4/2011 0:54:12 in response to RMR ReplyGood catch, I've updated the original postirving @ 8/3/2012 19:12:20 in response to andrew ReplyActually under the SECOND appearance of "Unidirectional Level Conversion: Low-to-High" I think it shouldbe "Unidirectional Level Conversion: HIGH-TO-LOW" so "5V to 3.3V is more interesting..." was rightandrew @ 9/3/2012 0:26:49 in response to irving ReplyIndeed, changed in the original, thanksRichard @ 11/7/2011 12:45:05 ReplyWhat through hole device could be used in place of the BSS138?Peter @ 2/10/2011 10:51:41 in response to Richard ReplyTry with BS170andru @ 19/5/2012 13:10:45 in response to Peter ReplyDid this work? I am looking at the 2N7000 - NTE491 as a through hole option.Reinis @ 23/5/2012 18:24:09 in response to andru ReplyIt works for me- I use two of them to interconnect between two MCUs, one running at 3.3V, the other oneat 5V through UART.japz87 @ 23/7/2012 16:16:14 ReplyHello everyone... has anybody used the MAX3013 or those others similar to the MAX3370, they are alsolevel translators that says to be bidirectional, but I don't get it clear if they are useful for an application like anI2C bus... I need to do the translation for six data lines so I was looking for an IC that packaged thisMOSFET interface for many lines... any idea will be very appreciated!... thanks!!

Tags/Categories: shifter, voltage conversion, 3.3V, 5V, AVR, regulator, LDO, MOSFET, MCP1700,howto

Previous: Xyloduino: Simple Arduino/piezo organ Next: Using SPI on an AVR (1)Contactandrew @ rocketnumbernine.com

Subscribe to RSSphatIOCheckout phatIO an IO device that looks like a USB filesystem

Set a pin to 5V by saving "1" to its control file, set it back to 0V by saving "0". Control LCD and LED displays by writing the data to display to a file. Communicate with TWI, and SPI and other devices by writing data to a file.

Page 5: conversor Mosfet 5V-3v3

Videos, reference and more at phatIOShare with others:

Tweet

Recent PostsphatIO Installing AVR GCC on OS X Automating Gerbers from Eagle SMT Table Top Reflow Oven (part 3): Final Build Programming the AD9851 DDS synthesizer Using the ICM7218 LED driver Decoding a Rotary Encoder External Time Capsule Fan SMT Table Top Reflow Oven (part 2): Controlling the Heater Elements Using SPI on an AVR (3) Using the MAX6675 Thermocouple-to-Digital Converter Bidirectional Level Converter PCB SMT Table Top Reflow Oven (part 1) Using SPI on an AVR (2) Review: The Saleae Logic Categories/TagsHowto, Projects, Reviews, Miscellaneous. arduino, seeeduino, servo, photoresistor, control, piezo, shifter, voltage conversion, 3.3V, 5V, AVR,regulator, LDO, MOSFET, SPI, Serial, MCP3201, DAC, at90usb162, atmega328, Saleae Logic, USB,DS1305, RTC, interrupts, SMT, soldering, reflow oven, MAX6675, MCP1700, master/slave,Thermocouple, relay, LED, AD9851, pcb, eagle, phatIO

0Like