DIY Motorised Camera Slider With Object Tracking

I’ve been wanting to build a motorised camera slider for a while now, so when some popped into my Amazon suggestions a week or two ago, it re-ignited the urge to build one.

So, in this guide, I’m going to be showing you how to build your own motorised camera slider which can pan, rotate and track objects for some really cool shots. It’s driven by an Arduino Pro Mini and some TMC2208 stepper motor drivers and can lift a mirrorless camera like the M50 vertically or in any other angle or orientation, even upside down.

Camera Slider Lift Camera Vertically

Here’s a video of the build and the slider in operation, read on for the step by step instructions:

What You Need To Build Your Own Camera Slider

There are quite a few parts to this build, but it isn’t actually that difficult to make. So don’t let the parts list intimidate you!

Parts From Amazon (Affiliate)

There are also a number of 3D Printed parts in this guide. I’ve used a Creality Ender 3 Pro to print my parts. If you don’t have a 3D printer, there are a number of online 3D printing services available to print and deliver your parts as well.

Parts from Banggood (Affiliate)

How To Make The Motorised Camera Slider

We’re going to build the camera slider in three stages. We’ll first assemble the extrusion mounted mechanical slider components and motors, then assemble the PCB and electronics case, and finally program the slider to perform our movements.

Assembling The Mechanical Slider

One of the cheapest and easiest ways to make sliding rigs is to use aluminium t-slot extrustions. These are widely used on 3D printers, laser cutters and other hobbiest CNC machines, so they’re pretty inexpensive and come in a range of sizes and lengths. They’re really useful for mounting components, you can buy special t-slot nuts which fit into the groves to clamp brackets and mounting plates onto.

Aluminium TSlot Extrusion

I picked out a 2040 extrusion and then a basic mount for the stepper motor, a sliding gantry, a belt tensioner and then the belt and pulley. I also picked up a ball joint camera mount so that I could position the camera at different angles.

Extrusion Components

If you don’t want to build a motorised slider and you’re happy to move your camera along the slider yourself, then you don’t even need the motor mount or the tensioner, just the extrusion and the gantry. An un-powered slider is just as useful to get some great footage, you just need a bit more effort and patience to get the shots.

I installed the components onto the extrusion, along with two stepper motors which I salvaged from an old 3D printer. These are just standard Nema 17 stepper motors with around 1-2A coils. I designed and 3D printed a basic housing for the motor as well as an adaptor for the camera mount and some belt clamps.

3D Printed Motor Mount & Adaptor

The motor mount is just screwed onto one end of the aluminium extrusion using some M5 button head screws and t-slot nuts and the pan motor is then mounted onto this mount with the motor shaft facing towards the extrusion and positioned in line with the top pair of side slots.

I then secured the pulley onto the motor shaft with the teeth lined up with the centre of the top slot.

Install Motor Onto Mount

Put the second motor into the 3D printed housing, securing it to the top cover plate with M3x8mm button head screws and close it up with some more M3x8mm button head screws.

Install Motors Into Housing

Screw the ball joint camera mount onto the 3D printed adaptor using some M4 button head screws and then secure this on the shaft with an M3x15mm cap screw.

Install Adaptor Onto Ball Joint Mount

You can then slide the rotation motor and gantry onto the aluminium extrusion and finish off the end by adding the belt tensioner, again using M5 button head screws and some t-slot nuts.

The “tightness” of the gantry can be adjusted using the nuts on the underside of one pair of wheels. These nuts move the wheel supports closer or further away from the slot, which tightens the grip on the slot. The gantry should be firm, without and rattling when moving, but shouldn’t be difficult to move along the guides.

Add Tensioner Onto TSlot Extrusion

Next I needed some legs to stand the slider onto, I also designed these along with a shoe for my tripod and then 3D printed them in black PLA to match the colour of the aluminium extrusion and the motor mount.

Designing Legs For Extrusion

I 3D printed all of my components using Black PLA with a 15% infill.

Once the legs were printed, I installed them on each end of the slider using two M5 button head screws and t-slot nuts on each.

Install Legs On Slider

Remember to put your tripod mount onto your extrusion (if necessary) before the second leg as this closes up the entry to the slot, so you won’t be able to get the nuts into place.

