Is this a safe low speed logic level shifter?

17 views
Skip to first unread message

Trevor Law

unread,
May 11, 2013, 3:25:18 PM5/11/13
to maglab...@googlegroups.com

So I got some XBees for school project and was going to run with Atmega32u4 at 3.3V but then I remembered the LCD needs 5V and has a bunch of data lines for control (7).  Therefore for the 'receiver' node of my project i'm planning to use 5V for AtMega and LCD, but I will still need level shifting for the communication lines for the XBee.  I ordered some boards for this purpose but they will take awhile, and I would really like to have project done this weekend.  I attached a picture of what I would like to do in the interim for logic level shifting (voltage dividers).  For the 3.3V to 5V output line, the resistors are there for protection.  Provided the XBee output voltage is higher than the minimum Input High Voltage for the Atmega32u4, will this work, or is there something I'm not paying attention to?  I realize this will slow down the transitions since there are input capacitances, but I only need 9600 bps (Xbee default).  The actual RF data is even smaller, like 20 bytes/s.



CheapLevelShifter.jpg

Jacob Christ

unread,
May 11, 2013, 3:44:06 PM5/11/13
to maglab...@googlegroups.com

The divider to go from 5 in to 3.3 out will work but you can't boost 3.3 to 5v with just resistors.  The good news is you probably don't have too.  You can usually drive a 5v input with a 3.3v output.  Typically a valid logic 1 is around 1.5v.

The resistor values for the divider are wrong though.  Change the 1k to 3k and you will get 3v from 5v.

Jacob
If you have any questions you can give me a call.

On May 11, 2013 12:25 PM, "Trevor Law" <lawt...@gmail.com> wrote:

So I got some XBees for school project and was going to run with Atmega32u4 at 3.3V but then I remembered the LCD needs 5V and has a bunch of data lines for control (7).  Therefore for the 'receiver' node of my project i'm planning to use 5V for AtMega and LCD, but I will still need level shifting for the communication lines for the XBee.  I ordered some boards for this purpose but they will take awhile, and I would really like to have project done this weekend.  I attached a picture of what I would like to do in the interim for logic level shifting (voltage dividers).  For the 3.3V to 5V output line, the resistors are there for protection.  Provided the XBee output voltage is higher than the minimum Input High Voltage for the Atmega32u4, will this work, or is there something I'm not paying attention to?  I realize this will slow down the transitions since there are input capacitances, but I only need 9600 bps (Xbee default).  The actual RF data is even smaller, like 20 bytes/s.



--
You received this message because you are subscribed to the Google Groups "MAGLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maglaborator...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Mark R

unread,
May 11, 2013, 3:46:28 PM5/11/13
to maglab...@googlegroups.com
this will work for the 5v out side but not for the 3.3v out. You need a transistor to change 3.3v to 5v logic. See http://www.adafruit.com/products/757 for a product and  http://www.adafruit.com/datasheets/BSS138.pdf for an explanation.

Trevor Law

unread,
May 11, 2013, 3:58:52 PM5/11/13
to maglab...@googlegroups.com
yeah i just noticed wrong direction need to flip around resistors,
5*(2/(1+2)) = 3.33V

But yeah I checked the logic levels per datasheets (shown in the image) ok

Reggie Dablo

unread,
May 12, 2013, 4:19:05 AM5/12/13
to maglab...@googlegroups.com
how about this bi-directional logic level converter from Sparkfun: logic level converter.


On Saturday, May 11, 2013 12:25:18 PM UTC-7, Trevor Law wrote:

Trevor Law

unread,
May 12, 2013, 4:22:52 AM5/12/13
to maglab...@googlegroups.com
What I got seems to work fine, I can communicate with xbee with
virtual serial port from 5v teensy. now i just have to get the xbee
to work :-/

Trevor Law

unread,
May 12, 2013, 5:01:38 PM5/12/13
to maglab...@googlegroups.com
Xbee success.


On Saturday, May 11, 2013 12:25:18 PM UTC-7, Trevor Law wrote:
Reply all
Reply to author
Forward
0 new messages