How do magnets affect the ATMega328?
Magnets cause problems with magnetic storage (hard disks, tapes, etc). The AVR chips use flash, so won't be a problem.

Recently, I did some experiments with AVRs and hall effect sensors. I never saw problems from being near magnets.