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


    Did you find this post helpful? Yes | No

    Default

    Wouldnt that need a load on the end of the wire? The wire goes from the smoke machine then straight into the circuit

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    Wouldnt that need a load on the end of the wire? The wire goes from the smoke machine then straight into the circuit
    Never tried it...but...if my thinking is right...
    A coil of wire around the power cord itself (around, not touching...), a high value resistor in series with the coil, one side of the resistor to ground, one side of the resistor to the PIC pin. The resistor should show a voltage across it if there is current flowing thru the power cord. You'll probably have to put a diode inline with the PIC pin and maybe a small R/C network behind that to filter out the 50hz half-wave and get a decent reading at the PIC.
    Unless my thinking is really jacked up (entirely possible), it should work... Not sure how many turns you'd need, might be 10, might be 1K...

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


    Did you find this post helpful? Yes | No

    Default

    That sounds a little complicated. Anything upto 1000 turns :O Ive got to do this 3 times too. I think the 50Hz part will be a problem with every method.

    It would be best if i could do the opto way. Problem is i think i need something daft like 20W resistors for it

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


    Did you find this post helpful? Yes | No

    Default

    You said something about a ready light? There is half of the opto-coupler. A photo diode is the other half.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    I wish id have thought of that. I dont have any photo diodes or anything else to sense light. Those ready lights wernt going to be connected. The idea is that the PC can display all that. It wouldnt be hard to connect them back up though.

    I guess if i dont connect it to the PC and just use the origional lights then it wont be a problem. I do have a future project that will use this type of thing though so i wanted to get it right now.

    Ive just connected a transistor up to the mains through a 10M resistor and with a diode across it plus a 100K grounding resistor for the base. It seems to be working perfectly. The LED turns on when the mains is turned on. Ive had it running the whole time ive been writing this post and nothing is smoking so it seems this method will probably work. Just incase, i do have a stack of spare PIC16F877As

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


    Did you find this post helpful? Yes | No

    Default

    Just incase, i do have a stack of spare PIC16F877As
    What about a fire extinguisher near by?
    Dave
    Always wear safety glasses while programming.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    That sounds a little complicated. Anything upto 1000 turns :O Ive got to do this 3 times too. I think the 50Hz part will be a problem with every method.

    It would be best if i could do the opto way. Problem is i think i need something daft like 20W resistors for it
    Shouldn't take a 1000 turns to do what I'm thinking. I would think maybe 10 or 20 would handle it just fine. 50hz shouldn't be a problem either.
    All you're doing is making a 'transformer' of a sort, tapping into the expanding/contracting alternating magnetic field that naturally surrounds a wire that is carrying a current, inducing a current into that coil, and developing a small voltage across a high value resistor which is the load for that coil.

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi, Master

    may be there's your idea here ...


    Alain
    Attached Images Attached Images
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    mackrackit, I have a glass of water here that i was using to test the water sensor.

    skimask, The problem with 50Hz or any oscillating input is that the PIC detects multiple inputs. Im sure its easy enough to program around that but ive not got that far yet

    Acetronics, that looks just slightly complicated. I dont think ive got half the components in that diagram anyway

    dhouston, Its a PIC16F877A. Doesnt really matter much about which pin. I guess it wouldnt hurt to add diodes in myself just to be sure. I did a search for "clamp" in the datasheet so thats why i didnt find anything. "clamp" wont find a diagram

  10. #10
    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 The Master View Post
    mackrackit, I have a glass of water here that i was using to test the water sensor.
    For an electrical fire ?

    skimask, The problem with 50Hz or any oscillating input is that the PIC detects multiple inputs. Im sure its easy enough to program around that but ive not got that far yet
    Rectifiers do not care...do they?
    Dave
    Always wear safety glasses while programming.

  11. #11
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Talking Can't believe it ... !!!

    Quote Originally Posted by The Master View Post
    Acetronics, that looks just slightly complicated. I dont think ive got half the components in that diagram anyway
    LOL ...

    .... just think you only need D1,D2,D3,D4, R1 and IC1 ... and you do what you want with the O.C. transistor.

    Is there someone with a brain, on this forum ???????????????????????????????

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    dhouston, Its a PIC16F877A. Doesnt really matter much about which pin. I guess it wouldnt hurt to add diodes in myself just to be sure. I did a search for "clamp" in the datasheet so thats why i didnt find anything. "clamp" wont find a diagram
    Look at the diagrams in section 4.0 I/O PORTS. Most of the pin diagrams have the following... Note 1: I/O pins have protection diodes to VDD and VSS.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    skimask, The problem with 50Hz or any oscillating input is that the PIC detects multiple inputs. Im sure its easy enough to program around that but ive not got that far yet
    The first edge sets the interrupt bit which stays set until you clear it.

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