Levelshifting with voltage regulator

Hi!

I'm just got my XBees and had a lot of fun already. But I didn'tlike the feeling of just ignoring the 3v3 logik level and connecting it straight to the Arduino. Out there in the internet exist 1000 ways of levelshifting and I don't know which to use. I have some AMS1117 3v3 voltage regulators lying around. Could that work? I also found some ways just using 2 resistors. What is the disadvantage of these methods? They seem a lot easier than buying level shifting chips.

Thanks!

I have some AMS1117 3v3 voltage regulators lying around. Could that work?

No they are not stable when used as a rapid voltage switch. Resistors can be used but this slows down the edges of the signal and that can lead to trouble especially at higher frequencies. I use open collector buffers like the 74LS07.

I would go with Rob Faludi's recommendation to use resistor+diode to level shift.

http://www.faludi.com/bwsn/xbee-level-shifting/

Personally, I don't think you will have problems with using voltage dividers to do level-shifting, as long as the resistors are not too large [eg, under 5K], and as long as the wires connecting the Arduino and XBee devices are short [eg, under 6 inches].

BTW, Faludi's "book", as opposed to the info shown on his website, as ALL wrong.

In the book, he has no level-shifting at all, and all the figures show the XBee i/o pins connected straight to Arduino 5V lines, but at least he mentions the XBee must be run off 3.3V and not 5V.

Also, at least 1 figure in the book has RX and TX connected backwards.

http://www.digi.com/support/kbase/kbaseresultdetl?id=2160

Direct statement from Digi "To be clear, the inputs to the XBee module are NOT 5V tolerant and cannot accept a voltage level higher than 3.3v on any pin."

why risk it if you can avoid any problems by adding a few cents worth of resistors and diodes?

perhaps Faludi realizes the need for level shifting hence he wrote the article in his website.

One wonders how Faludi overlooked that in his book. At least he has good info on his website.

Thanks for your replies. I'm going to use the faludi idea with the two resistors and three diodes.

A general question: How do I choose the correct diode? Or probably I have to say it differently: Can a diode be oversized? Of course I'm not talking about a 10K volt diode in a 3v3 Arduino sketch, but what about 50V 1A in this very application?

The ready-made level shifters from Sparkfun are not that expensive and provide additional protection if you are overly cautious type.

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

Or use one the TXB010x chips, eg the TXB0102 to convert 2 signals, TXB0104 for 4 signals. Much neater than a handful of discrete components.


Rob

A general question: How do I choose the correct diode? Or probably I have to say it differently: Can a diode be oversized? Of course I'm not talking about a 10K volt diode in a 3v3 Arduino sketch, but what about 50V 1A in this very application?

1N4148/1N914 small signal diodes should work fine, although one of the comments on the Faludi site talks about using Schottky. Looking again at the webpage, I would rather use a simple voltage divider to go from 5V down to 3.3V inputs. Then you don't need the clamping diode.

2.4K series and 4.7K to gnd. You'll notice that this combination has an effective source- resistance of 2.4K || 4.7K = just 1.6K, which greatly reduces rise-time problems versus using 10K in Faludi's clamp ckt.