Atmega chip reset on spike

Hi,
My standalone atmega328 will reset whenever I rotate the fan speed controller in the room.The switch induce spike noise to the chip power line, and causes it to reset. The power adapter to the chip is unregulated and i pass it to regulator 7805. How can I solve this? Tq.

Could you post a circuit diagram?

regards

Allan

As attachment. Without green and blue wire.

FLAQAU0HUQAU4WH.MEDIUM.jpg

You have no decoupling capacitors. Add 100nF and 100uF acrose the power supply lines . The 100nF should be as close to the chip as possible

Regards

Allan

Image from Reply #2 so we don’t have to download it. See this Image Guide

252d9878c87b29ff8b532191b81843c94cc094e7.jpg

…R

allanhurst: You have no decoupling capacitors. Add 100nF and 100uF acrose the power supply lines . The 100nF should be as close to the chip as possible

Regards

Allan

Situation improve a lot w cap 100uF . I have yet to find 100nF. Thanks,Allan.

|500x245 I think I learn something....Robin.Thanks