Interface Options: Difference between revisions

From ACCX Products Wiki
Jump to navigation Jump to search
(Created page with "'''Alarm and Security Interfaces''' == Overview of the various ways physical security hardware can communicate == ===Signalling Technologies Between Devices=== This section cov...")
 
Line 11: Line 11:


Typical 26-bit payload:
Typical 26-bit payload:
__________________________
 
P DDDDDDDD DDDDDDDD P
P DDDDDDDD DDDDDDDD P



Revision as of 12:01, 19 October 2011

Alarm and Security Interfaces

Overview of the various ways physical security hardware can communicate

Signalling Technologies Between Devices

This section covers low-level standards (electrical and data transmission) that are commonly found in existing security, access control and automation equipment. Where applicable, information about data formats and implementation tips are also included.

Wiegand Interface

This standard provides a one-way, asynchronous serial communications standard for signalling from readers to panels or other devices where access decisions are made. Typical payload includes an 8-bit facility code, a unique 16-bit user ID and a parity bit for each. Variations include a 32-bit or other payload size.

Typical 26-bit payload:

P DDDDDDDD DDDDDDDD P

Electrical signalling:

A ‘0’ and a ‘1’ line are held at +5V relative to ground. When data is transmitted, the lines are sent low for a period of between 35-500uS (measured) with a pause between bits of approximately 10X the pulse width. Reader lines can often be 500’ from the panel.


Recommended implementation

Two dedicated 5V-tolerant TTL lines on the microcontroller. A polling or interrupt-driven software scheme will need to be implemented. Note that the pulses are fast - implementations using slow clock rate chips or opto-isolators may run into problems. One work-around is to add an R-C circuit to the input to stretch incoming pulses out to 100uS or more.

Further details

[1] [2]

Clock and Data

Typically used with magnetic strip readers. Data is sent using a dedicated clock and data signal line. Data payloads can vary in size, but typically include trailing zero’s so that card data can be read backward or forward.

Electrical signalling

Two lines (clock and data) are held low until data is to be transmitted. At that point, the clock line is strobed high (+5V) to tell the receiving station to read a bit from the data line on the rising edge. A ‘0’ is represented by a low value on the data line during this window, while a ‘1’ is represented by a high (+5V) value.


Recommended implementation

Two dedicated 5V-tolerant TTL lines on the microcontroller. A polling or interrupt-driven software scheme will need to be implemented. By convention, label the ‘1’ line of a combination Wiegand/clock and data interface for the CLK line.

Further details

[3]

EIA RS-485

The RS-485 protocol is a 2 or 4 wire electrical standard that allows for point-to-point communication between a master and one or more slave nodes. Up to 32 nodes can exist on one RS-485 chain, but this is typically not done.

A variety of data formats exist for RS-485 devices, and they are often bidirectional. An interactive terminal session can also take place over RS-485. RS-485 is commonly used in alarm and security systems, industrial controls, and is found in DMX lighting controllers for stage use.

Electrical signalling

RS-485 is a differential signalling protocol, with signal levels being taken relative to a line that is separate from the 2 data lines. Implementations with 4 signal lines are full-duplex, while 2-wire implementations are typically 2-node, half-duplex. RS-485 can links can span distances up to 4000’ when used at low data rates (100kbps). Voltage levels range from -7 to +12V.

Recommended Implementation

Dedicated full or half-duplex driver chips attached to a UART on the microcontroller. Adapters exist for PC use, although they tend to be expensive.

Further details

[4]

EIA RS-232

The RS-232 protocol is a point-to-point serial protocol that is similar to RS-485, but has a shorter range and a lower maximum data rate. A wide variety of RS-232 capable devices such as GPSs, USB-to-serial adapters and I/O cards for PCs are available.

Electrical signalling

A minimum of 3 wires (send, receive, and ground) are required. A 5-wire implementation with CTS and RTS lines is also common and is used for resetting some devices preior to transmission or for activating a boot loader/etc.

RS-232 is typically used with cables runs of 50’ or less. Runs of up to 1,000’ are possible with special low-capacitance cabling. Terminations include DB9, DB25, RJ45 and screw terminals.

Recommended Implementation

Dedicated full or half-duplex driver chips attached to a UART on the microcontroller. Dedicated interface cards or USB adapters for PC use.

Further details

[5]

TTL Serial

TTL (transistor-transistor logic) is the type of serial signal that typically comes out of the UART of a microcontroller or other logic chip. It can be used to communicate over short distances to other peripherals inside the device, but should not be used externally as it lacks robustness.

Electrical signalling

A standard logic-level signal (0-3.3V or 0-5V) over two lines (RX and TX). Data rates are the same as RS-232 in most cases.

Recommended Implementation

Only use TTL serial signalling to communicate between chips on the same board or to a daughter board or shield.

Further details

Open Source Robotics and Process Control Cookbook (Lewin A..R.W. Edwards), 2005

Ethernet (Wired 802.3)

The Ethernet protocol as seen in most security hardware is a local area networking protocol capable of carrying 100Mb/s or 1Gb/s over Copper CAT-5 cabling. Typical LANs use home runs to each device, attaching to a switch in a wiring closet or computer room. Fiber optic cabling can extend a run to 1km or more using long-wave optics, and shorter runs are often used to connect devices in an electrically noisy environment.

