Connect Security Camera Alarm Input to Magnetic Door Sensor

In this video, I’ll demonstrate how to connect a magnetic door sensor to the security camera alarm input of a Viewtron IP camera. These Viewtron IP cameras have alarm input and alarm relay output ports. Devices that are connected to the alarm input port can be used to trigger various types of alarms on the IP camera. They can also trigger alarm actions on a Viewtron NVR and to alarm output devices connected to the NVR, as well as other IP cameras.

In the above video, I configure the door sensor to trigger the following alarm actions when the door is opened.

  1. Start recording on the DVR / NVR. The video recordings are bookmarked by the DVR as an alarm event, which makes them very easy to go back and find later.
  2. Capture a full resolution image snapshot of the alarm event.
  3. Trigger an alarm relay output on the NVR. I connected a flashing light to the alarm relay output port.
  4. Pop-up the live video full screen view of the IP camera that triggered the alarm.
  5. Display a warning message on the screen that describes the door alarm event that occurred.
  6. I did not setup the mobile app push notification for this demo, but that can also be done. You can watch a mobile app push notification video demo here.

Here is how it is all setup.

Security Camera Alarm Input Wiring

Security Camera Alarm Input

Wiring a magnetic door sensor to the alarm input of a Viewtron IP camera is simple. I used 18 / 2 power wire, but you can also use one of the twisted pairs from a CAT5-E or CAT6 cable. The alarm in / out block on the camera uses screw down terminals, as does the magnetic door sensor.

PoE Camera Connection to NVR

All Viewtron IP cameras support PoE. This is the back of a Viewtron 8 channel NVR. The 8 camera input ports all provide PoE. To connect the camera to the NVR, simply connect a CAT5E or CAT6 cable between the camera are one of the NVR’s PoE ports. This provides power and connectivity between them.

Alarm Relay Output

DVR Alarm Relay Output

This part is optional. If you want to trigger a flashing light via an alarm output port on the NVR, this is how an alarm light is wired to the relay output port on the NVR.

Alarm Input Setup on NVR

IP camera NVR settings

To setup the alarm actions on the NVR, click the icon in the lower left and select Settings.

IP Camera NVR AI Event

On the main settings menu of the NVR, click on the AI / Event link.

security camera alarm setup

Next, click on the Sensor link on the left menu. Then locate the alarm input settings of your IP camera Configure the following settings.

  1. Alarm Name. You may set this to whatever name you like.
  2. Schedule. You can choose from the preconfigured schedules or setup your own custom schedule.
  3. Type. The this to NC which means normally closed.
  4. Enable. Set to On.
  5. Duration. Choose the length that you would like the alarm to persist.
  6. Record. Check this box then select the camera(s) that you would like to record video on when the door sensor is opened.
  7. Snapshot. Check this box then select the camera(s) that you would like to take a snapshot image from.

Scroll the screen to the right to see the rest of the settings.

security camera alarm sensor

  1. Push. Set this to on if you want the DVR to send a push notification to the mobile app (iPhone and Android).
  2. Alarm-Out. Check this box and select which alarm relay output ports you want to triggered.
  3. Preset. If you have a PTZ camera on your system, you may configure the PTZ camera to go to a preset location when the alarm is triggered.
  4. Pop-up Video. Enable this and select the live view of the security camera that you want displayed when the alarm is triggered.
  5. Pop-up Message Box. Enable this if you want a warning message to appear on the screen when the door sensor triggers the alarm.
  6. Email. CCTV Camera Pros does not recommend using the email feature unless you know how to configure an SMTP server. We suggest using the push notification instead.

When you are done, click on the Apply button in the lower right.

Security Camera Alarm Recording Setup

security camera alarm recording

Next, click on the Record link on the top menu. You must enable a recording mode that includes Sensor Record. This is what enables the security camera alarm to trigger video recording on the NVR.

When you are done, click the Apply button. Then, close the NVR settings by clicking on the X in the upper right.

Alarm Sensor Video Recording Search & Playback

NVR recorded video playback

To playback recorded video surveillance events, select Playback from the lower left.

magnetic door sensor alarm

When the video playback screen opens, you will see a time line on the right. The alarm sensor events will be notated in red on this time-line. You can click anywhere on the time-line to jump to that section of video surveillance footage.

IP Cameras with Alarm Input

security cameras with alarm input

You can find all of out Viewtron IP cameras with alarm input here. These security cameras also have alarm output ports.

Viewtron NVRs

IP Camera NVR

You can find all of our Viewtron NVRs here. We have 8 channel, 16 channel, 32 channel, and 64 channel NVR models.

DVR & IP Camera with Alarm Videos

security camera alarm video demos

You can watch additional security camera alarm and DVR alarm video demos here.

Have Questions / Need Help?

If you have any questions, please email me at