Sleep well while this magnetic sensor guards your shop, warehouse, or home.
This magnetic detector consists of a master element and a reed switch:
When both elements are at a distance greater than 45 millimeters (1.8”), the reed switch contacts are open. When they are at or closer than 10 millimeters (0.4”), they are closed. Between them is the “gray zone”. Each reed switch has a trigger threshold in this range, but where it is, you will have to find out yourself.
It is convenient to connect the module to an Arduino or Iskra via this Troyka pull up. When turned on, the module will give a "high" signal, and when you bring the magnet closer it will give a "low" signal.
You don't even need a microcontroller to make an alarm. Assemble the magnetic detector, siren, relay, and power supply into one circuit. With that your alarm is ready. When the door or window opens, the siren will scare off the intruder. Reed switches can be connected in a chain and when at least one of them is triggered the siren can't be turned off.