Shop OBEX P1 Docs P2 Docs Learn Events
Inputs above 3,3v - what do you prefer? Pull-down or limit current? — Parallax Forums

Inputs above 3,3v - what do you prefer? Pull-down or limit current?

Alex.StanfieldAlex.Stanfield Posts: 198
edited 2013-05-30 07:39 in Propeller 1
I have the following circuit which I must power above 3,3v (because the Allegro A1104 and the Melexis MLX90217 do require power above 3,3v)

attachment.php?attachmentid=101923&d=1369760583&thumb=1


So the question is: What do you prefer in order to avoid frying the propeller?

1 - Limit it's input current (square box) (as stated in "AN010: Low-cost Bidirectional Mixed-voltage Interfacing" http://www.parallaxsemiconductor.com/an010 )
2 - Also pulling down the input (R gnd) and avoiding (almost) any current into the Propeller
3 - Something else (plesase describe)

Thanks in advance.
Alex
1024 x 571 - 42K

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-05-28 10:21
    I've almost exclusively used the current-limiting approach.

    -Phil
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-05-28 13:51
    Put a 3.9KΩ current limiting resister on the inputs of the Prop.
    This will keep the current through the Props input protection diode to less than 0.5mA.

    BTW, 3.9KΩ is the minimum value safe resistor in your circuit.
    However, there will be a small amount of current, about 0.35mA, through the LED.
    The resistor could be quite a bit higher in value, say 10KΩ to 100KΩ, depending on the rate of the pulses.
    This causes even less idle current to flow through the LEDs.
    That's all.

    Duane J
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-05-29 01:37
    The minimum voltage drop through an LED is 1.6V and you only have to current limit anything that's at least 300mV above the supply so it doesn't matter since the A1104 is open drain and the maximum voltage on the output will be 3.4V. Red LEDs turn on sharply at 1.6V and with a bit of current will exhibit a 1.8V drop. Other colors drop more voltage (other than IR that is). Knowing this you can drive LEDs that are tied to 5V directly which is what I do since this lessens the load on the 3.3V regulator.

    In general a current-limit resistor is all you need but I have seen Props having trouble programming because during reset the current consumption drops to a very low value and current can flow from the input pin to the VDD supply pushing it up and somehow affecting the reset or programming operation.
  • MicksterMickster Posts: 2,694
    edited 2013-05-29 05:43
    Funny this should come up as I was just contemplating feeding my 24v optical encoder outputs directly to the Prop pins via current-limiting resistors instead of using opto-couplers, etc. This is a relatively low-frequency application (1KHz) so I guess 100K resistors should be okay.

    Regards,

    Mickster
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-05-29 06:05
    Mickster wrote: »
    Funny this should come up as I was just contemplating feeding my 24v optical encoder outputs directly to the Prop pins via current-limiting resistors instead of using opto-couplers, etc. This is a relatively low-frequency application (1KHz) so I guess 100K resistors should be okay.

    Regards,

    Mickster

    Well once you allow for a resistor you can make it any value from zero upwards and 100K is more than fine for 100kHz signals even. If you want to minimize the RC delay effect just place the resistors as close to the Prop pin as practical. Since the external 24V signal ground will have to be connected to the Prop signal ground then just make sure that this connection is not made "through the Prop" but goes to the Prop's power supply ground from which the Prop then derives it's ground. This is usually the reason why Props get destroyed because of excessive ground currents due to bad signal grounding practices and sometimes just poor layouts, especially spaghetti breadboards.
  • MicksterMickster Posts: 2,694
    edited 2013-05-29 06:27
    Well once you allow for a resistor you can make it any value from zero upwards and 100K is more than fine for 100kHz signals even. If you want to minimize the RC delay effect just place the resistors as close to the Prop pin as practical. Since the external 24V signal ground will have to be connected to the Prop signal ground then just make sure that this connection is not made "through the Prop" but goes to the Prop's power supply ground from which the Prop then derives it's ground. This is usually the reason why Props get destroyed because of excessive ground currents due to bad signal grounding practices and sometimes just poor layouts, especially spaghetti breadboards.

    Thank you for the input.

    Regards,

    Mickster
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-05-29 15:41
    Hi Peter;
    Well once you allow for a resistor you can make it any value from zero upwards and 100K is more than fine for 100kHz signals even.
    That's not true!!! Don't do 0.0Ω!!!
    Alex's diagram shows he is using a power supply of 6.5V.
    A zero Ω pin input resister along with a RED LED and 1KΩ ballast resistor could send as much as 1.1mA of current through the Prop's protection diode which is clearly higher than the spec limit of 0.5mA.
    (6.5V - 1.5V - 0.6V - 3.3V) / 1KΩ = 1.1mA

    That was why I suggested a minimum of 3.9KΩ in addition to the LED and 1KΩ.
    (6.5V - 1.5V - 0.6V - 3.3V) / (1KΩ + 3.9KΩ) = 0.22mA with the Prop running on 3.3V

    I would prefer to to do the calculation a bit more conservatively:
    7V supply, 1.4V LED, 2.8V on the Prop
    (7.0V - 1.4V - 0.6V - 2.8V) / (1KΩ + 3.9KΩ) = 0.46mA, still legal.
    So 3.9KΩ would be the lowest safe value assuming the Prop is powered up simultaneously with the 6.5V supply.

    If the Prop is powered down then the pin resister should be a minimum of 9.1KΩ:
    (7.0V - 1.4V - 0.6V - 0.0V) / (1KΩ + 9.1KΩ) = 0.49mA, and legal with a powered down Prop

    Duane J
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-05-29 18:48
    Hi Peter;
    That's not true!!! Don't do 0.0Ω!!!
    Alex's diagram shows he is using a power supply of 6.5V.
    A zero Ω pin input resister along with a RED LED and 1KΩ ballast resistor could send as much as 1.1mA of current through the Prop's protection diode which is clearly higher than the spec limit of 0.5mA.
    (6.5V - 1.5V - 0.6V - 3.3V) / 1KΩ = 1.1mA

    That was why I suggested a minimum of 3.9KΩ in addition to the LED and 1KΩ.
    (6.5V - 1.5V - 0.6V - 3.3V) / (1KΩ + 3.9KΩ) = 0.22mA with the Prop running on 3.3V

    I would prefer to to do the calculation a bit more conservatively:
    7V supply, 1.4V LED, 2.8V on the Prop
    (7.0V - 1.4V - 0.6V - 2.8V) / (1KΩ + 3.9KΩ) = 0.46mA, still legal.
    So 3.9KΩ would be the lowest safe value assuming the Prop is powered up simultaneously with the 6.5V supply.

    If the Prop is powered down then the pin resister should be a minimum of 9.1KΩ:
    (7.0V - 1.4V - 0.6V - 0.0V) / (1KΩ + 9.1KΩ) = 0.49mA, and legal with a powered down Prop

    Duane J

    Doh, I saw VCC but didn't see the VCC=6.5V text which IMO should be right next to the VCC symbol anyway. The point about "zero" ohms is really a general tip and just saying that once you have allowed for a resistor then it becomes a simple matter of changing it's value rather than trying to put one in afterwards. In this application the 3.9K would be required and I'd probably just use 100K as there are no high-speed signals plus a 3.9K would probably still let the LEDs glow as around 300ua+ is enough to make it look as if the LED is on (unless the LED is some really old junk box 3mcd part).
  • Alex.StanfieldAlex.Stanfield Posts: 198
    edited 2013-05-29 19:32
    Thanks everyone for the tips. To summarize what I have learned so far:
    • Use AN010 as a design guide for limiting the input current
    • Don't forget to check the calcs for an un-powered prop!
    • Beware of possible programming problems (you might want to disconnect your high voltage inputs during programming...)
    • Pay special attention to your ground returns which should NOT go "through the Prop"
    And now to explain a little more my circuit
    • The reason I'm using 6.5V as Vcc instead of 5V is that I wanted to unload as much as possible the 5V and 3,3V LDO regulators from the Propeller Protoboard
    • LEDs are ~3v types
    • LEDs can be hooked on for debugging or totally disconnected (J1 jumper on the schematic), so the inputs get tied to Vcc through the 10K resistors (R5.4)
    Alex
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-05-29 20:49
    You need the LEDs in circuit for the pullup as the sensors are open-drain, that is they do not source any current. If you do want to disable the LEDs then add a pullup resistor to the signal which in this case can be to 3.3V. If your LEDs are "3V" then theoretically you probably would not even need any current limiting in this circuit although I would still include it. For the protoboard setup you mentioned I don't think the few extra milliamps for these LEDs would amount to any extra load on the 5V supply anyway and they could in reality just be connected this way without any "protection" - KISS.

    In general limit the current flow into each pin to an absolute minimum which is an easy thing to do with most signals so just use 100K as a standard value and only reduce this if needed for high-speed signals.
  • Alex.StanfieldAlex.Stanfield Posts: 198
    edited 2013-05-30 07:39
    You need the LEDs in circuit for the pullup as the sensors are open-drain, that is they do not source any current.
    Yes they will draw current, typically two of them (4 in total on the device) will be ON almost 24hs/day.
    If you do want to disable the LEDs then add a pullup resistor to the signal which in this case can be to 3.3V.
    The resistors are there (R5.4) but tied to Vcc for layout reasons (granted they could be tied to Vdd but that would requiere more complex wiring.
    If your LEDs are "3V" then theoretically you probably would not even need any current limiting in this circuit although I would still include it. For the protoboard setup you mentioned I don't think the few extra milliamps for these LEDs would amount to any extra load on the 5V supply anyway and they could in reality just be connected this way without any "protection" - KISS.

    In general limit the current flow into each pin to an absolute minimum which is an easy thing to do with most signals so just use 100K as a standard value and only reduce this if needed for high-speed signals.
    Agreed, KISS is my motto but I became a little more paranoid here because these inputs come from outside the board so just in case I'm leaving the 100K resistors for every input coming from from outside.
    The other reason I forgot to mention before for unloading the LDOs as much as possible is that the device is always on and will be subject to high ambient temperature (case surface exposed to direct sunlight which due to design constrains can reach well above 40° in the summer). I also have a hungry Xbee on board generating some heat among the switching PSUs. In general I tried to minimize every possible heat source so moving the sensor's supply to the switching PSU instead of the LDO seemed the right thing to do along with being able to disconnect the LEDs when not needed.

    Alex
Sign In or Register to comment.