@tutorial: Arduino motorized slider - 3D body

What’s up my friends, welcome back. Today we will build a homemade slider, I’ll show you how I’ve build it starting with the 3D printed parts, all the mechanical parts, the step motor and finally the electronics. It has a control case with a rotary encoder menu and LCD screen for speed and direction control. The slide uses metal bearings and metal tubes and the rest of the parts are designed and 3D printed. It has a length of 1 meter and can slid

External Link: hhttps://electronoobs.com/eng_arduino_tut27.php

by: ELECTRONOOBS on 2026-06-18

~Part List

1 x Arduino NANO/UNO LINK eBay

1 x A4988 LINK eBay

2 x Push buttons LINK eBay

1 x i2c LCD: LINK eBay

1 x NEMA17 step motor: LINK eBay

1 x 2m timing belt: LINK eBay

1 x GT2 pully: LINK eBay

1 x rotary encoder: LINK eBay

1 x buzzer: LINK eBay

1 x 12V DC transformer: LINK eBay


3D files: LINK here

Screws: LINK eBay

Camera support: LINK eBay


Resistors: LINK eBay

Wires LINK eBay

Female PCB pins LINK eBay

Male PCB pins LINK eBay

Drilled PCB LINK eBay



Wire, soldering iron, solder, etc...

~PART 1 - Designing the parts

What’s up my friends, welcome back. The first thing to do was to measure the diameter of two metal tubes. Also, of a NEMA 17 step motor, some bearings, the size of a bunch of screws, the camera support, an LCD and all the extra parts. Once I had all the parts dimensions I’ve started editing the plastic parts for this slider. I’ve made the left and right side of the slider and the main plate. Also 4 legs so you could adjust the height and angle of the slider.

I’ve also designed a case where I’ll place the LCD and all the controls but also the Arduino NANO, and a driver IC for the step motor. All the designs have holes for screws so you could tight all the parts in place. Screws for the left and right sides of the slider to fit those in place on the metal tubes, also screws for the step motor and for closing the main control case.

By the way, in the link below you will find the 3D files of this project and also the dimensions.

Download: Box Top

I’ve used my 3D printers and printed the 3D files using gray and black PLA material with 20% infill and a 0.4 mm nozzle and a layer height of 0.3mm. These are all the parts. Two supports for the left and right side. One has a NEMA 17 step motor support. They both have places for the 3D printed legs with some bumps so you could fix the angle of the leg. Then we have the main plate with spaces for bearings and a hole in the middle for a camera support. Next, we have the 3D printed case made of 2 parts, one is the main case and the other is the front plate of the case with holes for the controls.

~PART 2 - Mounting the frame

We will also need 2 push buttons, one rotary encoder, an i2c LCD module, the Arduino NANO, a 12V DC transformer, the NEMA 17 STEP motor and the A49 88 step motor driver. This module receives 3 signals and will control 4 outputs for the motor coils. Those signals are the enable pin, rotation direction and amount of steps. With these 3 signals we could precisely control the step motor.


I mount the side parts and the two metal tubes. For the slider, I’ve used some bearings that I’ve got out from old rollers. You could use normal 22mm diameter bearings with a screw nut in between like in the photo below so the two bearings would fit on the metal bar with a gap in between. I’ve screwed in place the 4 pairs of bearings on the slider plate and then add two more pairs of rollers on the middle holes so the plate won’t be able to get out.

Now I screw in place the step motor on the left support. To transfer movement you should use timing belt and a pully. But, the one I’ve ordered is not long enough so till I receive a new one, I’ll just use some kind of wire. I’ve printed a special pulley that could get screwed on the shaft of the motor, and another one on the other side with a small bearing inside. Now I tie one end of the wire to the rolling plate, pass the wire over the pully and then over the bearing at the other end and finally tie it on the other side of the rolling plate.

Finally, I add an end stop switch like this one on the motor side support. This switch will be used to home the position of the slider each time that you want. That’s it, the slider body is ready. The wire of the motor and the switch will go inside the control case. Now let’s prepare the case.

