Shop OBEX P1 Docs P2 Docs Learn Events
+/- 12V Input — Parallax Forums

+/- 12V Input

hippyhippy Posts: 1,981
edited 2007-09-11 21:12 in Propeller 1
The PICmicro and others can tolerate connection of high voltages to input pins providing the signal is current limited; is this the same for the Propeller or is it a "do not do it" ? Having only just got my Propeller hardware I'd prefer to not destroy it in the first few days.

For example, +/-12V through a 47K would be just 260uA if the 47K were dropping the entire voltage. I'd have no problem going to a higher R as long as it worked.

I've read the "5V interfacing" sticky, but there wasn't anything I saw which really said how far the input voltage could be pushed at low current. I could buffer the signal through a 74HCxx which I know does work for other micros, but it seems over-kill if a single resistor will do the job.

Comments

  • rjo_rjo_ Posts: 1,825
    edited 2007-09-09 04:29
    At the end of the day...you are going to want it isolated as much as possible. That always seems to be the answer.
    I don't know why... but these discussions always seem to vector toward that common answer.
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-09-09 05:02
    Hippy,

    There's nothing more to it than good old Ohm's law.

    As long as your resistor limits current to acceptable values, you will be fine.

    The Prop has no idea if you input 1, 10 or 100 volts as long as the resistor drops it. As you increase the voltage, you will find that power dissipation in the resistor becomes an issue. I am currently inputting an "unknown" voltage to a couple of pins. This voltage may be up to a few hundred hundred volts and I need to find out how many times per second it goes to zero V (it is about counting breakdowns in a thin layer of insulating liquid).

    For this, I use a 100 kohm series resistor. At 300 V, the power dissipation is 900 mW, so I have put in 3 times 33 kohm to keep temperature down (the tiny resistors can only take a few hundred milliwatts). It also helps keep flash-over voltage up (it is usually around 250 V for 1/2 W resistors).

    Why not 1 Mohm? Simply because the low-pass filter created from 1 Mohm and the pin and stray capacitance (about 10 pF) cuts off fast pulses. At 100 kohm, the corner frequency is around 150 kHz. With 1 Mohm, it would be 15 kHz, which would make the counting very unreliable.

    The Prop and its counters are just perfect for this application. As it is for any application I have seen so far.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • rjo_rjo_ Posts: 1,825
    edited 2007-09-09 05:11
    sorry to be so negative... but just when you think you got it all covered... isolated inductive and capacitance will get in your way.
    Isolate everything... and keep it all as far apart as the design will allow... keep your big stinking wires co-axial with the pins;>)

    Rich
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-09-09 05:28
    I can understand your concern rjo_. But there is a difference between myths and engineering reality.

    I have been doing this since dawn of time (when the 4004 appeared).

    I have done consumer goods where we connect the micro (no, not the 4004!) directly to the mains with a series capacitor, a diode and a zener/electrolytic for power supply, not even knowing if Vss was at hot or neutral wire. And connecting micro output directly to the triac gate. Of course, you have to be careful and know about electricity. But the question was about how much voltage an input pin can take if there is a series resistor. The answer is; unlimited, as long as the resistor is properly sized.

    And +/- 12 V is not a problem in any case.

    The SELV (Safe Extra Low Voltage) limit is 50 volts. If you go beyond that, you need to contact a certified electrician. I do not need to, since I am a registered EE.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-09 07:57
    Skogsgurra put it very well, especially the often ignored low-pass effect of series resistors!
    As I am drawing pictures for my afternoon class next week anyhow, I can as well post it here. I think Skogsgurra's explainations could become even more obvious - if that would be possible.

    BTW: I am not so confident with high negative voltage...
    440 x 440 - 19K
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-09-09 08:04
    Thanks deSilva (BTW, my wife collects ash-trays, little sculptures, post-cards and such things with the Hamburger Rathaus on it. She is perfectly normal in every other sense).

    There are substrate diodes from input to Vss as well. That takes care of the negative part.



    Edit: I found this paper. http://www.csit-sun.pub.ro/courses/vlsi/Carte_VLSI/bookch14.pdf·Have a look at pictures on page 14-15. It shows very well what is happening. Although at GHz speed. Not that the Prop is far behind...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Skogsgurra) : 9/9/2007 8:37:01 AM GMT
  • hippyhippy Posts: 1,981
    edited 2007-09-09 11:15
    @ Skogsgurra : It is good to hear from someone who has done it and can report 'the world did not end'. 300V via 100K is 3mA, and I'm looking at less than that. This will be a static / slow-speed signal so capacitance will not be a problem. Thanks.

    @ rjo_ : I appreciate you comments and especially from a 'solid engineering' perspective. In an ideal world, or when advising others, I would also take the "do it properly" approach. For home-hobby use I'm prepared to take quick and dirty as long as it comes with acceptable risk.
  • hippyhippy Posts: 1,981
    edited 2007-09-09 14:45
    Putting on my 'bold as brass' T-Shirt, I took the leap of faith and it all worked okay for me. The circuit I used is shown in the attachment -
  • hippyhippy Posts: 1,981
    edited 2007-09-09 16:22
    Skogsgurra said...
    As long as your resistor limits current to acceptable values, you will be fine.
    Probably worth noting that the Propeller Preliminary Datasheet ( www.parallax.com/dl/docs/prod/prop/PropellerDSv0.3.pdf ) specifies that as "Max. DC current into an input pin with internal protection diode forward biased +/-500uA"
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-09-09 16:51
    So I am guessing the concern for +/-12v is to directly connect reception to conventionally driven RS232 lines.

    Is that right?

    I cannot seem to think of another reason to use a higher than +5volts or a need to run both the plus and the minus.

    Are their other uses, like samplling an audio input?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-09-09 17:01
    One thing to factor into the design is the chance for shorts or component failure. Two resistors in series is cheap insurance. For a few pennies more, Schottky diodes to Vdd and Vss will take any remaining load off the Propeller's input diodes.

    -Phil
  • hippyhippy Posts: 1,981
    edited 2007-09-09 17:31
    @ Kramer : +/-12V is convenient for direct coupled RS232, but also for automotive interfacing ( where I am aware that a lot more filtering and robustness is needed ), and in battery charging applications, especially where reverse connection may need to be determined. It's also handy, as Skogsgurra notes, for direct mains interfacing ( zero-crossover detection ) plus any interfacing to an incoming voltage which is above the 3.3V level.

    @ Phil Pilgrim (PhiPi) : Agreed; for a more robust solution I'd go with both. For hobby-home use I'd personally consider such failure to fall under acceptable risk, except for mains and higher voltage interfacing.

    My primary, but not only, interest was indeed direct RS232 interfacing, but I wanted to avoid explicitly saying that because I've seen too many discussions elsewhere quickly collapse into "use a MAX232, they are only a few dollars" and then off at a tangent for alternative transistor interfaces etc, and the "can I or can't I, if I'm prepared to take the risks" question rarely gets satisfactorily answered.

    What's recommended for a robust, well designed, commercial product is not necessarily what a hobby-home user wants or even needs. "A few dollars" can equate to many dollars for people who do not have component stock rooms and have to buy one offs as and when needed. That's not to say that I think "doing it properly" is wrong or unnecessary, or even that kludging it is recommended. Everything gets designed to a criteria, and every circuit builder has to decide their criteria.
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-09-09 19:05
    Yes Hippy,

    I noticed that +/- 500 uA limit. It is (at least to me) a very conservative limit. I am used to a lot more in CMOS circuits.

    It is not a question of thermal load (500 uA does not produce more than 300 - 400 uW in the diode). Instead it is about the risk of turning on parasitic thyristors that exist in the silicon. Once turned on, they short the power supply and develop a lot of heat that destroys the chip.

    Question for Parallax: Is the +/- 500 uA limit a "prudent" limit? Or is the Propeller able to sink, let's say, 5 mA through its diodes without turning that SCR on? I mean, if it can take an 8 kV Human Model discharge, it should laugh at 5 mA. (Yes, I am aware of the time scales involved)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-09-11 17:52
    The 500uA is a conservative limit, comprehensive MTBF tests are very time consuming (therefore expensive), Since interfacing with higher steady state voltages is not the primary reason for their inclusion (they are for ESD), the max allowable S-S current is set so that the ESD function is preserved and no significant die heating occurs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-09-11 21:12
    Thanks Paul. That is what I thought.

    I have done some teasting in practical applications. Three mA seems to be OK so far. I have since been using higher resistance values, but then I need to compensate with around 5 pF to keep frequency response up. The Prop is fast - never needed to compensate resistors in a microprocessor application before smile.gif love it!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sign In or Register to comment.