I have spent quite a considerable time debugging my code that was triggering false interruptions. I have found out that the source of the error were the diode lights (on the picture). I would like to ask if anyone can point me to the possible source of such behaviour.
I will try to explain really briefly what the issue was providing only needed (from my point of view) details. If you would require more - tell me.
So, I have a board that looks like this:
You can see two reed switches (close circuit in the presence of a magnet) which leads the INT0
(pin 2) and INT1
(pin 3) on arduino to trigger an interruption on their RISING
behaviour. The pull down resistors are 1kOhm. This cirquit works perfectly.
The original version of this circuit had lights in positions D5-D10
and D19-D24
(between the reed switches and the connections to the interruptor pins). The lights are these:
The part of the circuit with the red light (connected to INT1
) worked flawlessly, while the circuit with the green light (connected to INT0
) every once in a while triggered a false interruption in INT1
. The lights, however were always blinking correctly.
I have nearly no experience with circuits and hardware, so a pointer on where to start reading to understand the issue is also welcome. Hope to hear from someone who knows what the cause could have been. I would still like to use the lights somehow, because they give a nice feedback on what is happening to the system.
Thanks!
PS. I do not think the code is necessary here, but I will post it too if you like. I am however quite confident that the bug is not on the software side.