The objective of this project is to resurrect a SpeedDome 2000 so that it can be controlled using an Xbox controller. While controllers to operate this camera are still available, they often cost hundreds of dollars. This method reduces the cost significantly and allows for much greater capability.
Things Used In This Project
- Basic Soldering Equipment
- Supporting documentation:
Step 1: Connect Power
The SpeedDome 2000 requires a 24V power supply. Using the supply listed above, or any 24VAC supply that can handle 1.5A+, connect 2 wires to the two terminals on the power supply. Note: Make sure that the power supply is AC, not DC. A DC supply may damage the device.
The other end of these wires must go to the connector on the board itself. The board has two orange connectors: one called “ALARM IN” and the other “AC PWR IN/DATA I/O.” The alarm input is optional and not addressed in this project. Pins 3 and 5 of the power and data connector are where the power supply must be connected (the two red wires). Since the original cable was not available, the connector was removed so that the wires could be soldered directly.
In order to provide a 5V supply to the arduino (discussed later), a power cable can be soldered to the reverse side of the board. Look for the red plug at the top-right of the rear board (where the AC/DC converter plugs in). The red wire is 5V and black is GND. Check for continuity on the plug with a multimeter to determine polarity, where the center of the plug is +5V and the outer ring is GND.
Optional: In the case that the AC/DC converter (black box on opposite side) doesn’t work, the entire device can also be powered using 5V and 12V DC supplies. Cut off the ends of both supplies and the the red plug from the AC/DC converter. Checking polarity of the wires, solder the +12V to white, +5V to red, and both GNDs to black. Use heat shrink or electrical tape to ensure that none of the wires are shorting. If this method is used, the original 24VAC supply is no longer necessary.
Note: Before continuing, power up the camera to make sure that it works. The camera must complete an automatic calibration sequence before communication can be initiated. Bad motors can prevent this sequence from completing. Also test the video output by connecting the BNC connector to a TV. If a BNC input isn’t available, a BNC to composite adapter can be used.
Step 2: Assemble Arduino Interface
In order to control the camera, an Arduino Mega (or Uno) is used with a USB host shield and an RS-422 shield. The USB host must be placed on the Arduino first since it uses the ICSP connector. The Xbox controller will be connected to this shield.
Before connecting the RS-422 shield, the SpeedDome interface must be connected. A total of 5 wires are needed: TX+, TX-, GND, RX+ and RX-. These are connected as outlined below.
In order to get a common ground, the grounds of the SpeedDome and Arduino must be connected. Solder a wire between the center pin of the SpeedDome to a GND pin on the bottom of the shield.
The TX+/- and RX+/- pins can be connected to the screw terminals of the shield.
Step 3: Programming
In order to program the Arduino to communicate with the SpeedDome, the Sensormatic RS-422 protocol needs to be understood. Using a baud rate of 4800, every command sent to the SpeedDome requires at least 3 bytes: An address, command code, and a checksum. A successful transmission prompts the SpeedDome to immediately respond with a repeat of the address.
The first byte, the address, can be any number between 01 and 99. This allows you to control multiple SpeedDomes with the same controller. In this case, 01 is used.
The second byte, the Command Code, is the instruction. Some of the basic commands are listed below, but a complete list can be found in the Communications Protocol manual, starting on page 3.
- Control of the iris requires setting the SpeedDome to manual mode. This process is explained in the “Extras” section.
Note: Before swapping between directions with Pan, Tilt or Iris, the respective stop command
(or All Stop) MUST be sent before the opposite direction will initiate.
The last byte, the checksum, verifies that the full command has been received. This is calculated by adding the first two bytes and subtracting the sum from 00. The least significant byte is the checksum.
Example: Pan Left on address 04
04 81 7B
(04+81 = 85; 00-85 = FFFFFFFF7B)
Using the Arduino IDE, the USB host library first needs to be imported and its required variables declared.
In order for the the transmission of the RS-422 shield to be enabled, pin 2 needs to be pulled high. The pin is declared as a global variable and pulled high in the setup function.
Additional variables are declared that will later be used to allow the Arduino to “remember” the current state of each action.
Since the RS-422 shield converts the protocol to UART, serial communication must be initiated with a 4800 baud rate.
The setup function also waits until the Xbox controller is connected to continue into the loop function.
Once the loop function starts, the Xbox controller is then activated. By sending the required bytes using the Serial.write() commands with a “0x” before the hex command code, the hexidecimal number is converted to a single byte before transmitting. Since Serial.print() commands are usually meant to be readable through the serial monitor, the contents are instead converted to ASCII before transmitting, usually requiring more than one byte.
The complete program can be found here.
Step 4: Extras
The SpeedDome is also configurable using the red DIP switch array found on the top board. While switch 1 and 2 are dependent on your camera type (can be found on the sticker just below the board), the remaining swiches allow you to enable or disable other features.
As noted earlier, control of the Iris requires manual mode. By flipping switch 4, manual iris mode can be enabled.
Since this camera is intended to be mounted to a ceiling, all of the controls and camera image are flipped from the direction shown throughout this document. If a 180º rotation is desired, remove the back plate of the dome by unscrewing the 4 screws around the circumference of the camera. Unplug the camera and remove the 2 screws in the center holes. Rotate the camera 180º, replace the camera screws and reassemble.
In order to flip the controls, flip the directions of the pan and tilt in the program. The alternative program can also be found here.
Fixing Blurry Image
If the image is very blurry and facial features cannot be easily observed, one possible scenario is that the IR lens needs cleaning. Using the same procedures used above, remove the camera board to get to the IR lens. This lens can be removed by removing the two screws. This lens can be cleaned or removed to clear the image.