CCTV protocol converter


Senior Member
Conventional (Old fashioned) wired CCTV systems use commands distributed over serial RS485 cabling for Pan-tilt-zoom (PTZ) and other controls. There are various protocols ("languages") for the command format.

We got some old LG brand cameras, planning to use them in an existing wired CCTV system. But the LG cameras listened only for a proprietary LG command protocol, and unusually did not offer an option to switch to the much more common Pelco-D format used by the existing system.

I made a Picaxe protocol converter, which listens for Pelco-D commands on one serial bus, converts each one to LG format, and retransmits over a separate serial bus to the LG camera dome(s).

Hardware is a Picaxe 08M2, on a protoboard, which also provides room for a simple rectifier + capacitors + 7805 regulator. This allows the converter to be powered by the same 24V AC supply used for commercial cameras. The TTL serial in/out from the Picaxe board are converted to & from RS-485 by two cheap TTL-485 modules, available on eBay for a few pounds.

I did not find any documentation for this LG protocol, but was able to work out most of it with the lucky find of an LG control joystick and a serial monitor program on a PC. Pelco-D docs can be found on the Web.

Converter program
View attachment pelco_lg_converter_a.bas

A crude "autobaud" feature is included, which relies on seeing the expected Pelco-D input.
This program can undoubtedly be improved! but is perfectly functional for our use.
The comments include warnings that it is not ideal for multiple LG cameras, but in real life it works well enough for us.

Please feel free to re-use all or part, including adaptation for other purposes and protocols.

cheers, Ross K.