PDA

View Full Version : Alarm Contact



Pesticida
- 10th October 2005, 19:59
Hi People I have a great Software and Hardware problem !
I want to make one Alarm contact like in this photo:
When I open the contact i need on the pic, state "Alarm",when i make a shortcircuit between the two wire i need the state "Sabotage".
How can I do this ,I have tryed with Pot command but the entire system is too sensible.I dont know if I can connect like in the image direct to portA.
I need the 10K Resistor while without resistor i have just one state ex. "Sabotage".
In professional Alarm Ciruits they all use 10 K or 12 K Resistors.
I need that the PIC recognize that a 10K resistor is on the portA.
Please for help.
Thanks !!!
Bye Pesti

BigWumpus
- 11th October 2005, 14:52
Just put another 10K-resistor from PortA-Pin to Vdd.
Then You can measure the voltage on the pin.

>= 0,7 * Vdd - the circuit is broken (Switch is open)

<= 0,3 * Vdd - the circuit is shortcut

Ron Marcus
- 11th October 2005, 14:53
Your description lost a little in the translation. Are you looking for two statyes out of your loop, or three? For two states, make your pin an input, and it it is on a port with weak pull up, enable it. If not, place a 47K resistor between the pin and B+. Drop the resistor to ground to 1K and when the switch is opened, the port will read high, when closed, it will read low.

Hope this helps,
Ron

Pesticida
- 11th October 2005, 17:59
Hi,thanks for the help,
Sorry my english is very bad,Yes what I mean is three states Switch is:
Closed = Normal State,
Open = Alarm State,
Between the wires is a Shortcircuit = Sabotage

I want that the PIC recognize when a 10 K is in the loop or not,when is not a 10 K then is alarm ,when i have on the port ~0 Ohm then is sabotage and when I have open loop then is Alarm.

BigWumpus what commands I need to measure the voltage,what you mean with 0,3 and 0,7?

Thanks a lot !!!
I hope you can help me.
Bye Pesti.

Darrel Taylor
- 13th October 2005, 03:59
I think this is what BigWumpus meant. But the tolerances are a bit tighter than the 0.3 and 0.7 times VDD. Catches more hackers. And still leaves room for 5% (or worse) resistors.
http://www.darreltaylor.com/files/Alarm_Contact.GIF

And, it's better to take a Reading when the system is Initialized, and use an even tighter tolerance from that reference point to determine if a TAMPER has occured.
<br>

BobK
- 13th October 2005, 12:41
Good morning to all responding to this post.

The purpose of an "end of line resistor" is to supervise the loop. What you are working on here is fine but the supervision resistor needs to go between the ground point and the switch. This way if the wiring to the switch gets scraped while installing or the staple goes thru the cable and shorts out the contact it will be detected properly. Most modern day systems use either 1K or 2.2K resistors as the EOLR. A few use 1.5K.

BobK (31 years as alarm installer)

Luciano
- 13th October 2005, 15:09
Hi,

Darrel's schematic:

The components R1 and S1 are grouped into a dotted-line box,
corresponding to a physical unit. (R1 is inside an enclosure with S1).

* * *

It dosen't matter on which contact of the switch S1 the resistor R1 is soldered.

The system is secure only if the switch S1 and the resistor R1 are
in the same enclosure and coated with resin. (One physical unit).

If you put more than one switch in series on the same line, the system won't be secure.



Not secure system

+5 --R2--┐
|
AN0 -----┴-----------S1--------S2-------S3---------S4R1--┐
|
GND -----------------------------------------------------┘


Secure system

+5 --R2--┐
|
AN0 -----┴-----------------------------------------S1R1--┐
|
GND -----------------------------------------------------┘

(R2 is inside the microcontroller enclosure).


Best regards,

Luciano

Pesticida
- 13th October 2005, 17:49
Thanks to all for the answers,but what command I now need to measure this Voltage I have a PIC16F870 with 20Mhz .
What happend when i have a wire ~ 100-300 Meter long.
I dont know how sensitive is a PIC controller.

Thanks a lot People!!!

Bye Pesti.

Pesticida
- 13th October 2005, 19:30
I think that I can use the Alarm circuit like on my draw !?

