Relay Switching Spike

Discussion in 'General Electronics Chat' started by Jonesy, Jul 28, 2011.

  1. Jonesy

    Thread Starter New Member

    Jul 7, 2010
    20
    0
    I am using a relay to control a 220VAC with an MCU connected to a mosfet.

    When I turn a load on, or off, there is a brief spike detected and my interface connections are affected.

    Is there any way to solve this? I have connected a fast switching diode across the relay.
     
  2. bertus

    Administrator

    Apr 5, 2008
    15,645
    2,344
    Hello,

    What are you switching on the 220 Volts side?
    Perhaps a snubber circuit is needed.

    Bertus
     
  3. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    It would help if you posted a schematic.
    Your fast switching diode - is it a 1N4148/1N914? These diodes are very fast, but are limited in the amount of current they can carry. If the relay current exceeds about 75mA, you really need to look at a more capable diode. The 1N400x are OK to use for reverse-EMF diodes on relays; they turn on fast enough, it's the turn-off time that's slow. The turn-off time is not generally much of a concern with relay coils.

    You might also consider SSR's (solid state relays); the input side is basically an optocoupler.
     
  4. Jonesy

    Thread Starter New Member

    Jul 7, 2010
    20
    0
    I am using 1N4148, the coil resistance is 75ohm, 5V control voltage. The load is a light bulb or a television.
     
  5. strantor

    AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    I use 1N4004 for all relay flyback diodes
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    It wouldn't hurt to change that 1N4148 over to a 1N400x. Although you'll only be putting ~66.6mA through the diode when you turn the relay coil off, that's still running fairly close to its' rating.

    I'm betting that you don't have enough capacitance across your uC's power supply. You should have an 0.1uF ceramic or poly metal film cap directly across them, and a 100uF or so aluminum electrolytic not far away.
     
  7. Jonesy

    Thread Starter New Member

    Jul 7, 2010
    20
    0
    I have 0.1uF capacitors across the uC power and ground, in fact I have 2 of them, another one at the AVCC.

    I think I would need a optical isolation for the USART interface, which is the rs232 interface connected to a pc. Once I turn on and off, the pc software hangs, maybe because of the noise/spike affected the port of the PC.
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    THe 0.1uF caps are a necessity right next to IC's, but you should also have a much larger aluminum electrolytic cap somewhere in the vicinity. The small caps take care of the high frequency transients, the big caps take care of the low frequency transients.
     
Loading...