Shop OBEX P1 Docs P2 Docs Learn Events
Ping resistor — Parallax Forums

Ping resistor

PatrickS1981PatrickS1981 Posts: 17
edited 2011-12-06 14:41 in Propeller 1
Hi

Just a question. Im new in electronics, so probably I'm making a calculation error. In the documentation of the ping object it is stated (depends on version) to use a 1K ohm or 3.3K ohm resistor. But when I'm calculating the needed resistor R=V/I I need
- A volt drop of 5-3.3=1.7V
- It uses 0.02Amp

So that would lead me to 1.7/0.02=85Ohm.

What is the reason to use a much higher resistor?

Patrick

Comments

  • Martin_HMartin_H Posts: 4,051
    edited 2011-12-06 05:47
    Resistors limit current that flows through them. The voltage that drops across them really depends what comes next in the circuit. The issue of what resistance value to use for 5 volt to prop inputs has been discussed a fair bit on the forum. Here's one that I started:

    http://forums.parallax.com/showthread.php?133557-Is-the-Propeller-Chip-compatible-with-the-Max232-level-shift-IC&p=1024497#post1024497

    But the tl;dr for that whole thread is this quote from Phil Pilgram:
    Martin,

    If you use the MAX232, use at least 2.2K and, preferably, 3.3K series resistors. The reason is that the Propeller's input protection diodes are only rated to 500uA. (5V - (3.3V + 0.6V)) / 500uA = 2.2K. That's with the full 0.6V forward voltage drop of the diode. At only 500uA, it may not be that high. If the voltage drop were zero, the formula would be (5V - 3.3V) / 500uA = 3.4K.

    -Phil
  • JonnyMacJonnyMac Posts: 9,198
    edited 2011-12-06 06:55
    Assuming just a series resistor into the pin... the voltage across your resistor, no matter what size, will be 5 - 3.6 (3.3 + 0.3 for the protection diode) = 1.4v. If you limit the current through the protection diode to 500ua (section 7.1 of data sheet), you get

    1.4 / 0.0005 = 2.8K

    I tend to use 3.3K as it's the next standard value, but 4.7K is fine, too; as Martin points out you're just limiting current into the pin, you haven't changed the "high" level seen by the Propeller.
  • PatrickS1981PatrickS1981 Posts: 17
    edited 2011-12-06 08:49
    Thanks. I see now where I made my mistake. I took the Amp's from the ping sensor, not the amps from the input pin of the prop.
  • pedwardpedward Posts: 1,642
    edited 2011-12-06 14:08
    This is really useful information, wrapped up in something else. Is there any place that clearly states: "To make the Propeller 5v tolerant on inputs, use a 3.3k resistor, and this is why..."?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-12-06 14:19
    Yes and no. There's this thread, but it was started before the Propeller chip was fully characterized and contains some bad advice (e.g. 1K series resistors).

    -Phil
  • pedwardpedward Posts: 1,642
    edited 2011-12-06 14:41
    Seems like something useful for the kickstart wiki? Or is that too formalized, it would be information overload?

    It would be nice if there was a Wiki for the Propeller where the forum morsels could be documented. Then I'd have something to link to for my Wikipedia updates! :lol:

    Damn bastards at Wikipedia don't allow original content, it must all be borrowed from somewhere else!
Sign In or Register to comment.