Controlling switches with a PIC


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    Thanks for the help, I appreciate it.

    Would the 2n2222 work for my application? (i.e. just pulling a 5V wire to ground?) Which transistor would you recommend?

    Thanks again,

    TOny
    Last edited by TonyA; - 4th March 2008 at 21:17.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by TonyA View Post
    Thanks for the help, I appreciate it.

    Would the 2n2222 work for my application? (i.e. just pulling a 5V wire to ground?) Which transistor would you recommend?

    Thanks again,

    TOny
    Use the 2N2222. As long as you aren't pulling a zillion amps thru it, you'll be fine.
    Just make sure you read and understand how to do so...

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by TonyA View Post
    (i.e. just pulling a 5V wire to ground?) Which transistor would you recommend?
    None!

    Just use the Tri-State output of the PIC.

    Code:
    PORTB.0 = 0   ; Pin goes to gnd when not Tri-Stated
    
    TRISB.0 = 0   ; Output to Ground
    ;....
    TRISB.0 = 1   ; Output Tri-Stated
    Added:
    If there's any possibility that the external 5V is higher than the PIC's 5V?
    Use PORTA.4 instead. It doesn't have the VDD voltage limit.<br>
    Last edited by Darrel Taylor; - 4th March 2008 at 22:04. Reason: RA4
    DT

  4. #4
    Join Date
    Apr 2006
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    Darrel, and FalingTrea thanks. I was wondering about that. Thanks again.

    Tony
    Last edited by TonyA; - 5th March 2008 at 00:06.

Similar Threads

  1. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  2. Controlling stepper motor with PIC
    By The Master in forum Off Topic
    Replies: 3
    Last Post: - 1st July 2008, 10:21
  3. Controlling power to a PIC with another PIC
    By jswayze in forum Off Topic
    Replies: 3
    Last Post: - 28th May 2005, 19:44
  4. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14
  5. Battery Backup with PIC controlling switch
    By Dwayne in forum Schematics
    Replies: 1
    Last Post: - 27th December 2003, 13:16

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