Add Tripod Mount To Underside Of Slider

Then add the second set of legs.

Add Second Set Of Legs

Once your legs have been added, you just need to add the belt from the motor to the gantry. Start on one side of the gantry, folding the belt over itself and securing it with a 3D printed clamp, then feed the belt around the motor, through the middle of the extrusion, around the tensioner and back to the opposite side of the gantry. The belt should be trimmed to length so that there is about 3-4cm of overlap near the gantry.

Install Belt Onto Motor And Tensioner

The belt needs to be pulled finger tight (with the tensioner completely loose) and you can then tension the belt by tightening the tensioning screw.

Adjust To Tension Belt

We’ve now got the basic slider together with our two stepper motors, so we need a way to get them moving.

Camera Motor Mount

Designing And Assembling The Electronics

To control the camera slider I’m going to use an Arduino pro mini. The Arduino will drive the motors using two silent TMC2208 stepper motor drivers. We also need a way to input the parameters for each movement, so I added an OLED display and a rotatary pushbutton.

Testing The Electronic Components

I set up a basic layout of my components on a breadboard first.

Electronic Components Layed Out On Breadboard

This was done to test that I had made the right connections and that the components all worked properly with the Arduino. I didn’t bother with both stepper motor drivers, if the one worked properly then the other one would too.

Wiring Connections Made On Breadboard
Temporary Wiring Connections

Designing The Circuit And PCB

Once I was happy with the connections to the electronic components, I drew up the circuit and a PCB to mount the components onto.

Camera Slider Schematic

You don’t have to use a PCB, you can mount your components onto a breadboard, but a PCB makes a stronger and more reliable build, especially for something that you’ll be moving around a lot.

Designing The PCB Layout

I got my PCBs made by PCB Way. They literally had them made and shipped out to me in 24 hours, which was quite impressive.

PCBs As Delivered From PCB Way

They did send me these PCBs for this project for free, but you can order your own PCBs from them from just $5 for 10 basic two layer boards. They’re really good quality and they also have a couple of different colour options, so you can really customize your projects.

Completed PCBs Brom PCB Way

Assembling The PCB

I then soldered the components and header pin connectors onto the PCB. I used a header pin connector for the display as well as I was planning on mounting it directly onto the case and having a short ribbon cable to the pins.

All Components Soldered Onto PCBs

I put the heat sinks onto both TMC2208 motor drivers, soldered the pins onto the display and Arduino and then pushed them into the sockets on the board.

You’ll also notice that there is a small jumper on the top right of the board, just above the motor drivers. This jumper selected between having the motors always energised (can be moved by hand) and energised on command by the Arduino i.e. the Arduino can enable or disable the motors. My code makes use of the drive enable function using the Arduino to control them.

Components Mounted

Making The Electronics Case

I then sketched the PCB into my CAD model and designed a case to house it and mount onto my slider.

Designing A Case To House The PCB

I 3D printed the case components again using Black PLA and a 15% infill.

3D Printed Case From Black PLA With 15% Infill
3D Printed Case Components

I installed the PCB into the case, holding it in place with some M3x3mm button head screws. My display is still shown plugged into the header pins here, it was removed for the next steps.

Installed PCB Into Case

I then made up a short power lead to a 5.5mm barrel plug socket (the same one used on the Arduino UNO) to mount onto the side.

I mounted to case onto the slider using some M5 button head screws and t-slot nuts.

Add Power Cable And Mount To Slider

I put a switch onto the PCB to use if you’d like to, but I prefer just having it on when its plugged in and off when its not. A switch is useful if you’re powering it from a battery pack or your’ve got it set up somewhere permanently. If you want to use the switch then you’ll need to modify the case so that it’s accessible through the side.

I connected my motors to the PCB ports alongside each driver and put the wires into some braided sleeving to keep it neat.

Programming The Camera Slider

With that all done, it was time to tackle the programming, which was a bit more of a project than I had anticipated.

Making menus with these rotary pushbuttons is a really neat way to input information with a single device, but you land up having to do quite a lot of coding to make up for it.

Rotary Pushbutton To Input Data