Ethernet is a complicated protocol, and most implementations will require a TCP/IP network stack to be implemented by the microcontroller or by a separate device attached via SPI or serial.

Electrical signalling

Twisted pair Ethernet consists of 4 twisted pairs. The twist rate and quality of the cable determines the maximum data rate. Typical conductor sizes is 24 gauge.

Ethernet connections can also carry power. A standard 802.3af-2003 drop provides 44-48VDC V DC and at 350 mA for up to 14W. The newer 802.3at-2009 or POE+ standard delivers up to 25.5W.

Recommended Implementation

Most PC-like devices already support wired Ethernet. Power injectors can be added to existing networks to provide POE or POE+ capability. Higher-end microcontrollers such as the ARM series may have Ethernet built in and require only a jack and some support components.

Lower-end microcontrollers can by attached via TTL serial to a device such as a Lantronix terminal server or a dedicated Ethernet chip such as the Wiznet W5100 series which offloads some of the protocol overhead from the micro.

Further details

[6] [7]

CAN BUS (Controller Area Network)

This is a non-arbitrated serial protocol where multiple nodes share a common bus. It is most often found in automotive applications, where sensors, relays, solenoids, etc all communicate on the bus. With a CAN bus, messages contain 8 bytes of data plus priority and framing bits. Up to 1Mb/s data rates are possible over short distances, while slower (125kb/s) data rates can push the range out to 500m.

Electrical signalling

Typically implemented with 2 wires in a twisted-pair contiguration. Potentials of 7-30V are common in CAN implementations. No formal specification exists for connectors or fixed voltage levels.

Recommended Implementation

Some micro controllers have on-board CAN bus support and require only some external components. Most implementations will require a dedicated CAN bus chip from any of the dozens of vendors selling them. IP and USB-based CAN adapters are available for PCs, and there is at least one Linux package to enable support for 125kb/s CAN.

Further details

http://www.interfacebus.com/CAN-Bus-Description-Vendors-Canbus-Protocol.html http://www.armadeus.com/wiki/index.php?title=CAN_bus_Linux_driver

USB (Universal Serial Bus)

Universal Serial Bus (USB) is a high-speed serial interface common to most PCs and consumer devices. It supports a high-speed and a low-speed operation mode, also supplies power.

Electrical signalling

A shielded 4-wire cable is used to carry USB signals. The inner two conductors are differential signal lines (Data +/-) and the outer two supply +5V power at 250-1500ma, depending on the implementation. The maximum cable length is 5m, but active USB extenders are available.

Recommended Implementation: A dedicated TTL-to-USB chip such as the FTDI series is a good choice, as it has excellent royalty-free drivers available for most platforms. Alternatively, a micro controller with built-in USB can also be used.

Further details: [8]

Wireless Protocols

Ethernet (Wireless 802.11)

This is the wireless version of the 802.3 protocol. Logically similar to wired Ethernet, wireless Ethernet has different data rates (11Mb/s, 54Mb/s for 802.11 B and G, respectively) and supports encryption at the link layer.

Lile wires Ethernet, implementations will require a TCP/IP network stack to be implemented by the microcontroller or by a separate device attached via SPI or serial.

Electrical signalling

Wireless Ethernet uses unlicensed spectrum in the 2.4 and 5.8Ghz range in the U.S. 14 channels are usually avaialble, and a wireless site survey is recommended before choosing equipment and install locations. Typical implementations include wireless access points that function similarly to wired Ethernet switches and wireless radios on particupating nodes.

Recommended Implementation

Most PC-like devices have built-in wireless capability or can add it with a simple card or USB adapter. Higher-end microcontrollers such as the ARM series may have 802.11 Ethernet built in and require only an antenna and support components.

Lower-end microcontrollers can by attached via TTL serial to a wireless-capable terminal server. Implementing a wireless chip set requires careful RF board layout and is not recommend for those without microwave experience. Some vendors include a reference board layout with their chips.

Further details

[9]

Zigbee (802.15)

Cellular (GSM/CDMA)

Protocol Recommendations

All new open-source access and security hardware should support legacy protocols such as Wiegand or clock-and-data as needed, due to the variety of devices available on the market.

All newly developed panels or peripherals should support a bi-directional protocol. Our recommendation is as follows:

1. Peripheral nodes such as door readers, sensor boards and keypads should support RS-485 or CAN bus. The advantages of CAN bus include support for message prioritization, a larger address space and support for more nodes, while RS-485 is simpler and many commercial devices already support it.

2. Point-to-point serial over USB or RS-232 is acceptable for interface to a monitoring/control computer. Modern PCs have limited options for I/O, so any device that does not support Ethernet will most likely communicate with the PC either through an intermediate node or a serial USB/RS-232 connection.

3. Controller nodes that have sufficient resources to run an IP stack should be connected via Ethernet, especially if a client/server authentication model is planned.

4. For alerting and monitoring connections to the outside world, IP connectivity is going to have the fastest data rate and message delivery time of the above methods. A data-capable cellular device (GSM card or smartphone SDK interface) is an option for areas that lack connectivity or as a backup. POTS service via a serial modem is simple and robust, but lacking in functionality.