Detecting 240V with a PIC (Part2)


Closed Thread
Results 1 to 8 of 8

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    The Opto you're using has a Triac type output, which is meant to switch AC voltages.

    You need one with a Transistor output, could be either NPN or PNP, but NPN is more common. Then with a pull-up resistor on the collector and the emitter to ground ... it should work.
    DT

  2. #2
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Good idea thanks!

    I found some transister ones in rapid. Some even have AC input so i can drop the diodes and they are cheaper anyway. They dont seem to have any datasheets so ill request those tomorrow and maybe buy a few of each type.

    Thanks for your help

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Do a search for a K1010 (available from RS). Put a 1N4007 across it (in reverse to clamp the negative cycle because the reverse voltage will almost certainly exceed the opto's max rating and you're in danger of blowing it up). Feed that with a 270K Resistor (mains rated... the CR25 types are marginal here - unless you use say 2 x 150K - one in each input leg). Use a PIC pin with a pull-up (internal weak pull-ups are just fine) and set your software to detect the 50/60Hz AC pulses (no pulses - no mains).

    PS... just in case anyone reading this is in a part of the world where they have toy voltages coming out of the wall, the above is good for 220-240vAC.

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. 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
  3. Detect 240V with a PIC
    By The Master in forum Off Topic
    Replies: 48
    Last Post: - 28th October 2008, 20:21
  4. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

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