1. Home
  2. Docs
  3. Cameras for Raspberry Pi
  4. PTZ Camera
  5. Application Note

Application Note

Introduction

  • Auto zoom lens controller is an i2c slave device. You can control the lens through the i2c bus. The slave address is 0x0c( 7bits address). Many registers are provided for user to write and read. Users can write and read them referring the i2c write timing and i2c read timing we provide.For example, if you want to set the value of the zoom steps, you can write the value to the 0x00 address.

1. Register

  • 1.1. I2C format (Slave address(7 bits): 0x0C)
  • Write Operation
I2c Write Timing
  • Read Operation
I2c Read Timing

Register Table

AddressFunction
00HZoom steps
01HFocus steps
02HZoom speed
03HFocus speed
04HLens motor state
05HServoX angle values
06HServoY angle values
07HZoom max value
08HFocus max value
0AHReset the zoom
0BHReset the focus
0CHIR cut control


1.2. Detail descriptions of registers

  • ZOOM steps [15: 0 ]
reg_00

This is zoom steps data register. It is used to buffer the zoom steps data. When the user value is written to the register, the zoom step motor will rotate to the set position. Read it to get the current position of the zoom motor’s rotation.

  • FOCUS steps [15: 0 ]
reg_01

This is focus steps data register. It is used to buffer the focus steps data. When the user value is written to the register, the focus step motor will rotate to the set position. Read it to get the current position of the focus motor’s rotation.

ZOOM speed [7: 0 ]

reg_02

This is zoom speed register. It is used to buffer the zoom speed data. When the user value is written to the register, the zoom motor’s speed will change to the set value. Read it to get the current speed of the zoom motor’s rotation.

  • FOCUS speed [7: 0 ]
  • [x]:no use

This is focus speed register. It is used to buffer the focus speed data. When the user value is written to the register, the focus motor’s speed will change to the set value..
Read it to get the current speed of the foucs motor’s rotation.

  • Lens Motor State [0]
reg_04
  • [x]:no use

This is state register which just support read. Read it to get the current state of the lens
Motor.

  • 0: The lens motor is idle.
  • 1: The lens motor is busy.
  • ServoX angle values[11: 0 ]
reg_05
  • [x]:no use

This is servoX angle value register. It is used to buffer the value of servoX. When the user value is written to the register, the servoX will rotate to the set angle. Read it to get the current angle of the servoX.

  • ServoY angle values[11:0]
reg_06
  • [x]:no use

This is servoY angle value register. It is used to buffer the value of servoY. When the user value is written to the register, the servoY will rotate to the set angle. Read it to get the current angle of the servoY.

  • Zoom max value
reg_07
  • This is zoom max value register. It is used to buffer the zoom value. When the user value is written to the register, the zoom max value will change .Read it to get the current zoom max value.
  • Focus max value
reg_08
  • This is focus max value register. It is used to buffer the focus value. When the user value is written to the register, the focus max value will change. Read it to get the current focus max value.
  • Reset the zoom
reg_0a
  • [x]:no use
  • This is reset the focusregister. It is used to reset the focus. When the 0 is written to the D0, the focus will reset.
  • Reset the focus
reg_0b
  • [x]:no use
  • This is reset the focus register. It is used to reset the focus. When the 0 is written to the D0, the focus will reset.
  • IR cut control
reg_0c
  • [x]:no use
  • This resgister is used to control the IR cut. Write the 1 to the D0 to enable the IR cut. Write 0 to disable the IR cut.

Operation Mode

  • The following steps are advised to control the lens
  • Step1: Before you read or write the register, You’d better read the state register to ensure the lens motor is idle.
  • Step2: If the lens motor is idle, read or write the new value to the register you want.

Was this article helpful to you? Yes 1 No