Shop OBEX P1 Docs P2 Docs Learn Events
12V to Prop Interface Suggestions — Parallax Forums

12V to Prop Interface Suggestions

CharlieIICharlieII Posts: 70
edited 2008-07-15 03:26 in General Discussion
I realize that I am probably covering ground that is well trampled, but I'm hoping you all can direct me a little here.

I have a number of situations where I am going back and forth between the 3.3v of the Prop to 6, 12 or any other number of voltages in between. So far the only way I can think to use these voltages for inputs is to regulate the voltage to the device so that system voltage fluctuation doesn't effect it, and then use a resistor based voltage divider circuit to get down to the 3.3v that the Prop needs. Then use a pulldown (or pullup whichever the case may be) to maintain residual voltages.

Is this an acceptable way to get "back and forth" between the 3.3v of the Prop and the rest of the voltages in the world? Or is there a better way?

I'm just talking inputs at the moment. Driving higher voltage/higher amperage devices with an output would be another discussion for me.

smile.gif

Thanks.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-13 03:23
    You can use a voltage divider to reduce one voltage range to another. You have to be careful of the amounts of current involved so the voltage divider's current is small compared to the current available in the higher voltage circuit. An optocoupler is also a good way to do this.

    There's a whole long thread on interfacing the Prop's 3.3V logic to other voltages. Please read it (the 2nd thread in the "sticky" threads at the top of the forum thread list).
  • FranklinFranklin Posts: 4,747
    edited 2008-07-13 05:18
    Optoisolators would be another way.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • CharlieIICharlieII Posts: 70
    edited 2008-07-13 14:25
    I see the thread on Hardware in the Prop forum now. I'll go read through that now.

    Thanks.
  • CharlieIICharlieII Posts: 70
    edited 2008-07-13 18:32
    I searched Wikipedia, and a few links on optocouplers on google, but I need to know more about them. The concept is clear to me, but I have a few questions.

    Why isn't this kind of thing utilized more often? Are they expensive compared to common transistors?

    And I'm guessing you can get them in various configurations of acceptable voltages on the input and acceptable voltage/amperages on the output?

    I didn't see any for sale on the Parallax store.


    Why aren't optocouplers used in place of transistors more often? What am I missing? It seems like a relay that uses photons in stead of a mechanical device.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-13 19:28
    The cheap optocouplers are fairly slow although faster than relays. There are fast ones available, but they're relatively expensive. If you don't need the isolation, transistors are much smaller, much faster, much cheaper, and take a lot less current for a given current output. Optocouplers are not made for high current outputs although an optocoupler can certainly drive a high current transistor.
  • CharlieIICharlieII Posts: 70
    edited 2008-07-14 12:32
    Can you give me an example of a transistor that I could use here?

    I have a 12v control that outputs 12v on one of 4 wires depending on the control position while you cycle it by hand. What would be a good transistor to have that 12v power open the gate on with my 3.3v VDD being switched to an I/O pin of the Prop?

    Also, could I use a Zener to control the voltage with a large resistor just "upstream"?

    Thanks.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-14 12:52
    How much current do you have to supply at 12V?

    You could use a Zener diode, but an integrated regulator would be better. What's your supply voltage?
  • CharlieIICharlieII Posts: 70
    edited 2008-07-14 17:00
    Well the control goes 12v high on one of 4 wires depending on the stick location. So the current would just depend on the circuit that I design to bring that down to a propeller friendly 3.3v.

    With a large enough resistor I was thinking the current from the Zener could be relatively low. And I guess I could just use a 3.3v regulator on each of the 4 input wires to drop it down from 12v.

    I'm just wondering what would be considered an "appropriate" or usual method of getting a 12v signal into the Propeller without potentially causing issues by applying to much voltage to an input/output pin.

    After that I can figure out how to drive 12v circuits with an output pin.

    And thanks for the help. The more I read the more I understand. I just don't have any background in semiconductors.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-14 17:23
    The easiest way to have a Propeller check a 12V input is to use a voltage divider. You probably want a few mA of current to go through the divider. One suggestion would be to use a 3.3K resistor attached to the 12V input, then a 1K resistor between the other end of that and ground. The Propeller I/O pin is connected to the junction of the two resistors. That's 4.3K overall. With 12V, you'd have about 2.8mA of current through the divider. The Propeller would see 2.8V across the 1K resistor when 12V is applied to the voltage divider. This would be seen as a logic high.

    Post Edited (Mike Green) : 7/14/2008 5:32:10 PM GMT
  • CharlieIICharlieII Posts: 70
    edited 2008-07-14 20:56
    So the voltage divider isn't a bad way to do it then? That was my first thought, but I wasn't sure it was an acceptable way to do it.

    Would there be any reason not to increase the resistance of the first resistor so that you could run even lower amperage? Obviously a change to the pulldown resistance would have to accompany that. Or is around 3mA a good target amperage for something like this?

    Thanks.
  • CharlieIICharlieII Posts: 70
    edited 2008-07-15 01:47
    Also, I realized tonight that the servo signal wire is not a high current draw wire. There are seperate power and ground wires for that. (I am driving a servo with this particular device). But should I still place some kind of resistor, diode or anything on this wire to protect the Propeller?

    Thanks.


    BTW, I did a voltage divider for now. It seems to work fine although I'm going to tweak the resistance values some to get the amperage a little lower still. But regardless, it takes in the input and controls the servo accrately, so that is a sucess in itself.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-15 03:26
    It's usually a good idea to put a 1K resistor in series with the servo control signal line to the Propeller. It tends to dampen noise if the servo is any distance from the Propeller and it protects the Propeller from most wiring errors.
Sign In or Register to comment.