Need HELP with a Beam Breaker when broken releases a magnetic lock

I'm a game designer who is brand new to coding. I normally hire things out but want to venture in learning how it all works. I'd like to create a beam breaker that when tripped will release a magnetic lock through a relay.

I've purchased all the items and I'm using a UNO. I've tried to combine a reed switch code and a laser beam code but I've been striking out. Anyone willing to help? Or anyone know where I could find a code that might be easily modified. Thanks for the help and for being patient with a beginner.

If you bought parts you must have a proposed schematic.

Here is what I have so far. Haven't connected the other side of the relay yet, this is kind of where Im at

Looks reasonable.

Try the IDE examples for input and output sketches.

The mag lock you will need a kickback diode.

The relay inputs need connecting.

Something like this? Where can I find the input output sketches?

Need to see the relay module input requirements, you will need a relay coil power supply too.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.