In a complex project my arduino mega controls LED strips via power MOSFET and PWM output and in the same time control other things via interrupt pins (button’s, switches). Arduino is powered via power jack +5V.
Everything works work like a charm unitl I power up the external +12V led strip and make a current drain.
When I turn on an external 12V power supply to power the LED strip AND open MOSFET via PWM
so current start going and after that ALL interrupt pins start going crazy and trigger endlessly. So it ruins all the workflow.
Interrupts are set to:
attachInterrupt(digitalPinToInterrupt(3), foo, RISING);
It happends on all interrupt pins.
I guess I should filter that noise from external power supply somehow - or maybe it’s another reason?
What I’ve tried:
- Tried setting:
- Tried attaching a physical pull-down 10k resistor to that pin
- Tried 0.1uF, 1uf (ceramic) cap between arduino +5V and GND
Generously asking community to help as Im pretty new to shematics.