~Schematic

Download and follow the schematic of the project from a link below. I screw in place the LCD, the two push buttons and the rotary encoder in the middle. On a drilled PCB and using female pins I solder an Arduino NANO and the step motor driver together with a 10uF capacitor. I also solder 4 pins at the driver output for the step motor connector.


Arduino camera slider schematic
Arduino camera slider schematic

Now, using wires I connect the i2c pins of the LCD to pins A4 and A5 of the Arduino. The rotary encoder has two outputs and we name those data and clock and they will be connected to pins 8 and 9 of the Arduino. The rotary also has a push button inside and it will be connected to digital pin 10. The other two push buttons are connected to pins 11 and 12 and the end stop switch to digital pin 4.

~The PCB

Ok, below you have the full schematic of this project. Pass the wires from the motor and end stop switch inside the case through the back hole. Also the 12V from the transformer and connect that to the Vin of the arduino and to the Vmot of the step motor driver. Remember to add pulldowns to each push button and to the end stop switch.


All buttons have pulldowns to ground so when the button is pushed, it will jump to a high state. Finally, I make the connections from the Arduino to the step motor driver. I connect the enable, the direction and step pins to digital pins 5, 6 and 7 and we are done. I pass the 12V transformer wire through the case hole and connect positive to the Vin pin of the Arduino and ground to ground and also supply 12V to the step motor driver. Now pass the motor and end stop wires inside the case and now let’s take a quick look over the code.

~PART 3 - The code

What I want it to do is to be able to use the encoder and enter a menu. Inside the menu, I could home the slider or change the speed. Once the speed is selected, you could select sliding to the right or to the left using the buttons.


Now, on the left side we have an end stop so the code could easily know when to stop. But on the right side we don’t have one. So, the code will have to count the maximum amount of step. We calculate how many steps we need for one cm, then it is very easy to know how many steps we need for 1 full meter. So once the slider is homed, the position step counter in the code will be set to 0.

s you can see in the part above, when the amount of steps is over 10.000 we stop the driver. If not, we create a square vawe with a width of the "step_delay" value. After the square wave, we increase the step amount by 2 since each pass from high to low and low to high of the square wave will be a step.


The code is quite easy but probably a bit long. Remember, you will need the i2c liquid crystal library if you use this kind of LCD screen so make sure you download it from below and install it on to your Arduino IDE.

See my other rotary encoded menu video below to learn more about this project because since I’ve already done that, I won’t explain it step by step.

But any way, now, in the code, each time the data or clock pins of the encoder or any of the other buttons will change their state, we create an interruption (read all the comments in the full code). By rotating the encoder, we increase or decrease the menu position or the speed amount. Please, read all the comments in the code in order to understand more.

Now, in infinite loop, if one of the left or right buttons is pressed will activate the enable pin for the step motor driver, select the direction with low for left and high for right, and create a square wave on the steps pin. The delay between the high and low state of the square wave will give us the frequency and that will control the rotation speed of the motor. Read in the code how to calculate your delay time depending on the pulley size. Download the code from a link below, compile, make sure you have the connections as in the schematic and upload the code. And there you go. This is how this works. When I start the slider, the first thing it dose is homing itself and by that reset the position. Then I press the rotary encoder and select the speed menu. In this case the speed is expressed in seconds. This will be the time it takes the slider to make a full meter. I set is to 4 seconds.

I press the rotary encoder again and exit the speed menu and we are ready to slide. I press the R button and the slider starts moving to the right till it reaches the maximum amount of steps. Remember that timing belt is much better if you want precision so once I’ll receive the 3 meters belt, I’ll use that. The slider stops if it reaches maximum sliding steps, or if any of the buttons is pressed.


There you go my friends. The slider is quite strong made with metal tubes. It can easily carry my DSLR Canon camera and with this cheap camera adaptor, you could set any angle. If you would like to support me, check my Patreon page and by that be able to see when I post my videos one day before.

Leave a comment

Please login in order to comment.

Comments

ADVERTISERS
ADVERTISERS
PCBWAY