Close
0%
0%

PSX2PTZ: PTZ camera control using PSX controller

Allows you to use a wireless PS2 controller for controlling PTZ cameras using RS485

Similar projects worth following
This project came about from my dislike of using CCTV software based PTZ controllers, and external wired controllers. Wouldn't it be cool if you could use a Playstation wireless controller to control your CCTV PTZ cameras from the comfort of your sofa?

This project is only for use with PTZ cameras which use RS485 two wire serial connection. It will not work with UTC PTZ cameras (Up The Co-ax).

The physical external connections are simply a 12v power supply, and 2 wires for the RS485 serial connection (A,B).

Firmware features:

  • Analog joystick control for pan, tilt, zoom, focus
  • Button control for pan, tilt, zoom, focus
  • Save/Clear Presets
  • Goto Presets (up/down)
  • Supports multiple camera devices on rs485 bus
  • Auto fast pan tilt speed on prolonged hold
  • OLED display shows commands and 7 byte sequence for pelco commands
  • Serial debug output on TX pin @9600 baud

Hardware design decisions:

  • use 12v from cctv supply
  • use a 5v buck reg, as a linear reg would get hot dropping 12v to 5v
  • use a linear reg to drop 5v to 3.3v to supply the PSX RX board
  • keep it modular. Use off the shelf modules + perfboard + wires
  • Squeeze it into the case i already have.
  • use SPI bus for PSX RX comms
  • use I2C bus for OLED display comms
  • use UART for serial debug output via header pins.

Software design decisions:

  • use UART for serial debug
  • use bit-bang software serial for RS485 TX comms
  • use bill porters ps2 library for rx comms
  • use u8g2lib (u8x8) for OLED display control
  • use Platform IO and VScode as the IDE with USBASP as the programmer

Public GITHUB Repository:

https://github.com/deoscode/Ps2Ptz_GPL

PSX2PTZ_v1_Schematic_0001.tif

hardware schematic, hand drawn

Tagged Image File Format - 8.30 MB - 09/03/2021 at 16:03

Download

  • 1 × 5v buck regulator (mp2307 adjustable step down)
  • 1 × 3v3 linear regulator (ams1117)
  • 1 × Arduino Nano pro mini
  • 1 × OLED display (128x32) optional
  • 1 × RS485 interface (max485)

View all 6 components

  • Controller connectivity Issue

    deoscode05/21/2023 at 15:41 0 comments

    The code is designed to allow wireless controllers to connect after powerup. This seems to work "most" of the time. Occasionally a wired controller is not detected on power up (stays in Connecting... state), but requires a reset before it connects. Needs further investigation.

  • Schematic Mod

    deoscode05/21/2023 at 15:32 1 comment

    This works just as well with a wired controller as it does with a wireless receiver module.

    My wireless receiver died for some reason, hence the switch to wired controller until i get my hands on another one. As a precautionary measure I have introduced a 10Kohm pull up resistor to 3v3 for the incoming DATA line.

    I will update the schematic to reflect this when I get a chance.

  • Source Code v1.10 avaialable

    deoscode05/21/2023 at 15:22 0 comments

    Apologies, I started adding features (such as config menu, preset buttons, snoop mode etc),then life got in the way.

    I have submitted my original source code v1.1 release to github:

    https://github.com/deoscode/Ps2Ptz_GPL

  • Sept 21

    deoscode09/04/2021 at 20:10 0 comments

    Seems to be working well.

    Finishing off the preset up/down clear/save code.

    Need to tart up code for github.

View all 4 project logs

  • 1
    wire up

    Wire up the schematic as shown.

    I kept nano, max485 and oled  removable.

    nano is removed and flashed externally.

    source code and hex file on its way....

  • 2
    crib sheet for components

View all instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates