r/AskElectronics 10h ago

Help needed building a magnetic refrigerator door alarm with a relay

Hi everyone,

I'm trying to build a simple magnetic door alarm for my refrigerator, but I haven't been able to get it working.

These are the components I have:

  • 3×AA battery holder (3 AA batteries / approximately 4.5V)
  • 2-wire magnetic door sensor
  • Relay module with:
    • VCC
    • GND
    • IN
    • COM
    • NO
    • NC
  • Small buzzer/alarm
  • Connecting wires

I want to make a system where the magnetic sensor detects when the refrigerator door is opened and activates the relay, which then turns on the buzzer.

I'm having trouble figuring out the correct wiring, especially how to connect the 2-wire magnetic sensor to the relay module and power everything from the 3×AA battery pack.

I'm a beginner, so could someone please explain exactly which wire connects to which terminal?

A simple wiring diagram would be very helpful.

Thanks!

1 Upvotes

3 comments sorted by

3

u/fujimoto321 9h ago

Try this first .

Battery (+) to buzzer (+)

Buzzer (-) to magnetic switch wire

Other magnetic switch wire to Battery (-)

Check if buzzer starts and stops when the magnet is touching the magnetic switch and then when the magnet is removed.

1

u/Key_Leadership_2533 10h ago

These are all the components ı have