Perhaps adding a simple switch in order to power the assembly only if the door is open may solve this problem outside coding environment.
Perhaps adding a simple switch in order to power the assembly only if the door is open may solve this problem outside coding environment.