I got the pan and rotate functions working quite quickly and then came the object tracking. I simplistically, or rather stupidly, initially thought this was easy. The camera moves from A to B and rotates through a bit less than 120 degrees, so just divide up the movement and rotation and it’ll work perfectly.

Except that thats not how it works at all.

In order for the camera to stay fixed on an object, it needs to move slowly in the begining, quite quickly in the middle and then slow down at the end again. There’s a bit of trigonometry involved in getting the camera to follow the object properly.

Object Tracking Code

At least I had now realised what I had done wrong and could fix it, so after another few hours of coding, it was finally working.

Here’s my final version of the code. I usually go through the code in some detail for each project, but this project’s code is quite lengthy. I have added quite a few comments in the code to help you follow through it.

Code Variations

Our community has also helped out with some useful additions to the code. Here are some of the modified versions. Note that I haven’t tested these versions of the code.

Limit Switch Inclusions by Paul Bartlett

Paul has added micro-switches to the two ends of the rail to act as limit switches to stop the motor. He has also added a short routine to move the motor back a little at the ends of travel to release the switches and added a routine to automatically home the gantry after running a movement.

Use A 1.3″ Display by Tony Tren

Tony has modified the code to work with the 1.3″ OLED display.

Closing Up The Case

Once I had programmed the Arduino, I closed up the case using four M3x8mm screws and then pushed the knob onto the rotary encoder.

Install Cover Onto Case

The motorised camera slider was now ready to be used.

Completed Camera Slider Ca

Using The Camera Slider

When you first put power onto the Arduino, a splash screen is briefly displayed.

Startup Splash Screen

You’re then presented with the main menu, which allows you to choose from four options – pan, rotate, pan and rotate and object tracking mode.

Camera Slider Main Menu

The options are selected by rotating the encoder and are selected by pressing the encoder. Once a mode is selected, a parameter input screen allows you to input the distance, angles, timing and directions for each movement.

Camera Slider Input Menu

Once all of the parameters have been input, you push the encoder button to start the movement and it then enables the motors and runs. The drivers then remain enabled at the end of the movement until you push the button again to release them. This is to ensure that the camera isn’t suddenly dropped once the movement is complete.

Camera Slider Object Tracking

The camera slider works pretty well, staying fixed on the object from one side to the other. There is one limitation in that you need to know the pan distance and the distance to the object quite accurately, otherwise you land up slightly over or under rotating the camera. This isn’t a big issue but it does mean that its difficult to keep the object exactly in the centre of the frame without getting a ruler out each time. I’ll probably look at designing an interface to a Raspberry Pi in future so that I can run TensorFlow to do real-time object tracking. This should give more reliable results without any measurements.

Camera Slider Mounted Onto Tripod To Work In Any Orientation

The TMC motor drivers were a great choice for this build as they are really smooth and quiet, so you bearly notice them running.

Opposite End Of Camera Slider

As always, let me know what you think of this motorised camera slider in the comments section and let me know what you would do differently. But most importantly, enjoy building your own!

