Interface Options

From ACCX Products Wiki
Jump to: navigation, search

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

Wiegand Whitepaper from HID

Wiegand Interface (Wikipedia)

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

Whitepaper explaining Clock and Data Protocol(DSX Inc.)

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

Wikipedia RS-485 article, very complete

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

RS-232 Protocol (Wikipedia)

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

Ethernet

Power over Ethernet (POE)

Ethernet Support for Microntrollers article

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

CAN BUS Description Linux CAN BUS Project

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: [1]

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.

Like wired 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

802.11 Protocol (Wikipedia)

Xbee (802.15)

A lightweight wireless protocol designed for short-range connections between a single pair of devices or a meshed network of devices. In mesh configuration, a master and slave arrangement exists.

Electrical Signalling

Uses unlicensed 2.4Ghz RF signalling. Power levels range from less than 1mw to over 100mw.

Recommended Implementation

Typical implementations include ready-to-use modules that communicate via TTL serial. Some embedded CPUs have built-in Xbee circuitry, making it necessary only to implement an antenna and matching network for the RF signals.

Further Reading

Wikipedia Xbee Article

Z-Wave

Z-Wave is a short-range wireless protocol used for home automation in the U.S. Schlage and some other lock manufacturers have begun to support this protocol for wireless and stand-alone door lock installations.

A variety of sensors, controllers and gateways are available, and modules are available to OEMs for integration.

Further Reading

Z-Wave Site

Cellular (GSM/CDMA)

The cellular network can be utilized for backup signaling or for access where no dedicated Internet connection exists. Various cellular devices are available as modules, Ethernet to cell gateways, USB sticks, and phones with SDKs.

Recommended Implementation
  • Android phones with Android SDK
  • SPI-controlled cellular modules (GSM)
  • Serial-interface cell modems
    • Typically use AT command set
  • Wireless hotspot devices
    • Use 802.11 Ethernet
  • USB EVDO modems