Didier Stevens

Thursday 30 June 2011

Integrating My CCTV DVR And Alarm System

Filed under: Hacking,Hardware — Didier Stevens @ 20:49

I’ve designed and installed my own home automation system: it allows me to control lights and appliances, and monitor activity and environmental parameters at home.

I also have a CCTV DVR with a couple of cameras around the house.

Until now, these 2 systems were not linked. If a PIR sensor detected movement in the garden and later I wanted to see what caused the movement, I had to write down the timestamp and then rewind the DVR around the time the movement was detected. Not anymore. My CCTV DVR has an external IO connector, and now events detected by my alarm system are logged on my DVR. I just have to click on an event on my DVR and the video starts to play.

The problem I faced to achieve this integration, was the lack of documentation. There was no pinout of the external IO connector, not in the manual and not online. So I had to reverse engineer it.

My CCTV DVR is a DVR4L5 sold by Velleman, and is actually produced by AVTECH in Taiwan. The external IO connector is a 9 pin DSUB connector. I can use it to send 4 different alarms to the DVR. But for this to work, the alarm has first to be configured on the DVR:

Set the channel for which you want the alarm to register to N.C. This means Normally Closed, which is counter-intuitive, because I’m using a Normally Open alarm. When I now close the circuit between pin 1 and pin 5 of the external IO connector, an alarm event gets logged and the DVR’s buzzer alerts me. Since I don’t need that buzzer to alert me, I disable it:

Here is an example of alarm events logged by the CCTV DVR:

The DVR can also send alerts to the alarm system. It does this by closing the circuit between pins 6 and 7. For example when it detects movement filmed by one of the cameras. But from experience I know you get a lot of false positives from this motion detection. For example when a cloud moves in front of the sun, the sudden shadow can trigger the simple motion detection algorithm of the DVR. A more useful alert to send to the alarm system is the loss of video signal. The DVR can be configured to sound the alarm when it loses a video signal from one of the cameras. For example when someone tampers with your camera.

Some weeks after I reversed the pinout, I received a reply from AVTECH that confirmed my findings. I’m including it here:






Connect ALARM INPUT (PIN1 – 4) and GND (PIN5) connector with wires. Once an alarm is triggered, the DVR will start recording and the buzzer will be on.

PIN Alarm Corresponding video channel
PIN 1 1 CH1
PIN 2 2 CH2
PIN 3 3 CH3
PIN 4 4 CH4





EXTERNAL ALARM COM Under the normal operation, COM disconnects with NO. But when any alarm is triggered, COM connects with NO.
Attention: The voltage restriction is under DC24V 1A.


