On request of my daughter, I’m not allowed to set the classical neck-snapping mouse trap that kills the invader on capture.
I bought a non-killing trap, but it’s more of a mouse restaurant than a trap. The mechanical trigger was so hard that you need a super mouse to actually snap the door closed. And super mouse is not stupid like that.
To capture our uninvited guess I thought or replacing the mechanical trigger with something a bit more fancy: The Lego EV3 IR sensor. The setup is actually quite simple. The IR sensor is ‘looking’ into the cage. Using distance measurement mode, I defined the thresholds of ‘cage empty’ and ‘cage with visitor’. The spring loaded door was kept open by a pin connected to a servo.
One point to consider was keeping the trap active during a whole night. I had to address two points for that:
1) set the Controller Brick to sleep:Never
2) use a USB battery to power the Brick
Just after the first night, we had our visitor jailed. Although the kids asked to adopt it as pet, we released it in a forest nearby.