Introduction: Controlling Pan and Tilt Mechanism Via Infra Red (IR) TV Remote.

About: I am an Undergraduate student majoring in physics from IISc, Bangalore. I am just a guy who love to build tech stuff and make them look good.

Making arduino wireless is a piece of cake with an IR Sensor and a TV remote. In this post I"ll show you how to build a pan tilt mechanism with servo and then control it via an IR Remote(TV remote). My favorite part of this post is the home-made PAN AND TILT mechanism.

You can attach a webcam and use this for security purpose etc. Below is a some video I made just to inspire you!

So lets get to it.


  • Arduino

  • L clamp.I used the one which is actually made for clamping motors.

  • Two high torque Servos

  • Nylon cable ties to hold servos and brackets together

  • Screws and nuts

  • IR Sensor. I used TSOP 1738

  • TV Remote. I used a Sony Bravia LED TV Remote

  • BreadboardJumper wires


First of all, we need to assemble the L-clamps and Servos together. There is one base Servo which rotates the system horizontally and then there is a neck servo which rotates it vertically. You can assemble them in any way you like as long as they are doing their function. The only thing to remember while making a pan and tilt mechanism is that it should be sturdy. There should not be any vibrations. One trick to build such firm system is to keep center of gravity as low as possible.

With the assembly done, its time to do wiring!
Below are the connections schematics:

baseservo Arduino

Vcc -> +5v

Gnd -> Gnd

Signal -> Digital PIN 4


Neckservo Arduino

Vcc -> +5v

Gnd -> Gnd

Signal -> Digital PIN9


IR Sensor Arduino

Vcc -> +5v

Gnd -> Gnd

Signal -> Digital PIN 2

To know schematics of IR sensor refer to datasheet in previous step(in "You will need").

Step 3: Coding

Wiring is all done. So lets do some coding now.

You can try and use the standard IRRemote library of arduino, but I got some serious errors while using it with Servo library. I think its because both of them uses the same timer i.e timer 2. So I used this library instead.

Next step is to debug your IR remote. That is to know what code is linked to which key of you TV remote. I have provided a sketch for doing that. Its at the end of this post. Once you debug your Remote, just put in the correct codes into the main sketch(also at the end of this post) and you will have Pan and tilt mechanism with Remote control.