AC to PIC read hi or low


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2004
    Posts
    440

    Default AC to PIC read hi or low

    Require a read of high or low of 34 22v AC leads.

    I thought Melanie had posted one for high voltage AC including a LED but can't find other than this: AC Signal...

    Norm

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Here are two threads that might be of help.
    http://www.picbasic.co.uk/forum/show...hlight=voltage
    http://www.picbasic.co.uk/forum/show...hlight=voltage

    But... if all you are wanting to do is see if the signal is HIGH or LOW-- ON or OFF--and the voltage IS only 22 VAC. A rectifier to change to DC and a voltage divider to bring it down to 5 volts should do the trick.

    If the high voltage was greater than 32 to 48 volts I would recommend a transformer for the voltage drop along with a page full of safety precautions.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit
    A rectifier to change to DC and a voltage divider to bring it down to 5 volts should do the trick.
    A problem can occur when power to PIC is off, the 5 volts from the divider can power the PIC.

    Perhaps a simple transistor, 22vAC to 10k resistor to gate, collector pulls PIC input pin low?


    Is this acceptable configuration?

    Norm

  4. #4
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    If the PIC you are using has clamping diodes on the inputs, all you need is a current limiting resistor in each circuit. There is a Microchip app note that covers this.

  5. #5
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dhouston
    If the PIC you are using has clamping diodes on the inputs, all you need is a current limiting resistor in each circuit. There is a Microchip app note that covers this.
    This App? Interfacing to AC Power Lines

    Norm

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Normnet View Post
    A problem can occur when power to PIC is off, the 5 volts from the divider can power the PIC.
    You are correct. But you did not say that the PIC was going to be turned on and off. The voltage monitors that I have made are never shut off and equipped with backup power just incase.

    Now that you know two ways to solve your first question and one way for the second. (this is a productive thread ) The most, I think, reliable way to isolate the PIC is an opto isolator. Nothing fancy, LED and a photo diode with a piece of heat shrink between them.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Normnet View Post
    That's the one. It works with voltages from about 5.5VAC to ???VAC.

Similar Threads

  1. make a low voltage output from a PIC pin
    By emptyset in forum General
    Replies: 1
    Last Post: - 8th February 2008, 19:20
  2. Changing declared variables names on the fly
    By jessey in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th December 2006, 06:34
  3. Replies: 2
    Last Post: - 17th February 2006, 09:52
  4. 4-line LCD Help - using PortA instead of B
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 31st March 2005, 03:14
  5. Line following robot... problems with some code
    By nepstar in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 24th March 2005, 01: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