Decoding the decoder

A project log for Controlling a cctv camera with arduino!

A dream school project: control one or more cctv cameras with only a arduino

pixelboPixelbo 02/13/2022 at 10:201 Comment

Thanks to the various websites on the net I was able to get the protocol that Pelco used  (Thanks to my teacher to who found it before me).

The protocol is very simple, it's called PELCO-D and it work like that:


Byte0: Sync
Byte1: Address
Command 1
Command 2
Data 1
Data 2
Always FF
In our case 01
see belowsee belowsee belowsee belowsum of everything except sync modulo 100

The list of commands available can be found here.

So with that in mind I wrote a little program on arduino and set 3 messages:

The first was turn to left then was stop and after 2 seconds, it was a query to the pan position.

And to my surprise, it worked! 

However what about the query, so I hooked up the oscilloscope on the wires and began searching for the response.

But if you remember well, there was a pair of cable that was for 3v and gnd. So I probed those cables and then bang, a response:

So we have a pair of cable for TX and one for RX, only one pair of cable remains unknown.

Having figuring out that reading a rs485 protocol on oscilloscope was hard, I switched onto a logic analyzer on my computer.

And here is the response to my query:

So if you watch closely, it is supposed to be response claimed by the website up above.

So stay tuned because next time, we'll update the arduino code and understand what is the content of the response!


Pixelbo wrote 02/13/2022 at 10:37 point There is a lot more of commands, I won't test it all, only the most important (I'll will not go about auto focus or focus far,...)

  Are you sure? yes | no