EXTERNAL ALARM NO Under the normal operation, COM disconnects with NO. But when any alarm is triggered, COM connects with NO.
Attention: The voltage restriction is under DC24V 1A.








  1. Hi Didiers,
    Interesting, it would be nice to hear more about your setup and the kind of hardware your are using (for the cameras but also the rest of your home automation system). Are you relying on Wifi webcams?
    I am interested in building a similar system for my home at it would be great to hear more from your experience!
    Thanks for a very nice blog!

    Comment by JM — Saturday 2 July 2011 @ 21:07

  2. @JM

    Many years ago I started doing video surveillance with an IP camera and CCTV software running on my PC.
    But consumer IP cameras have several drawbacks for use in video surveillance:
    1) the field of view is often too small, and you can’t change the lens
    2) the sensitivity is not good for low light conditions, after sunset you can’t use them anymore
    3) infrared filming is not a feature
    4) they sometimes hang and need to be powercycled.

    Then I switched to a analogue CCTV camera, and used a video grabber card.
    This camera has a wide field of view, I estimate around 135°, is very sensitive (0.01 Lux), films in infrared too, and never hangs.
    A big improvement over IP cams.
    And now I use a dedicated CCTV DVR with a couple of CCTV cameras.

    Professional IP cameras for CCTV don’t have the drawbacks I mentioned, but they are very expensive.

    Comment by Didier Stevens — Sunday 10 July 2011 @ 8:44

  3. Thanks for doing this Blog! This is exactly What I needed to hook up my system. I was robbed last week, and have video of all of it. I am Really mad Instructions with this unit did not tell me how to hook it up, I had both the alarm and the cam system. I was doing the same as you did when I found this link!
    Thank You!

    Comment by dozerman — Monday 18 March 2013 @ 21:08


    Comment by GINO — Monday 29 April 2013 @ 12:43

  5. @GINO Can you explain?

    Comment by Didier Stevens — Monday 29 April 2013 @ 20:43

  6. Hi Didier,

    It is interesting to read your blog about integrating your CCTV DVR and Alarm.

    I wonder whether you have done integrating your CCTV DVR with access control.

    I am trying to integrate those two, so for example, if someone opens my door using my access control, I would get a log in my DVR instead of writting down the timestamp and rewind it in DVR.



    Comment by Anonymous — Monday 26 August 2013 @ 10:39

  7. Do you have an output signal (e.g. pulse) from your access control system? Then use that.

    Comment by Didier Stevens — Tuesday 27 August 2013 @ 23:13

  8. In access control system, i have an output signal to turn off the door lock. I do not know whether i can use that as signal. Any chances you have played with that before?

    Comment by Anonymous — Thursday 29 August 2013 @ 5:52

  9. Yes you can, but if the electrical characteristics are not matched (AC/DC, voltage, impedance, …) you’ll need to convert the signal.

    Comment by Didier Stevens — Thursday 29 August 2013 @ 17:49

  10. I want to connect this BINGO Vidicon with AVC792PV. How to connect contacts and CONFIG do in dvr?

    Comment by Anonymous — Thursday 5 September 2013 @ 16:29

  11. @Anonymous. Don’t know this device. What contacts does it have?

    Comment by Didier Stevens — Thursday 5 September 2013 @ 17:19

  12. Hi Didier,

    Thanks for this post! I was also looking for the pinouts for a while before I came across this…

    I was hoping to wire up my front door bell in addition to my house alarm to do this.

    It is a wired telephone style doorbell. There is about 5.5VDC permanently on the wires to the outside unit. When the doorbell is pushed it drops down to 3VDC or below depending on how long the button is held in returning to 5.5VDC when it is released. Then when the handset is picked is picked up it goes up to above 7VDC.

    Is this something I can use directly on the pins or would I need to add something?

    I’m not sure if it it drops to 0VDC when the button is pressed as my voltmeter might just not be quick enough to register it. However if it is that quick then the pinout will probably also not see it as a break in the NC config.

    Thanks for the help.



    Comment by Paul — Saturday 21 June 2014 @ 9:41

  13. @Paul No, you can’t connect this directly. You need to build an interface. An opamp is one of the many solutions.

    Comment by Didier Stevens — Monday 23 June 2014 @ 21:05

  14. i want to know the dvr alarm

    Comment by EXPERT TECHNOLOGY — Tuesday 26 January 2016 @ 16:13

  15. sorry?

    Comment by Didier Stevens — Wednesday 27 January 2016 @ 20:54

  16. Thanks so much I am trying to do dat at my office ritaway bt I will be needing your assistance, I have a goevision dvr& infinite prime motion dictector

    Comment by Evaristus — Thursday 18 February 2016 @ 10:22

  17. This is for AVTECH.

    Comment by Didier Stevens — Thursday 18 February 2016 @ 22:36

  18. Hello.
    Is it possible to link a DVR to an alarm horn that I can trigger myself from distance?
    Ex: I see someone walking around then trying to breach my store. Can I manually trigger the alarm from my phone?

    Comment by Marc — Saturday 22 July 2017 @ 15:48

  19. I guess it would depend in the DVR.

    Comment by Didier Stevens — Saturday 22 July 2017 @ 15:52

RSS feed for comments on this post. TrackBack URI

Leave a Reply (comments are moderated)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.