Notes on Pelco-D

Posted on Tuesday, December 19, 2006 04:18 PM by K. Latham
The following are my notes on using the Pelco-D protocol to control PTZ cameras. Your research my vary. This post will update as I jot down more notes.

The Pelco-D format is used in controlling PTZ (Pan/Tilt/Zoom) cameras.

Pelco-D consists of 7 hexadecimal bytes

Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
Sync Camera Address Command 1 Command 2 Data 1 Data 2 Checksum
  • Byte 1 - The synchronization byte, fixed to FF
  • Byte 2 - Address of the camera being controlled (Address 1 is 01)
  • Byte 3 & 4 - Command 1 and 2 are illustrated below
  • Byte 5 - Pan speed, range from 00 (stop) to 3F (high speed) and FF for "turbo" speed (the maximum pan speed that the device can go)
  • Byte 6 - Tilt speed, range from 00 (stop) to 3F (maximum speed)
  • Byte 7 - Sum of bytes (excluding the synchronization byte), then mod 100 (Decimal code: 256)
  Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Command 1 Sense Reserved Reserved Auto / Manual Scan Camera On/Off Iris Close Iris Open Focus Near
Command 2 Focus Far Zoom Wide Zoom Tele Tilt Down Tilt Up Pan Left Pan Right Fixed to 0

Pelco-D cameras use No parity, 8 Data bits and 1 Stop bit, baud rate depends on your camera setting. (Example 2400, N, 8, 1).

RS-232 to RS-485/422 Interface Converter

You will need an RS-232 to RS-485 interface converter to communicate with the Pelco-D camera. Life Lesson: the 5v terminal is NOT a power in. (Back of package scan for converter: backofpkgrs232-485.pdf)

I've posted my reference links at del.icio.us with the tag: PTZ.

Other Notes:
  • Turn on scan use command 1 &H90 (Auto/Manual Scan + Sense).
  • Turn off scan by panning left or right, stop doesn't seem to work on scan.
  • PTZ Camera I'm testing with doesn't seem to have speed control.