Introduction: Linear Motion by Rack and Pinion

A rack and pinion mechanism can generate a linear motion, which can be adapted into a variety of whimsical craft ideas. Build a simple linear mechanical movement and apply into your own kinetic craft. I used paper-like materials (illustration board and cardboard) which are relatively cheap and easy to handle.

Step 1: Things You Need

  • 1 Arduino Uno (or RedBoard)
  • 2 servo motors (I used standard size of 180° and continuous servos)
  • 7 wires (if you want to build only one, 3 wire)
  • A breadboard (if you want to build only one, you don’t need)
  • 1 illustration board (or mat board): Both illustration board and mat board can be found in craft stores. I made a gear by attaching two layers of gear parts using illustration boards. By doing so, it becomes rigid and thick enough to generate the power to pull and push but can still be cut or trimmed with a knife cutter or a scissors.
  • 1 Cardboard (or formboard): I used recycled box cardboard to build the case.
  • Wood skewers: I used it to adjust the height in adapting the linear movement to other crafts. A bag of 100 wood skewers costs $1-$2 from supermarkets or craft stores.
  • Duct tape: to attach servo motors to the case.
  • Glue gun and glue sticks: to attach gear layers and assemble parts.
  • Wire cutter: to cut skewers
  • Laser cutter: to cut parts


My instruction is divided into two parts. Part A (step 2, 3) shows how to control servo motors, and part B (step 4, 5, 6, 7) shows how to assemble parts to build a linear movement by rack and pinion gears. If you’re familiar with electronics (servo motor control), skip part A. If you’re not familiar with playing with servo motors with the Arduino controller, start from part A.

Step 2: Build a Circuit

There are two types of servo motors: one rotates 180 degrees back and forth (reciprocating movement) and the other one rotates continuously. For both servos, you need to use three jumper wires to connect the power, ground and signal of your servo motor to your controller. If you want to use two servo motors at once, you need seven wires and a breadboard because the Arduino Uno has only one power pin.

Step 3: Program to Run Servo Motors

For those using a 180° servo motor, start here: https://www.arduino.cc/en/Tutorial/Sweep

If you are using a continuous servo, remember that the Arduino command that sets the angle of a 180° servo motor (e.g.,ServoName.write(60)) instead sets the speed of a continuous servo. So, given a range of values from 0 to 180, a value near 90 stops the continuous servo motor, a value of 0 sets full-speed in one direction (“reverse”) and 180 sets the servo to full-speed in the other direction (“forward”). I uploaded sample code.

Now you’re ready to have fun with working servo motors. Let’s move to the mechanical construction side.

Step 4: Cut the Parts

Open the attached SVG files and cut the parts. I used an Epilog Helix 40Watt laser cutter and the settings were:

  • power: 50, speed: 100, frequency: 500: to cut gears (illustration board)
  • power: 75, speed: 100, frequency: 500: to cut parts for the case (cardboard)

If you’re going to use a 180° servo, use the gears marked A; and if you’re going to use a continuous servo, use the gears marked B. The parts to build a body case (enclosure) is same for both gears.

Step 5: Set a Servo Motor and a Pinion (rotational) Gear

First, attach a servo motor on the body part (part #1). You can use either hot glue or duct tape. I used duct tape here.Then make a pinion gear by attaching two layers of gear parts with a motor part (the servo “horn” that came with the motor package). After the glue has set, connect the pinion gear to the motor on the body.

A pinion gear for a continuous servo motor is missing some teeth, which allows the rack gear to drop suddenly on each full turn when the untoothed section of the gear comes around. The assembly process is same as the above.

Step 6: Set a Rack (linear) Gear

Make a rack gear by attaching two layers as in the previous step. On the side of the rack gear, attach a wood skewer and adjust the length. This helps to adjust the height when using this linear movement into other craft you’re planning. (If you don’t plan to use it in your other creation, you don’t need to attach the skewer.)

Then figure out how many of the part #3 you need to attach to interlock the rack gear with the pinion gear. In this case, I needed two layers (again, the number of layers can vary depending on the materials you’re using). Once you are sure of the right height, attach them to the body. And leave some space from the edge,...roughly 7-8mm (0.3”) would be good. This space is for attaching props later to make the body stand. The continuous servo version is same as the 180° one. Set a rack gear by attaching two layers (with a wood skewer) and attach parts to match the height of the pinion gear and the rack gear.

Step 7: Interlock the Rack and the Pinion

Turn the motor clockwise, and plan the bottomline for the rack gear’s linear motion. Attach the long thin part #2 besides the rack gear position.It will make a wall to help the rack gear move straight up and down. Once you’re sure of its path, glue the part onto the body.

Here, an additional part for the continuous servo version comes. To use a continuous servo, you need to build a ‘floor’ to place the rack gear after it drops down. Cut a small cardboard part (I used the small piece cut out from where the motor mounts on the body case) and place it at the bottom of the path. To check the correct position, set the pinion gear as shown at the right before hitting the rack gear and see if it is at the right place to interlock the rack and pinion gears as the pinion gear continues rotating counterclockwise.

Now, you need to build the other side of the wall to complete the path for the rack gear. Check whether the part #6 is slightly higher than the rack gear. Because it will complete the path for the linear movement of the rack gear, this space shouldn’t be too loose or too tight. Once you’re sure, attach it to the enclosure part #5 and repeat it with the rest using the part # 7 and 8. This process is same for both 180° and continuous servos. Once dried, place them on the path, double check if this path fits to the rack gear’s linear motion, and glue them carefully. Here you shouldn’t to attach the rack gear together.

Now you just need to set props (part #4). If you’re building with a 180° servo, you can set both vertical and horizontal directions are fine. If you’re using a continuous servo, you need to make it vertical, since the rack gear needs to drop down. Then connect the servo to the Arduino and run it.

Step 8: Build Your Own Kinetic Craft

Looking good? Then it’s time to make your own kinetic craft. What’s your story? If you’re familiar with electronics, perhaps you can make it even interactive!