DIY remote controlled pan & tilt CCTV using Raspberry Pi

RPi CCTV in Action :

A simple web interface to control the RPi CCTV :

What you need to build this (hardware) :

  1. Raspberry Pi (1)Preferably Raspberry Pi-3, for on-board wireless, or Raspberry Pi Zero W, although you can achieve similar result without much effort using other boards
  2. Pan & Tilt frame, I used one available here on amazon :
  3. 2 servo motors. I used sg90 micro servo motors since I had them handy, however you can also use other similar ones available

I have recently started learning GoLang, and I decided to try to make use of it for a small IOT project that I’ve been meaning to do for a long time. In my research I came across Gobot, which is a framework for building robots written in golang. It comes with support for a lot of development boards available in the market such as Raspberry Pi, Beaglebone, Arduino, and several more. Not only that it also has drivers available for a wide variety of devices which can be used to create all sorts of nifty robots.

Here is the repository with all the source code :

NOTE : In order to generate PWM (2)Pulse Width Modulation signals while using Gobot, you will need to install This was required in my project since servo motors are controlled using PWM signals.

The best thing about Gobot is that with very little code I was able to expose the entire hardware (the 2 servo motors) via a JSON API. This meant that I could easily create user interfaces for the web / mobile and by consuming the API I could control my CCTV camera remotely!

comments powered by Disqus