Design Project: Control a Pan-Tilt Platform with Raspberry Pi and Smartphone

This is purely the design for the projected. Presented is a detailed paper design of a smartphone controlled pan-tilt camera platform for exploring telepresence and POV drone and robot interaction and control.

 Introduction

A pan-tilt platform can be used to position various instruments and tools, the most common of which is a camera. The pan-tilt platform allows a user to be able to change where the camera is pointing from a remote location so that a single camera can cover a larger area than if it were fixed. It also allows for automatic control of where the camera is pointing and allows for the stabilization of cameras on drones and other remotely operated vehicles. The automatic  tracking of objects in the video captured by the camera is also possible, the video below shows the pan-tilt mechanism being used in such an application.

With recent interest in virtual reality (VR) systems and the VR experience becoming more and more cost effective and accessible (Google cardboard thingy) VR apps are starting to come to the fore and are heading for mainstream acceptance. One such application is enhanced telepresence systems such as remotely operated construction equipment or a specialist surgeon performing surgery remotely. Design Project Control a Pan-Tilt Platform with Raspberry Pi and SmartphoneThis design project presents an exploration of what might be required to build an enhanced telepresence systems where the user is able to control a camera mounted on a remote platform such as a drone, remotely operated ground vehicle or just a fixed position in a remote location.

 The basis for this project will be an raspberry pi controlled pan-tilt platform controlled by a smartphone that communicates with the raspberry pi via Bluetooth. A block diagram of the proposed system is shown in figure 1 below.

The smartphone will server as the main user interface to the systems. It will have an app that will capture movement and orientation information from the internal accelerometer and transform these into control signals for the raspberry pi pan-tilt platform. The control signals will be sent via Bluetooth to a Bluetooth module on the raspberry pi, the embedded code on the raspberry pi will then decide how to position the camera via the pan-tilt mechanism. The video feed supplied by the camera is relayed back to the smartphone via WiFi and is displayed to the user via the app.

 This setup allows the user to control the position of the camera by just moving his phone and when mounted as a VR display the camera is controlled by the user  just moving his head. This gives a greater sense of immersion and intuitive control when viewing a remote location by a drone or otherwise.

 System Components

The components required for this system are listed below and relevant  links to buy them on amazon.

  • Raspberry PI Kit (raspberry pi, HDMI cable, power supply, SD card, WiFi dongle, case) buy on Amazon
  •  Bluetooth Dongle buy on Amazon
  •  Webcam Compatible webcams  or buy on Amazon
  •  Pan-Tilt Servo Mechanism and Servo Motors buy on Amazon
  •  Nuts and Bolts Various to be determined
  •  Smartphone and App To be developed based on demand contact me to vote

If you need to buy a single part then that is obviously better, better still if you have all the parts already lying around, but if you are buying all the parts, a better value may be to get a raspberry pi starter kit such as this one from canakit on Amazon for all the raspberry pi parts required.

System Operation

The system operation for the two major components, the smartphone and raspberry pi, can be summarized in pseudo code, this is a representation of the control algorithms and will serve as the basis for writing the actual control code for the units.

 Smartphone Control Pseudo Code

  1. Begin
  2. Initialize UI
  3. Initialize accelerometer
  4. Initialize Bluetooth
  5. Connect to raspberry pi Bluetooth
  6. Initialize WiFi networking
  7. Connect to raspberry pi camera stream
  8. While 1
  9. Read accelerometer
  10. Condition data
  11. Send data by Bluetooth to raspberry pi
  12. Wait
  13. End While
  14. End

Design Project Control a Pan-Tilt Platform with Raspberry Pi and Smartphone schematic

 Raspberry Pi Control Pseudo Code – Pan-tilt Control

  1. Begin
  2. Initialize servo motors
  3. Initialize Bluetooth
  4. Connect to smartphone
  5. While 1
  6. Receive Bluetooth data
  7. Calculate servo movement
  8. Move servos
  9. End While
  10. End

 Raspberry Pi Control Pseudo Code – Video Stream

It is expected that the streaming of the webcam video over the network will be done by one of the many webcam streaming apps that already exist for Linux on the raspberry pi, such as motion or MJPG-streamer. Some reference projects are at the following links:

>Raspberry Pi Motion webcam server: http://www.instructables.com/id/Raspberry-Pi-remote-webcam/ http://jacobsalmela.com

>Raspberry Pi Motion MJPG streamer server: /raspberry-pi-webcam-using-mjpg-streamer-over-internet/

 Reference Code

Some reference code to get this project started can be found at the links below, these should shorten development time as they can be applied to the current application with some modification. This is generally quicker than developing everything from scratch.

 

For more detail: Design Project: Control a Pan-Tilt Platform with Raspberry Pi and Smartphone


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top