Skip to content
Python scripts to add pan-tilt action buttons for motioneye using an Adafruit PCA9685 servo controller
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Mar 22, 2017
LICENSE Initial commit Mar 22, 2017
README.md Update Readme.md Mar 22, 2017
down_1 Add files Mar 22, 2017
horz_pos Add files Mar 22, 2017
left_1 Add files Mar 22, 2017
pan-tilt.jpg Add files Mar 22, 2017
right_1 Add files Mar 22, 2017
up_1
vert_pos Add files Mar 22, 2017

README.md

motion_eye_servo_action

Python scripts to add pan-tilt action buttons to motionEye using an Adafruit PCA9685 servo controller

Purpose and features

Collection of Python scripts to add pan-tilt action buttons to motionEye.

A pan-tilt bracket, equipped with two SG90 standard servos is wired to an Adafruit PCA9685 16-channel servo driver to control a Raspberry Pi Cam.

Image

The scripts add action buttons (up/down, lef/right) to the camera overlay, in order to pan/tilt the camera. Current servo positions are stored as integer values in file vert_pos and horz_pos.

Wiring

Adafruit Shield -> Raspberry Pi

  • V+ -> +5V
  • Vcc -> +3V
  • SDA -> SDA
  • SCL -> SCL
  • EO -> BCM_GPIO18
  • GND -> GND

Vertical servo -> Channel 0 Horizontal servo -> Channel 1

Since micro servos tend to make some noise when idle, they can be powered-off by pulling the Enable Output (EO) Pin to HIGH.

Installation

The scripts require the Adafruit PCA9685 Python library, available from:

git clone https://github.com/adafruit/Adafruit_Python_PCA9685.git
cd Adafruit_Python_PCA9685
sudo python setup.py install

Files must be copied into the motionEye configuration directory, which is usually located at

/etc/motioneye

Pyhton scripts must be made executable with:

sudo chmod 755 /etc/motioneye/up_1

In case that you have multiple cameras connected, you may have to rename the files to match your camera_id

Please note that you have to adjust servo_min/servo_max value for both, the vertical and horizontal servo.

Credits

You can’t perform that action at this time.