Alarm Relay Sticking after motion detect

Discussion in 'Dahua' started by Kymadn, Sep 11, 2018.

Share This Page

  1. J Sigmo

    J Sigmo Pulling my weight

    Joined:
    Feb 5, 2018
    Messages:
    192
    Likes Received:
    125
    Still, the relay you used was low enough power if the coil resistance was 100 ohms. That would be well below the 300mA that the output is supposedly rated for. So I think your original choice was fine.

    That article does show a protection diode placed around the relay coil, and that's good practice. And I do think that would have prevented the problem you were having.

    I really wish we could get some good info from Dahua about the design of their alarm outputs.

    If you keep doing what you just did, though, with that DC SSR, everything should be just dandy. So looking into this further is just a time-killer that you might do if you have some spare time to waste. I fully understand that!
     
    Last edited: Sep 14, 2018
    alastairstevenson and Kymadn like this.
  2. Kymadn

    Kymadn Young grasshopper

    Joined:
    Feb 17, 2017
    Messages:
    38
    Likes Received:
    3
    The lack of documentation by Dahua would be my biggest criticism for their equipment. I found myself having to write some basic documents for my customers which i re-use now. Really the only way to become an expert is to buy the equipment and play with it. You really have to fiddle with it to nut it out.
     
  3. J Sigmo

    J Sigmo Pulling my weight

    Joined:
    Feb 5, 2018
    Messages:
    192
    Likes Received:
    125
    Yes. Bad documentation is all too common these days. It wasn't always that way.
     
    Last edited: Sep 14, 2018
    Kymadn likes this.
  4. alastairstevenson

    alastairstevenson Known around here

    Joined:
    Oct 28, 2014
    Messages:
    8,849
    Likes Received:
    2,495
    Location:
    Scotland
    Yes, indeed.
    I guess these were more necessary back then as electronics was much more component-oriented, and a lot less reliable, and there was a need to be able to fault-find and repair.

    A couple of months back I bought a 'vintage' oscilloscope, a Hewlett-Packard 180A, still in good working order. A familiar item from the past ...
    The 'Operating and Service Manual' has Principles of Operation, full schematics with waveforms and voltage annotation, circuit descriptions, components lists with reference designator maps, calibration and fault-finding instructions.
    A real boon when it developed a fault, allowing easy analysis of the cause and fix.
    Again the circuit detail has been essential in exploring another minor problem - the delayed timebase does not function.
    It didn't take long to deduce that an n-channel Jfet in the sweep comparator appears to be faulty, so the delayed timebase never gets triggered.
    I'm currently awaiting a 10-pack of hoped-for equivalents (the original HP part number is a 'special selection' with no info on specifications) of which you're totally spoiled for choice on eBay or Aliexpress.

    All good fun when you've got a bit of time to tinker and the inclination to do so.
     
    J Sigmo likes this.
  5. TonyR

    TonyR Known around here

    Joined:
    Jul 15, 2014
    Messages:
    2,027
    Likes Received:
    1,575
    Location:
    Alabama
    Ah, yes....a lot of familiar terms, technologies and equipment mentioned above by @J Sigmo . In many ways I miss what I did as a career, oftentimes I thought it amazing they actually paid ME to do something that I loved so much I would have done for free if I didn't have any bills.

    And then I recall things that I don't miss....getting awakened 2-3 times a week by the cops at 2 AM because of a malfunctioning traffic signal or a pole laying in the road after getting knocked down, or being cursed, threatened by irate motorists, having soda and beer bottles thrown at me, being hit in the face with lit cigarettes....all of those happening more than just once or twice in almost 32 years.

    Now my daily challenge is keeping my Pillminder filled, opening small boxes, and keeping appointments to the VA doctors, chiropractor, podiatrist and dentist. And working on the wife's 'Honey Do List'.

    Wish I could get paid every time I peed.....I'd be rich! :facepalm:
     
    J Sigmo likes this.
  6. Kymadn

    Kymadn Young grasshopper

    Joined:
    Feb 17, 2017
    Messages:
    38
    Likes Received:
    3
    So i was totally wrong about the camera i/o's commoned together. It definitely does not like it. First night tonight we ran the alarms in the scheduled time zone. Alerts and SMPT emails were sending out as a security guard was patrolling the area at midnight. The problem i had tonight was that when a camera detected motion and closed the contact, after checking the settings in the other linked cameras. I found the "video detect alarm enable" check box had changed from checked to unchecked. Some of the region highlighted areas slightly changed too. So for now i have disabled all relay contacts and reverted back to just using email notifications.

    When i installed these camera it was tight for space in the conduit so i was trying to get away with a single 2 pair wire. Clearly another mistake. It looks as though i will need to pull a new wire through with more strands to separate the I/Os. Attached is my complete network diagram. Can anyone draw me up what they think would be the best way to wire these alarms? The 2 light poles are my main focus. The anaconda site i can disconnect one camera I/O's and run a single camera alarm off the 2 pair wire.

    Trying to make this right but i only have my self to blame for not testing it thoroughly enough.
     

    Attached Files:

    Last edited: Sep 13, 2018
  7. alastairstevenson

    alastairstevenson Known around here

    Joined:
    Oct 28, 2014
    Messages:
    8,849
    Likes Received:
    2,495
    Location:
    Scotland
    I don't see how you wire the alarm outputs would affect the alarm configuration settings in the camera.
    Unless there is some disruption to the power supply that somehow bothers the configuration - which might happen if the outputs were fighting each other as they are actually push-pull as opposed to open collector / open drain / to close the circuit to GND.
     
    J Sigmo likes this.
  8. awsum140

    awsum140 Getting comfortable

    Joined:
    Nov 14, 2017
    Messages:
    640
    Likes Received:
    392
    Location:
    Southern NJ
    I think you're seeing the effects of input impedance on the automotive relay being, relatively, very low while the input impedance of the solid state relay is relatively high. As Murphy says, unexpected results at the worst possible time.
     
  9. J Sigmo

    J Sigmo Pulling my weight

    Joined:
    Feb 5, 2018
    Messages:
    192
    Likes Received:
    125
    I think @alastairstevenson is hitting the nail on the head.

    Consider:

    We've still not measured the output voltages from any single camera by itself.

    The meager documentation states that the alarm output is "12V 300mA". That doesn't tell us what the outputs really do. But to me, the fact that they don't give a range, or upper limit for the positive voltage, implies that this is NOT an open collector output. If it was an open collector to ground, they'd give a maximum current and a maximum voltage that this output transistor could handle. Sort of like giving some of the specifications for an NPN transistor (max collector current and max collector voltage, since it would be the collector that would be tied to the "alarm" output lead for the camera).

    I still don't think it was ever the relay that was causing the problem or else the solid state relay would either make no difference or would make the latching worse. The inductive kick from the mechanical relay is not present now with the solid state relays. So it must be paralleling the alarm leads that's causing problems at this point.

    If I was there, I'd separate one camera's alarm output from everything else. Then I'd measure the voltage with respect to ground on its alarm lead both triggered and untriggered.

    In the untriggered state, I'd want to find out if the output is trying to sink to ground versus just going "open circuit", and this will take a bit more effort (but not much, really). And this testing will pay off by letting us know if the output can pull both directions or only one.

    Just to start, I'd get a 1000 ohm resistor and a clip lead. I'd cut the clip lead in half and solder the resistor in so that you've got a "1000 ohm clip lead". A simple test light would also work, but this will work with your voltmeter and tell us a bit about saturation voltages.

    Now, connect one end of the clip lead to each of your volt meter's probes. You've now got a voltmeter with a low (1000 Ohm) input impedance instead of the usual 10 megohms.

    With the alarm untriggered, using this rig, measure the voltage at this isolated (not tied to anything else) alarm lead from ground. Then measure that voltage with respect to your 12V supply's + output. (This assumes that your 12V supply still has its common tied to the camera's ground and is powered up).

    Now make those same two measurements with the camera triggered.

    You can make a chart showing the voltages for each of these measurements (four measurements total).

    Alarm Lead Triggered with respect to ground with 1000 Ohms Load
    Alarm Lead Untriggered with respect to ground with 1000 Ohms Load
    Alarm Lead Triggered with respect to +12V with 1000 Ohms Load
    Alarm Lead Untriggered with respect to +12 with 1000 Ohms Load

    With this, we can see exactly what the camera's alarm output is trying to do. At least with about a 12mA load on it.

    If the camera's output is meant to be a "logic" output, and pull both high and low (like a CMOS output or a TTL "totem-pole" output), then you cannot just wire the camera's alarm outputs in parallel.

    Doing so will cause the cameras to "fight", with one trying to pull high while the other is pulling low. And we have no idea what mayhem this will create within the cameras.

    If they are capable of pulling both high and low, then we also need to know when they pull high and when they pull low. Do they pull high when triggered, or do they pull low? Presumably, they pull low when triggered, but I'd want to check and know for sure.

    I wouldn't worry about pulling any new wire or doing anything until we establish exactly what the cameras' outputs really do. We may never know what the actual circuitry is, but we can work around that as long as we understand what the outputs are trying to do.

    Do those tests on one lone camera, establishing exactly what the outputs try to do, and then we'll know exactly how to wire things up. It might only require using the "diode OR" wiring I described earlier, or some variation on that. In any case, I think it will be simple and not require pulling any new wires.
     
  10. Kymadn

    Kymadn Young grasshopper

    Joined:
    Feb 17, 2017
    Messages:
    38
    Likes Received:
    3
    Guys can we stay on topic please. I did not start this thread to chat about old oscilloscope, test equipment and CDC computers. I was hoping to put a few heads together and get some feedback from like minded techys on my project.

    Forget the automotive relay. Its gone and replaced with a solid state relay. That problem is resolved and we are talking about a different issue now.

    Trust me mate i am 100% sure that the video detect alarm disabled itself on all my cameras. What happened was i started receiving emails alerts from 11PM when a security guard was doing his first patrol. He walked past all my cameras. I could see the siren/strobe set off. Then security did a second patrol and NO emails came through, No alarms at all. i logged in and i found all of the cameras had disabled the video detection alarm. So i re-enabled the alarm on all cameras but this time i disabled the "alarm relay". For the remainder of the night up to 4:30AM i received multiple emails as the security guards did several more patrols through the night.

    Now.... Because i commoned the cameras camera ground on 1 wire and Alarm 1 Out on the other wire to switch the SSR on. Whats happening is the other cameras are sensing a close contact on the the alarm output when a different camera at the same location is motion detecting on the same 2-pair wire. I believe the camera is smart enough to detect that the alarm output has closed but there is no motion detect. It then switches off the motion detect alarm as protection.


    The document specification for the I/O stating 12V, 300mA is the Maximum voltage and current handling. What happens when the camera is motion detecting is i get a contact close between the camera ground wire and alarm out wire.
     
  11. Kymadn

    Kymadn Young grasshopper

    Joined:
    Feb 17, 2017
    Messages:
    38
    Likes Received:
    3
    I believe i have come up with a solution to isolate the camera I/O's. If this works all i would need is to put a few diodes on each camera and i can use the existing wiring and relay. This should at least stop the other cameras which are commoned together from sensing a contact close from a different camera.

    *Attached updated schematic*
     

    Attached Files:

    TonyR likes this.
  12. TonyR

    TonyR Known around here

    Joined:
    Jul 15, 2014
    Messages:
    2,027
    Likes Received:
    1,575
    Location:
    Alabama
    That should prevent the issue you described...for what it's worth, I'm looking at my hand-drawn sketch of the same thing, only diff is I used 1N4001 (1.0 Amp) diodes, was going to make it look nice and post it but you're on it, man! :headbang:

    Basically, the steering diodes create a n-input 'OR' gate (negative logic, low true) to drive the relay coil.
     
    Kymadn likes this.
  13. Kymadn

    Kymadn Young grasshopper

    Joined:
    Feb 17, 2017
    Messages:
    38
    Likes Received:
    3
    Thanks mate. I really hope this solves all my problems. A 1N4001 would probably be better. I just grabbed a 1N4004 because i already have a few. I have ordered 4 new cameras so i can test this setup on the bench before i head back to the job site to fix the issues.

    I will let you guys know how it goes. If anyone else has some feedback on this schematic i would love to hear it.
     
  14. J Sigmo

    J Sigmo Pulling my weight

    Joined:
    Feb 5, 2018
    Messages:
    192
    Likes Received:
    125
    I've removed the superfluous content from my posts to this thread.

    Using isolation diodes to OR the signals will likely fix the problem regardless of whether the outputs are "open collector" or "push pull". So I can't see why this won't work just great!

    The 1N4004s are fine. The only difference in the specifications is the maximum reverse voltage rating. Having a "too high" max reverse voltage won't hurt a thing. And they cost almost exactly the same, at least in reasonable quantities from most vendors. So if I'm keeping a bunch of general purpose 1A diodes on hand, why not get the ones with the higher breakdown voltage?

    Your solution will almost surely work.

    Of course, being the inquisitive type, I'd love it if you do perform the bench tests I outlined above, with the 1000 ohm "load", if you have the time to play with it that way.

    Thanks!
     
    Kymadn likes this.
  15. Kymadn

    Kymadn Young grasshopper

    Joined:
    Feb 17, 2017
    Messages:
    38
    Likes Received:
    3
    Anyone know if you can turn off the second SMPT email alert which comes back after the alarm:

    Alarm Event: Motion DetectionStop
    Alarm Input Channel: 1
    Alarm Stop Time(D/M/Y H:M:S): 15/09/2018 00:04:26
    Alarm Device Name: LP1_CAM_4