I have three States,Cicuit :
Magnetic Contact is closed: No Alarm (5K6 Ohm)
Magnetic Contact is Open: Alarm (6K4 Ohm)
Cable Tamper or Alarm Box Tamper is open : Sabotage
ShortCircuit on the loop : Sabotage


The Contacts are inside a door and on the Security side Zone.
I think so is ok or ?
Bye Pesti.

Darrel Taylor
- 13th October 2005, 23:11
Well, I don't have 30 years experience at anything, except "Beer Processor". &nbsp; I just pour it in one end, and it comes out the other in about a half an hour. &nbsp; So, maybe I'm not the guy to listen too....but...


It seems to me that most alarm systems are contained within the same perimeter that it is protecting. While the movies always seem to have a key element of the system located in an unsecured area where it can easily be defeated by cutting a couple wires and using some alligator clips. &nbsp; That's not very realistic.

If any tampering is going to be done to the system, you would first have to breach the perimeter to get to the wiring in the first place. Which of course would set off the alarm.

So, the time when the tampering occurs, is when then system is dis-armed, and people are walking around everywhere unchecked. If you can by-pass sensors during the day, you can come back at night and clean the place out.

In the case of alarmbox.BMP in post #9, all you need to do is twist the two pairs of wires together, and your done.

And, in Luciano's example, you can just bypass any switch with a short, and you're in.
Not secure system

+5 --R2--+
|
AN0 -----------------S1--------S2-------S3---------S4R1--+
|__| |__| |__| |
GND -----------------------------------------------------+

Personaly, I think you are better off using the original plan.

And, you would use the ADCIN statement to read the input. I think that's what you're prior question was??

Melanie
- 14th October 2005, 00:17
Most alarm systems I've come across have a series Resistor in each Sensor. Attempt to bypass the Sensor (with Darrels aligator clips) and you unbalance the circuit setting the Alarm off. But hey, who am I to comment... I'm not thirty yet!

Pesticida
- 14th October 2005, 15:47
Ok thanks people,now I know what i have to do.
I made a Security Software in Visual Basic,for the moment for 4 Alarm Contact.
I have work two week on this Software,the most lost time was on the PIC
controller.

Thanks !!!
Bye Pesti

Normnet
- 15th October 2005, 01:34
I think this was from Forrest Mims. Intelligent Alarm.

Alarm resisters of different values in series.
Each window/door if opened closes across a resistor?
Total resistance (Pic AD) indicates which resistor is shorted.
Even with combinations of resisters shorted it can be determined which windows are opened.
Tamper is if not one of the combinations.

Norm

Luciano
- 15th October 2005, 10:09
Hi,

What about an alarm system based on RS-485 supporting up to 32 devices (even 128)
with maximal network length of up to 1500m?

With the master PIC you could:

- Query the status of the slave PIC.
- Reset the alarm status of the slave PIC.
- Turn the light on and off inside the room via slave PIC.
- .....
- .....

Also with the VB program talking to the master PIC via RS-232 you could
dynamically define areas which are protected also during the day and monitor/log
the activity of each slave and and therefore know which window/door you will
have to check before you leave the building.
What about verify the temperature of the air-conditioning in the computer server room?
There are no limits here.....

Best regards,

Luciano
Star Trek Security Systems

Pesticida
- 15th October 2005, 18:59
Hi,
This is a very good Idea Luciano with Master and Slave ,
did you know where can I find Schemas about RS-485.

Bye Pesti.

Luciano
- 16th October 2005, 00:35
Do a search on this forum for "RS-485" or "RS485".

Luciano

Pesticida
- 16th October 2005, 12:35
Hi,
I found this schema I think this is ok?
Have anybody experience with RS 485 connections.

The Alarm Contact with the two resistors like on my Alarm Box works just fine.
I have now three states:Alarm,Normal,Sabotage.
Thanks People for the help!!!

I made that my Visual Basic Software send every second data to PIC and back,the Software saves the data (Contact States+Date+Time) on one file and then the Software read the data from the file and shown on the GUI,when the State is Normal I can reset the Alarm, and so on.
All is working very good but I must to expand the capability.
For the moment I can adjust the time interval,map load,save the Contact coordinates on the map,text for the contacts,pictures for the contacts,Port adjustment,Sound on Alarm.
I want to made this what Luciano mean with Master und Slave,any Slave Pic have a ID Adress and so on,I can adjust the adress with DIP switch.

Regard Pesti.