How would you do this?


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: How would you do this?

    I said I would remain silent, but I can't now.

    A couple of things:

    Lower value resistors increase noise immunity. Others may use dividers with 50K Thevenin equivalents, but it is generally better to have somewhat lower impedance unless you have really high voltages, or are powered with a battery. A 10K (total) resistance across 12V will dissipate 14mW and will draw 1.2mA. No big deal.

    PIC *INPUT* pins are good for 20mA (at least that is what my 18F8723 datasheet says). That means that you can connect a 1K resistor from 12V directly to a PIC input pin with no damage. The input will clamp at 5.5V. 12V - 5.5V = 6.5V/1K = 6.5mA = NO DAMAGE. You don't need zeners, diodes, anything. You should, however put a cap (.1 or so) across the input pin to GND. An extremely fast high voltage (spark) can drive the input above the breakdown voltage before the input clamp diode has a chance to conduct. The capacitor slows down the risetime to a safe value.

    That 1K resistor directly to the input pin will be fine unless the applied voltage is sustained for more than a few mSec at 25V or higher. Change that resistor to 10K and you will be able to tolerate 200V continuously (of course, the resistor would need to be a 5W type).


    This is not "chip abuse". This is according to the datasheet.

    Some other things (probably more important in your case) are whether or not inputs will be present when the PIC has no Vcc. A 1K resistor to 12V will be able to supply enough current to power the PIC through its body diodes. In fact, if there is very little load on Vcc, that 1K resistor to 12V will drive Vcc to above 10V, since the current will flow from 12V through the resistor through the body diode and into Vcc. A lot of people (me included) have found that their circuits did not RESET properly on startup only to find that when shut off, the PIC still had significant voltage on it. The PIC was being powered through its input pins by a circuit that still had power when the PIC was supposedly shut off.

    If the inputs will have power when the PIC does not, use optos or transistors on the inputs, otherwise, resistors will work fine.
    Charles Linquist

  2. #2
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: How would you do this?

    I said I would remain silent
    We would have all lost if you had. Thank you for this post
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  3. #3
    Join Date
    Jan 2010
    Posts
    88


    Did you find this post helpful? Yes | No

    Default Re: How would you do this?

    I want to thank everyone for their help on explaining a few things. There are a lot of things to consider when putting circuits in these types of environments and some of us have more experience than others, so I'm sure I speak for most of us when I say that I appreciate everyone's input especially when someone is sharing their trial and errors with the rest of us. I hope Charles didn't take my questions as questioning his formulation. I am merely trying to understand and also make sure that I am clearly describing what I am trying to do.

    With that said, I'd like to share what I have found myself about what I was asking to do. This setup can obviously be modified to do what you need it to do, but this is something that works for my application, so I'd like to share it with you.

    The red input is what activates the routine. The pic is already running and pin 5 is pulled low. Pin 5 sees 5 volts through the zener when 12 volts is applied to the red input. When the positive input goes high with 12 volts, the transistor is turned on and diverts the 12 volts from the red wire to ground so pin 5 sees nothing and is pulled low again.

    The circuit on the right is a negative trigger. Pin 4 sees 12 volts through the two resistors above. When ground is applied to the negative input, pin 4 is pulled low to trigger another routine on the pic.

    My question is this though, why the RC parallel filter? I know I can simply use the same setup, but I'd like to understand what value this has. I know the cap is for smoothing out the input to prevent the pic from seeing multiple inputs when there is only one (debouncing), but what's the parallel resistor for? I see how it's part of a voltage divider on the right side circuit, but what about on the left side? Is that just to discharge the cap?

    Thanks,
    Tony

    Name:  triggers.gif
Views: 4401
Size:  8.9 KB
    Last edited by ERMEGM; - 8th October 2011 at 03:10.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts