Resistors for preventing short circuiting

Discussion in 'Homework Help' started by wuz, Jul 13, 2011.

  1. wuz

    Thread Starter New Member

    Oct 4, 2010
    8
    0
    This may be a very stupid question and I apologise in advance.
    I find the following schematics (source:http://www.circuitdb.com). 220R are used between the micro pins RA0 - RA5 & the connector, supposedly to prevent accidental short circuiting.
    - I'm wondering when do you actually need these resistors? My guess is that these resistors are only used when the pins may be exposed to voltage higher than the micro rating (e.g. connectors that can be plugged into the wrong V)?
    - How do you decide the values of the resistors? Is it R = (Vmaximum possible) - V[micro rating]) / I[micro rating]? So to protect a 5V micro with 10mA single pin current rating may be connected to a 12V rail, R required = (12 - 5) / 0.01 = 700 Ohms?

    Thanks!
     
  2. Jony130

    AAC Fanatic!

    Feb 17, 2009
    3,957
    1,097
    The main job for this 220 Ohm resistor is to limit the base current for the BJT.
    And in the same time provide enough base current to ensure the BJT will be in saturation.
    You can not connect the BJT base directly to the output PIC output, without limiting the base current otherwise you'll burn the PIC and the BJT.
     
    wuz likes this.
  3. Georacer

    Moderator

    Nov 25, 2009
    5,142
    1,266
    What Jony said. You need an upper limit for your voltage. The value you are looking for is
    R=\frac{V_{out\-PIC}}{I_{base\-max}}

    You don't want to put anything much higher though.
     
    wuz likes this.
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    The 220R resistors going from the RA port are as you suspected a "belt and suspender" item, you don't absolutely need them, they may interfere with something else connected there, but they do provide a slight amount of protection from whatever unknown device you add onto that connector.

    I would suspect their value is based on using the same value as other resistors on the board.

    Generally, when you connect a 5V pin to a 12V source you are no longer looking at the pins drive (here, sink) capability, but the internal ESD protection diode typically found on most (not all) micro I/O pins. The current into that diode is a separate spec from the drive current spec.

    When the pin is either an input or outputting a high then you have (12-5 + diode drop) V on your resistor as you are driving the internal diode.

    When the output is being driven low you have the full 12V on it, and the current is the output sink current as you are driving the (low) output pin.
     
    wuz likes this.
  5. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    Your RA ports go to a connector "for limit switches, sensors etc." . This means these RA ports are configured as inputs referenced to ground. It doesn't look like if you are supposed to use sensors with higher voltages on this port (which you then could accidentally pass to the MC).

    In the PICs datasheet there is indicated 25mA absolute maximum current source or sink on a port pin.
    If for any reason, maybe at a reset/startup or something like this, the pin is configured as an output and you have the corresponding pin connected to ground via a NO switch for example, current will be limited to 23mA...
     
    wuz likes this.
  6. wuz

    Thread Starter New Member

    Oct 4, 2010
    8
    0
    Thanks for all the replies:)

    Jony130 & Georacer: I was referring to the 220R (connected to the connectors) on the RA ports not the RB ports.

    praondevou: I think I now understand the usage of 220R after reading your comment. I'm probably just repeating you here, but just want to confirm I fully understand the issue.
    These are meant for protecting the directly short between the PIC pins (when configured as a low impedance output pin) & the 5V/0V voltage rails. And the value of R needs to be > 5V / I [maximum sourcing / sinking current of the PIC]. So I guess it's good practice to have current limiting resistors whenever the I/O pins are directly routed to a connector going to a different board?
     
  7. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    Actually it depends on what you have on the other board, how far it is away, if it has to be protected against noise pick-up etc. The only thing I could imagine in your case was the one I described: Accidentally set a portA pin configured as output and having something (like a switch) connecting it to ground.
     
    wuz likes this.
  8. wuz

    Thread Starter New Member

    Oct 4, 2010
    8
    0
    Thanks very much for your help:)
     
Loading...