I found an inexpensive electromechanical latch. I really wanted to come up with some kind of game with it.
I sawed out squares from plywood myself, put together a box. Plugged in the wire. The result was an old game: pass the ring without touching the contact wire. If you go from beginning to end without touching it, the latch opens and you can get what is hidden in the box usually candy. You can’t cheat, you must first touch the “start” contact and then, without touching the wire, touch the “finish” contact.
It was huge success with the children.