AVR reset on AC spark!

Discussion in 'Embedded Systems and Microcontrollers' started by allahjane, Apr 22, 2014.

  1. allahjane

    Thread Starter Member

    Sep 19, 2012

    I'm using an AVR ATMEGA 16 with a 4700uf cap in the 12 volts supply to the lm7805 and a 1uf cap between the vcc and gnd very close to them. I'm using Xtal with 20Mhz

    The Circuit is operating near AC mains switches and wall plug sockets. We all know switches make some spark when you turn them on or off !

    The sparks ate generating interference which immediately hangs the AVR (including watchdog!!!) and in some cases (lucky ones) resets it.

    How should I make the circuit withstand noise/interference?

    Like how do our cellphones and laptop computers etc. keep working unaffected by any outside electrical noise (atleast they wont restart or hang)
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    Big caps are not very good for filtering out high frequency transient noise. Try some 100nF decoupling caps in parallel with the 4700uF caps. Some ferrite beads may also help. However the problem may (and probably is) be more complex than this. So some pictures of the setup would be nice
  3. allahjane

    Thread Starter Member

    Sep 19, 2012
    Ferrite beads will be very bad for the design due to their bulkiness and size! I would like to avoid it at all costs!

    Does anyone know How the the circuits like our cellphones (some of which now run on Ghz range processors) are not affected at all by these sparks.
  4. ericgibbs

    AAC Fanatic!

    Jan 29, 2010
    I wouldn't say that this type of ferrite bead is bulky, ref image.:)

    If your AVR power supply is derived from from the mains, its very likely that the interference is mains borne, so I would advise the same as 't06' fit 100nF caps on the input to the 7805 and the 5V reg output, also the 1uF needs sizing up to say 47uF. Add a 100nF close the AVR power pins.

    If its airborne interference screening will reduce the problem, do you have long, unscreened leads attached to the AVR.

    As requested , photo's would help.
  5. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    How have you handled the reset (MCLR) pin?

    It could be noise getting into the reset pin, especially if you have no cap from that pin to ground. Or have only a high value resistor pulling up the reset pin.

    If you don't need the reset pin, tie it to Vdd 5v with a wire.