Pic reseting when switching mains current with relay


Results 1 to 23 of 23

Threaded View

  1. #1
    Join Date
    Sep 2006
    Location
    Reading, UK
    Posts
    15

    Default Pic reseting when switching mains current with relay

    Hi,

    I'm trying to switch a mains current (240V AC) with a relay connecting via a transistor to my PIC (a 16f876a). The PIC is powered from a battery supply - 4 rechargeable AA NIMH cells providing 5V. That's powering the PIC directly - there's no regulator (I presumed there's no need for one).

    At the moment the mains supply is hooked up to a light. Everything usually works fine when switching the relay ON, but when the relay switches OFF the PIC resets almost every time.

    If I disconnect the mains supply the PIC can turn the relay on and off without any resets.

    The schematic is attached. The relays sit on a separate PCB immediately adjacent to the board with the PIC, and the two are connected with 2 inch wires. The wires with the mains current travel close by the PIC board - this isn't really avoidable. The relays are switching the Live wire of the mains supply.

    In addition to what you can see on the schematic I've added a 0.1uF cap between MCLR and ground. (Something I saw suggested somewhere.)

    I've read a lot about decoupling capacitors, zero crossing, ground planes, and so on! But I don't know where to start, short of randomly trying everything. It would be great to be able to systematically diagnose what's creating the problem, but I don't know how to go about doing this.

    Any suggestions are gratefully received.

    Thanks,

    Luke
    Attached Images Attached Images  

Similar Threads

  1. Reducing PIC current to as low as possible...
    By FromTheCockpit in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th November 2009, 04:28
  2. Replies: 24
    Last Post: - 7th November 2008, 04:41
  3. Serial Relays
    By tazntex in forum General
    Replies: 3
    Last Post: - 17th May 2007, 17:42
  4. Detecting mains current
    By lsteele in forum Schematics
    Replies: 3
    Last Post: - 13th January 2007, 14:48
  5. High current switching output
    By Tissy in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 8th September 2005, 14:06

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