Power problem

Discussion in 'The Projects Forum' started by Dan2, Oct 16, 2008.

  1. Dan2

    Thread Starter Member

    Oct 16, 2008
    i am having a very similar problem. i am trying to drive 2 5v relays and a pic off a single 5v regulator. the relay coils are controlled by the PIC via 2n2222 transistors. the PIC works fine until i try to activate a relay, then it also freezes. i hav a LED across the regulator and that stays on (shows that 5v is stil present)

    if i remove the PIC from the circuit and manually activate the relay (5v from the reg to the base of the transistor) it works perfectly, however as soon as i put the PIC back into the circuit, and try to activate the relay manually again (not connected at all to the PIC), it seems to short out the regulator.

    Please help, it really makes no sense to me.
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    Greetings! And welcome to AAC!

    I've moved your post into its own thread, where it will draw more responses.

    Please refrain from "hijacking" existing threads with tangent or off-topic questions. You can create new threads for new questions using the "New Thread" button on the upper left of the page.

    You probably need to post up your circuit. Do you have current limiting resistors in series with each transistor's base?
  3. mik3

    Senior Member

    Feb 4, 2008
    Check for solder splashes under your pcb, maybe the output of a relay is shorted accidentally to one of the PIC's pins.
  4. vetterick

    Active Member

    Aug 11, 2008
    Perhaps the inrush current to the relay is causing a spike hanging the PIC,
    have you installed decoupling caps near the relays?
  5. SgtWookie


    Jul 17, 2007
    Use a 220uF and a 0.1uF cap across the power supply.
    Use a 0.1uF cap across the PIC's supply pins.

    PICs can source or sink up to 25mA from their I/O pins. You need a resistor from the I/O pin to the base of the transistor. I suggest 220 Ohms or more, which will allow 22.7mA current.

    Use diodes connected in reverse across the relay's power leads. This is important for suppression of the reverse EMF when the relay is de-energized. You could use 1N4148 diodes or 1N4001 through 1N4007 diodes. You may also need to connect a small capacitor, perhaps 330pF, across the diode to slow the rise time of the reverse EMF pulse.