Shop OBEX P1 Docs P2 Docs Learn Events
Voltage Divider as 3.3v -> 5v converter — Parallax Forums

Voltage Divider as 3.3v -> 5v converter

SRLMSRLM Posts: 5,045
edited 2013-07-18 13:14 in Propeller 1
I'm trying to interface to a device that has the following specifications:

Voltage Low Maximum 1.25v
Voltage High Minimum 3.25v

I know I should use some sort of IC, but I don't have that with me. I just want something quick and dirty, so I came up with the following voltage divider:
5v
 |
 \
 /   3.3kOhm
 \
 /
 |
 O----- Output
 |
 \
 /   560Ohm
 \
 /
 |
 |
 Prop I/O

With this circuit I calculate the output voltages as
Low: 0.72v
High: 3.54v

Is there anything about this circuit that wouldn't work?

If it matters, I'm trying to interface to a VNH2SP30 motor driver.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-07-18 09:14
    I would just use a 20K or higher pullup to 5V on the Propeller output pin. The VNH2SP30 draws only a couple of uA and the protective diode on the Propeller would draw under 100uA. The pullup would ensure that the VNH2SP30 pin is drawn up to 3.9V (3.3V + 0.6V for the protective diode) and the Propeller could pull down the VNH2SP30 pin to 0.6V
  • SRLMSRLM Posts: 5,045
    edited 2013-07-18 10:33
    Thanks. That's much simpler than my solution.

    Hmmm. Your answer makes me think of a very similar solution: use the pullup and the I/O pin set to input to output 5v, and set the I/O pin to output 0 for a low output. That won't work in my case (I want the code to be compatible), but it's something to keep in mind.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-07-18 10:47
    Your similar solution is actually the best one. When the I/O pin is output high, its voltage is actually more like 3.0V (3.3V - 0.3V). The pullup won't pull this up significantly. You do need to switch between input and output low. Your original voltage divider will work better when switching between output high and output low.
  • RaymanRayman Posts: 14,662
    edited 2013-07-18 10:55
    I'm not seeing why you can't just use a Prop I/O pin directly.... 3.3 is bigger than 3.25 and 0 is less than 1.25... What am I missing?
  • SRLMSRLM Posts: 5,045
    edited 2013-07-18 11:43
    Rayman wrote: »
    I'm not seeing why you can't just use a Prop I/O pin directly.... 3.3 is bigger than 3.25 and 0 is less than 1.25... What am I missing?

    I don't want to go that route because 0.05v is too close of a margin for me. On the Quickstart board that I'm using, for example, the 3.3v rail is 3.275v and the 5v rail is 4.71v. I don't want to be worrying about a bug's root cause being not enough voltage on the I/O pin.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-07-18 12:49
    You can always use a transistor inverter as an open-collector driver, pulled up to +5V.

    -Phil
  • RaymanRayman Posts: 14,662
    edited 2013-07-18 12:52
    Ok, I see now, you're worried about the .05 V margin. Still, I'd guess they made it 3.25 very intentionally so that it could be used in 3.3 V systems.
  • jmgjmg Posts: 15,173
    edited 2013-07-18 13:14
    SRLM wrote: »
    That won't work in my case (I want the code to be compatible), but it's something to keep in mind.

    If you want margin, and CMOS drive, another way is to use a diode to replace the bottom resistor. (slow, power spec, or reverse zener)
    This simply adds ~ 500mV to Vo, so gives >> 0.05v margin, and the high diode capacitance, ensures a faster switching time.
    Use the largest pullup value you can.
Sign In or Register to comment.