Michael Klements
Hi, my name is Michael and I started this blog in 2016 to share my DIY journey with you. I love tinkering with electronics, making, fixing, and building - I'm always looking for new projects and exciting DIY ideas. If you do too, grab a cup of coffee and settle in, I'm happy to have you here.


    • Thanks Fred. I’ve updated the schematic with a better resolution copy, it’ll also load a larger image if you click on the image to open it in a new page.

  1. Michael, very nice. I do have a question though. I am a member of Instructables which is where I ran across your build. About a year ago someone built something similar except it was for focus stacking macro photos. It would start at the nearest focus point of an object, take a photo, move the camera a little closer & take a photo, move a little more, take a photo, etc. until you had a series of macro shots with all points being in focus & then merge the images. Do you think something like this could be programmed into your Arduino slider?

    • Hi Gregory,
      What you’re describing sounds like it would be quite easy to program. I built a lightning photography tool a while ago which uses an optocoupler to trigger a physical input on an older Canon camera. I guess you’d have to try and set up a Wifi trigger or put an optocoupler onto a remote trigger to trigger modern DSLR’s shutters. But this is certainly something that could be done quite easily with an Arduino.
      Is there a reason why (or benefit to) you would move the camera between shots rather than automate the turning of the focus ring on the camera rather?

      • Hi Michael,
        Here’s the Instructable that I mentioned.
        Dtrewren, the author, didn’t use an Arduino or any off the shelf microcontroller but cobbled his own together. I’ve played around with Arduinos so I know a little bit about them. He used a stepper to turn a lead screw instead of a cogged belt. I have two 3D printers so I think the small movement of the camera needed would work with your belt system. He also triggers the camera to take an exposure with his microcontroller.
        Take a look and let me know what you think.

        • I’ve had a look at his Instructable, this has given me a better idea of the setup. I’d still be interested to know why moving the camera is better than adjusting the focus. This might just be my misunderstanding of the intention behind the rig or the photography technique.
          The author has just used a pic chip, which in essence is just the core of an Arduino. But what you’re wanting to do is perfectly do-able with an Arduino. A leadscrew like he has used will give you higher precision, but you can get similar results using a belt and a small pulley on the motor shaft.
          His trigger is similar to what I’ve built with an Arduino for photographing lightning. This is easier to do when the camera has a manual (plug in) remote trigger. Some cameras don’t have this facility and have moved this function over to WiFi. This is more difficult to get working with an Arduino and varies by camera model.

  2. Hi Michael,
    thanks for sharing this great project. I build up the electronics and so far everything works perfectly. The parts for the mechanical part of the project will arrive soon and I am pretty convinced that everything will go well 🙂

    Nevertheless I have some questions:

    1. The input voltage is 6-12 Volts according to the PCB. How can this be, as the Arduino is only 5V. Wouldn’t it be fried with 12V?

    2. The 0.96″ display is pretty small and therefore I tried to change the code to SH1106 (1.3″) displays, but I greatly failed 😉
    Can you please give some hints on how to change the code to work with SH1106 displays?

    3. I have 8 PCBs left over from my order at PCB Way. If someone from Europe is interested in getting one or more PCBs, may you help with getting in contact?

    • Hi Joerg,
      That’s great, hope it all goes well for you! To try answer your questions:
      1) The 5V referred to is the Arduino’s Vcc circuit, it can accept an input voltage of 5-12V as it has an onboard regulator.
      2) I’ve never used an SH1106 display, so I don’t have much experience with them. You’d probably just need to find a compatible library (possibly this one – and then you’d need to change the initial lines of code which refer to the SSD1306 display. If you use an Adafruit library like this then it looks like the notation is pretty similar, so you probably wouldn’t need to modify all lines of the code which display something. You’ll also likely need to change the font sizes and cursor positions for each text line to get them laid out correctly.
      3) I think if anyone from Europe is interested in getting them off you then they can comment here to get into contact with you. Unless you’ve got another idea?
      Good luck with your build and let me know how it goes with the larger display!

      • Hi Michael,

        thanks for your detailed reply – much appreciated.

        Good to know that there is an onboard regulator – now the input voltage range makes sense 😉

        Regarding #2: That’s what I actually tried to do. Including the Adafruit library and changing the code where it is necessary, but it didn’t work. I can give it another try and post the compiling errors here if you like. May be we can get it running together?

        Regarding#3: Yes sure, if somebody is interested in PCBs they can comment here. My initial idea was to setup a certain email address for it, but just writing a comment here is fine for me.


        • Hi Joerg,
          No problem at all.
          Regarding #2, if the code is not compiling then you’ve got some syntax errors or your code is trying to use features of the old library that aren’t in the new library. The error usually shows you which lines these are in, so they should be quite easy to find and correct. I don’t mind helping out with any specific ones you’ve got an issue with.
          Regarding #3, you’re welcome to share an email address here as well if you’d like. It’ll probably get quite a lot of spam though!

          • Hi Michael,

            sorry for the late reply. In the meantime all missing parts arrived and I was able to make lot of test shots. Therefore I dropped the idea to change the code to run with a 1.3″ display as there are a lot of more important problems at the moment:
            First of all: The slider does not work with a DSLR (EOS 6D in my case) properly as the camera is too heavy. It works in horizontal mode, but there are too much vibrations/wobbling. So the footage is useless.
            I tried with a smaller camera, but there are still some micro vibrations.
            Vertical, or even slightly angled mode is impossible as the rotate motor doesn’t keep the camera in place. This may be related to problem #2:

            The system does not work with a voltage higher than 5V. If I connect it to 9V or 12V the dispay stays black and the Arduino gets hot. After a couple of minutes the Arduino is dead. With 5V everything works as expected.

            May be I will give it another try after purchasing a less heavy camera, but for now I stopped testing it.

            Just to give something back: I designed a new motor/ball head adapter in order to work with a center screw (1/4″) in the ball head plus a new knob which fits a little bit better on the pushbutton. Are you interested in the STL files, or shall I put it on Thingiverse?

  3. I have seen your project in instructables and I have started to assemble it. I have already managed to start it with a 1.3 “screen although I have not managed to make your logo look correctly, but the rest of the program does work, I have even translated it into Spanish (my English is bad).
    It would be great if you could incorporate a long press to stop the movement, sometimes it is necessary to stop it to avoid a problem.
    Thank you very much for your work and congratulations.

    • I’m not sure that you can open them in a package, these are generated for production of the PCB, not for editing.

    • Hi Dominik,

      I have some PCBs left over from my order which I will sell for a small amount plus shipping. If you live in Europe feel free to contact me.

    • The jumper selects between allowing your Arduino to enable/disable the motor drivers or just having the drivers permanently enabled when the board is powered. The drives being enabled means that the motors are held in place or “locked” and can’t be turned by hand.

      • Hi Michael,
        That’s brilliant thank you. I have built the slider and it works really well. I’ve added limit microswitches at each end and the relevant code to stop movement when triggered. I also had to add a little routine to move the mount back just a fraction after the limit switches were triggered to release them. I have also added a menu item for ‘Homing the Slider’.

        • Hi Paul,
          Those sound like great additions! Would you be willing to share some photos and perhaps your revised code for me to share at the end of the post (with credit to you obviously)?

          • Hi Michael,
            May not be perfect coding but here goes:- *code moved to body of post under Code Variations

          • Thanks for sharing your code Paul, I’ve moved it to a downloadable file in the main body of the post.

      • Hi Chris, If you look at my code, I have added microswitches to D10 and D11. They are pulled high until the camera mount nudges the switch which then pulls them low stopping the travel. We then have to do a little step in the opposite direction to release the microswitch, otherwise it will remain triggered and stop the next movement.
        Hope this helps.

  4. Hello Michael,
    I am quite new to Arduino projects but have enjoyed creating a number of projects several of which include Stepper motors. I came across the TMC2208
    driver recently and ordered several from Banggood. My main problem is, that
    nowhere can I find any simple code for the Arduino. All I want to do is to control one stepper motor backwards and forwards, and perhaps alter the speed.
    Most of the information I come across is for 3D printers and I’m not into those, at 82 I’m too old to take in all that technical stuff. Some simple code and a simple diagram showing how to wire up the TMC2208 would also be a great help.
    If you could help I would be extremely grateful, your my only hope.

      • Hello Paul, could you publish the new code, I think the same thing happened as with my publication, the compiler has errors and it is not possible to execute it.

    • Hi Les,
      I’ll have a look at writing up a guide for using the TMC2208 drivers with an Arduino. In principle, it’s quite easy. Follow the schematic for the camera slider, it’s got the two TMC2208 hookups shown. The only thing you might want to change is to just tie the EN pin to GND rather than have a jumper. The programming is exactly as you’d do for the A4988s, you set DIR high or low to set the direction and then pulse the STEP pin to step the motor one step at a time.

  5. Someone was trying to use the oled 1.3 screen “I leave the modified code that I am using that screen. Greetings.
    *code moved to body of post under Code Variations

      • Thank you Michael,
        But there are some problems when publishing the code, I have checked this in my code and it also happens in Paul’s.
        When passing to code many errors appear, for example:
        display.print (F (“>”));
        appears published as
        Serial.print (& quot; Interval: & quot;);
        but there are many more similar.
        Maybe there is some way to send you the code in arduino format to avoid these errors?

        • Hi Tony,
          Thanks for picking that up. I had noticed that the imports had been stripped, but didn’t notice the text as well. Could you email your original version of the code to – admin(at)

    • Yes, you could use an Uno and a shield. You’d probably need to modify the code as it’s unlikely that the shield would use the same pin numbers for the drivers.

  6. Hi Mike

    Lovely project, this. I’ve been looking for a build like this to make for a friend who does filming for a living and want something that’s super quiet – this is perfect. Just wish I’d stumbled across it before I’d printed out all the bits for the adafruit mk 3 camera slider…

    I have a couple of daft questions though, if you don’t mind:
    (1) The stepper motor you’ve linked to is rated at 2.5A (torquey!) but the drivers are rated for 1.4A max, peak 2A. Are you running the drivers at peak or have you reduced the current being drawn (or do the motors have to be going full pelt to get anywhere 2.5A, which they presumably won’t be in this application)?
    (2) Are you powering it using a mains 12v adapter, presumably rated for 5A to handle full current through the drivers plus powering the Arduino? I.e. this is always going to need mains power.


    • Hi Andrew,
      That’s great! Yeah, this slider is quite a bit simpler to make, although it does have a few more bought out components. To answer your questions:
      1) I’ve got the drivers set to around 1.2A. You could definitely get away with using smaller motors, these are just what I had lying around from a 3D printer. I guess it depends on what your friend would be primarily using the slider for, moving fast and/or moving upwards uses more power. I mostly do relatively slow, horizontal panning movements, so the drivers handle this just fine. You also might want to add a fan to the enclosure if you’re running the drivers near their limit for extended periods of time.
      2) Yes I’m using a 12V 5A mains adaptor. You could probably use a 12V 7Ah lead-acid battery or a 11.1V 3 cell LiPo battery if you’d like to make it portable.
      Best regards,

      • Thanks Michael, you aren’t wrong about the Adafruit slider! That thing will survive an apocalypse but it only has 400mm of travel and is really suited to time lapse stuff (in any event, my software skills aren’t up to incorporating your rotating motor into the circuit python build I’m doing of that). So now I’ve got two sliders, each abut 80% done – your BOM is so much simpler and affordable.

        Just on Paul’s remix with the limit switches, am I right in thinking that the switches are just wired from D10/ D11 to ground so that when they close they bring D10/ D11 low?

        Andrew (PS your Creality printer is clearly better than my Prusa MK3S+ as your case turned out way better than mine)

        • Yes, from the code it seems like Paul’s limit switches are wired to GND and bring the input down to LOW when triggered.

          I would have thought that your Prusa MK3S would produce better quality prints than the Creality Ender 3. Perhaps it’s the orientation in which it was printed?

          • Great, thanks, that was my reading of the code but I don’t trust my software skills. I’ll wire up the switches as NO rather than NC. It turns out that when I flipped the stl file to make it print better I’d only flipped it 179 degrees on Prusaslicer; the reprint worked well, and with a heap of supports I also got the box to print perfectly, thanks. The bevelled edges are still a bit rough, but fitting this around kids means it’s never going to be perfect! Thanks for your help again! Andrew

  7. If I want to play Paul’s code, I get the error “missing terminating ” character” what do I have to do so that I can play the code properly. Don’t know me so well with arduino.

    • Hi Chris, I get the same errors and it looks like something odd has happened with the code. Some characters, like “ and & have translated as words &quot and &amp so those need substituted throughout. I’m still getting errors though from other bits but am working through it. Might be worth doing a comparison of the code and copy and paste across the extra bits of Paul’s code directly into Michael’s. Thanks, Andrew.


Please enter your comment!
Please enter your name here

Latest posts

Mini Sega Genesis Console Powered By A Raspberry Pi 4 Running RetroPie

In this project, I'm going to show you how I built a Mini Sega Genesis console lookalike, which is powered by Raspberry Pi 4...

The M5 Paper, A Tablet Style Development Board With An E-ink Touch Display

Today we’re going to be looking at the M5 Paper development board, which is essentially an ESP32 tablet with a 4.7” e-ink touch display....

Reimagine Your Home With Multipurpose Spaces

Many of us have probably wondered at some point about what it would be like to have some extra space to put away all...

Related posts

Want to stay up to date with the latest news?

We would love to hear from you! Please fill in your details and we will stay in touch. It's that simple!