rbx servo assembled

The Servo Brick is based on the SG90 servo. The axle of the servo has a 180-degree range of movement.

sg90 servo

The servo comes with some accessories and screws.

sg90 servo accessories

We are going to use 2 of these screws (I will refer to them as "servo screws" from now on). These looks to be M2 screws with 7mm length and a rimmed pan head. If you are missing these screws, you can still use our default 5mm M2 screws with no issues.

Parts list

TypeQuantity
SG90 servo 1
2-pin JST RCY connector (male) 1
2-pin JST XH connector (male) 1
M2 self-tapping screw 5
Servo screw 2

Circuit

Snip off the cable of the SG90, leaving about 2cm. Splice the JST RCY connector cable to the VCC and GND wires (red and brown respectively). Splice the JST XH connector cable to the PWM and GND wires (orange and brown respectively). 

rbx servo circuit 01

Print out the two halves of the wireholder on a 3D printer. 

Lay out the wire joints on one half of the wireholder, add some hot glue, then mount the other half on top. This helps to protect and strengthen the joints.

rbx servo circuit 02 rbx servo circuit 03

Construction

Print out the enclosure parts on a 3D printer.

rbx servo 3dview

Line up two 3x1 brickbases on a faceplate, three rows apart. Add an additional brick on the side to assist in alignment.

rbx servo assembly 01

Add two drops of superglue on each brickbase and mount the bottom piece. Use the markings along the side to align the brickbases. Press and hold for 60s.

rbx servo assembly 02 rbx servo assembly 03

Line up two 2x1 brickbases on a faceplate, one row apart.

rbx servo assembly 04

Add two drops of superglue on each brickbase and mount the bottom piece vertically. Use the markings along the side to align the brickbases. Press and hold for 60s.

rbx servo assembly 05 rbx servo assembly 06

Screw one side of the servo to the backplate piece of the enclosure using a servo screw.

rbx servo assembly 06b

Insert the backplate with the servo attached into the slot in the bottom piece. Screw in with the other servo screw.

rbx servo assembly 07

Now, secure the top piece onto what we have prepared so far with 4 x M2 screws.

rbx servo assembly 08

Now connect the servo module to the Controller Brick, Battery Brick and Motor Power Brick, and run the following code to position the servo at 90°.

var< servo = new Servo(PORT_2A, 90);
while(true);

Now mount the axle adapter on the servo axle with the arrow pointing to the middle of the directional arrow. Then screw in with a M2 screw. This is best done with the servo still powered and supported by your fingers to ensure the arrow stays pointed at 90°.

Note: 90° is chosen as the mounting angle instead of 0° because quite a few SG90 servos are known to be unable to reach the full 0° or 180°. So the best angle to use is 90° because it is the midpoint of the servo's full range regardless of whether it is actually able to hit 0°/180°.

rbx servo assembled

The Servo Brick can be positioned either vertically:

rbx servo assembled 02

or horizontally:

rbx servo assembled 03

The axle is positioned so that it will interface correctly with gears and other Technic pieces whichever way it is mounted.