Detect 240V with a PIC


Closed Thread
Results 1 to 40 of 49

Hybrid View

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

    Default Detect 240V with a PIC

    Hi, Ive got some new smoke machines for halloween and the buttons use 240V. Ive got the control part sorted. Im using triacs. The light also runs on 240V. Is it possible to connect that into a PIC chip somehow so the PC can detect when the smoke machine is ready? I know it would be pretty stupid to connect it directly. I have some opto isolators that i use for controlling the triacs. Could i use a resistor and connect the 240V into the opto isolator?

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


    Did you find this post helpful? Yes | No

    Default

    Most PIC pins have clamping diodes so (assuming you are using a pin with these diodes) you can connect it directly using a 10M resistor to limit the current.

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


    Did you find this post helpful? Yes | No

    Default

    Thats good. I need to order some more stuff from Rapid soon so ill add some of those resistors to the order. As its 240V i think i will still use an isolator just to be on the safe side.

    Thanx

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


    Did you find this post helpful? Yes | No

    Default

    In that case you won't need 10M resistors. Here's a circuit you can modify for your app...

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Question Are those LEDs actually LEDs or what?

    Quote Originally Posted by dhouston View Post
    Look at the LEDs on page 77 of that document
    Must've been an off day for the editors...

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


    Did you find this post helpful? Yes | No

    Default

    The circuit diagram in the PDF looks good. Nice and simple.

    How do i know what value resistors to use? Do i stick with 130K as shown in the diagram? I would have thought it varies for each type of optoisolator. I tried to calculate it based on the maths from a site macrakit linked to Designing LED lighting. I worked out that for my opto isolator the resistors should be 3K975. I think ive gone wrong somewhere because i wouldnt have thought it would vary that much. Im using a MOC3020M.

    I take it the diode is just to stop reverse voltage going into the optoisolator. Would it work the same if it was in series with it?

    I think im missing some of the document. skimask mentioned page 77 but all i see is a single page with a short writeup and a link to a PDF file. I dont see any kind of navigation for multiple pages either

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. Detecting 240V with a PIC (Part2)
    By The Master in forum Off Topic
    Replies: 7
    Last Post: - 18th March 2009, 19:10
  3. 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
  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. pic detect amperage
    By jetpr in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th February 2005, 05:02

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