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 (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 liking GoLang quite a bit, so 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 search 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 (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 over wifi!

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)
DIY remote controlled pan & tilt CCTV using Raspberry Pi, 5.0 out of 5 based on 1 rating

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.