1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Electronics Switching mains with a PIC

Discussion in 'Modding' started by TimEG, 5 Jul 2006.

  1. TimEG

    TimEG What's a Dremel?

    Joined:
    7 Mar 2005
    Posts:
    32
    Likes Received:
    0
    Hello again,

    Right, so I've made my first mains circuit:

    [​IMG]

    The circuit uses a few bit's n bob's to create a stable 5V supply for the PIC, the PIC is connect to a 16pin header for an LCD and a 4 pin header for a switch bank. I just noticed a couple of strange things and wondered if anyone could shed some light on the situation.

    I started off testing this with a mains load of only a neon because I plan to use the neon as an indicator that the circuit is active. With the neon it makes no difference if the opto/triac switch is on of off, it's always lit. I tried removing the two x2 caps and then the switch works fine, on and the neon is on, off and the neon is off. Witrh the caps in place I put a voltmeter over the output and it's always at around 10-12V, irrelevent of what the state the triac switch is.

    When I tried the circuit with a full load and the neon in parallel it works fine. Switches on and off and the neon and load light only light when the triacs are on. I again tested the output and it was as expected 0v off and 240v on.

    Why when there is only a small load, i.e. the neon, is the circuit always half on. Is some current leaking through the caps because when they were removed the circuit functioned as I would have expected. Is this residual charge dangerous? I.e. When off, could you still shock yourself on the output of this circuit?
     
  2. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    Yes, the circuit in this configuration does not isolate the output when the circuit is turned off, so you'll be able to to get a bit of a shock from the output - due to the resistors and capacitors in that circuit.
     
  3. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    On loads, triacs (and thyristors) need a minimum load current to stay on so odd-ball things could happen with the uA draw of a neon load. (eg, Holding Current for a BT137 triac is 2.5-20mA.) The neon will still light through R4,R5 and the optotriac if the big triac is disconnected.

    They're dodgy things to test for presence of mains voltages, can give false alarms. Some electricians carry a 10W filament bulb to confirm. ;)
     
  4. TimEG

    TimEG What's a Dremel?

    Joined:
    7 Mar 2005
    Posts:
    32
    Likes Received:
    0
    Hmmm. That's a bit duff. Fine for the purpose I currently need it for but maybe not for a general purpose switch. Is there any way (Other than just using a relay) to stop that slight current when the opto/triac unit is switched off?
     
  5. ConKbot of Doom

    ConKbot of Doom Minimodder

    Joined:
    2 Jul 2003
    Posts:
    2,160
    Likes Received:
    6
    Not that I can think of, even solid state relays have a bit of leakage current. You could try using another triac in there that gets turned on and shorts the outputs when the main triac is turned off, just have to make very sure of the fact that it stays off when the main one is on, or otherwise it could be... interesting
     
  6. TimEG

    TimEG What's a Dremel?

    Joined:
    7 Mar 2005
    Posts:
    32
    Likes Received:
    0
    Hmmm. That sounds like a recipe for disaster! I guess if the leakage is a problem in future I'll just have to use a normal relay instead! At least I've learnt some new tricks with this project!
     
  7. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    Off-state leakage current for a BT137 is 0.1-0.5mA, so your triac is probably the culprit.

    Is just the neon always on the problem? I wonder if a weak pull-down resistor in parallel with the neon+resistor/load would fix it? 100k 1W might do, maybe higher. With a high leakage resistance elsewhere in the circuit this will drop the potential across the indicator.

    Another maybe better way seen here is to put the resistor across the neon. With a full 240V to the indicator the neon sees about 80V so will strike, with extra leakage resistance in series it sees much less and won't.
     
    Last edited: 20 Jul 2006
  8. TimEG

    TimEG What's a Dremel?

    Joined:
    7 Mar 2005
    Posts:
    32
    Likes Received:
    0
    That's interesting because when the output from the circuit was connected to a standard incadescent lamp as well as the neon, the neon only lit when the circuit was active. Obviously the bulb in the lamp acts as a resistor in parallel to the neon which is exactly what you propose above. I just checked the resistance of the lamp and it's around 110 Ohm when off but I'll try with some higher resistors. Obviously the ballasts for the UV tubes don't have the same resistance effect because the neon is always on when connected to those.
     
  9. g0th

    g0th What's a Dremel?

    Joined:
    12 Apr 2005
    Posts:
    319
    Likes Received:
    1
    Yeah, if you only have the neon connected then it will always be lit up, and if you use say a multimeter, you'll always measure that 240VAC output.

    But if a significant load is connected (Your load of fluros, or any household incandescent light bulb would be perfect for testing) it will work correctly, and the neon indicator will only light up - along with the load - when the triac circuit is turned on with a PIC.

    Regarding the rating of the triac circuit, if it's 8A or 3A, i think it is probably 8A for a resistive load and 3A for a reactive load.

    I have this exact same triac circuit controlling my Eheim 1250, two 120mm mains brushless fans, and my LCD monitor, and it works great with a BT137 triac with no heatsink.
     

Share This Page