# How can I use more than three motors with one NXT brick?

I'm building Caterpillar Excavator with my NXT, and at the moment I'm trying to control 4 points of motion:

• 2 Caterpillar Tracks - These should be controlled independently to allow for cornering, etc.
• Rotation of the cab/arm
• Extension of the arm - Ideally I'd use more than on motor here, as I'd like to be able to move the bucket and segments of the arm independently, however I've got a mechanism that works to "extend and dig" in one motion.

Obviously as it stands, the NXT can only control 3 separate motors - so I'm not necessarily wedded to LEGO only solutions.

There are electrical multiplexers as mentioned, however there are also many types of mechanical multiplexers. The idea behind this is to use fever motors to do more. The advantage is the reduced weight and the disadvantage is the increased complexity and lower flexibility.

For example, you can control both tracks with one motor. However instead of one motor making the threads more forwards and backwards, you remove the 'backwards' function and replace it with 'right-turn'. So when the motor drives forward, the bot moves forward, when the motor drives backwards, it turns right. You can't drive backwards or turn left however. A simple (but poor) implementation can be found in the R.I.S. 2.0 instructions.

While this is restrictive, you can do other similar tasks without loosing important functionality. Another old trick is the 'grab and lift' mechanism which both grabs and lifts an object in one movement. When you lower it again and it reaches the bottom, the grabber opens up. While you can't open the grabber while it is lifted, it normally isn't important. See The snatcher by Laurens as an example, which keeps two motors for the threads, but uses this technique to only use one motor for the arm.

Another prime example is with pneumatics, using a single motor to both pump and control a switch. See DiMastero's differential solution. It will pump no matter which direction the motor is turning, however turning it one way will push the switch in one direction, and the other when turning it the other way. (It will pump while the switch is switched from one position to another, but again, this is a minor drawback considering the gains.)

While the previous examples are solutions to specific problems, they highlight the ideas:

• Do different tasks under different situations. (Drive on clockwise, turn on counter-clockwise.)
• Chain several tasks together. (First grip, then lift.)
• Do several things at once. (Pump, while controlling the switch.)

The first point on the list, doing different tasks under different situations, is the most easy one to make a general implementation. You can split up the clockwise and counter-clockwise direction of the motors, to control two different tasks. While a bit restrictive, it is useful it certain situations.

A less restrictive solution is the 2 to n multiplexer. One motor gives the power, while another motor controls which task to transfer the power to. ('n' can be quite large, however something like 3 or 4 is more realistic in moc's.) I have come up with a few other versions, including some which allows controlling multiple motors at once (limited to same direction and speed).

Use a 2 to 3 multiplexer. Output 1 and 2 controls the rotation and arm respectively. The threads are done using an adder/subtracter mechanism, use the last free motor to drive it and output 3 from the multiplexer to steer.

I would position the multiplexer above the turntable so that you just need to transfer the adder/subtracter axle through it.

Some more examples as requested.

Here is a more advanced version of driving and turning with tracks using one motor: When the motor is turning counter-clockwise the mechanism will work like normal, driving both tracks forward. However when it turns clockwise, the yellow knob gear prevents one of the axles from moving, causing the last differential to stop and this causes both tracks to move in the opposite direction of each other, making it turn on the spot.

The knob gear is the crucial part, as it prevents action depending on the rotation direction. Here is a more generic version: Depending on the direction of the input, only one axle will turn.

Moving on to the actual multiplexers, here is a mock-up of a 2 to n multiplexer: Notice that the black gear can slide on the two axles, so that it can connect to both the light-gray and the dark-gray gear, depending on the position. You could have as many gears/outputs as you want in theory. I used this to create a pneumatic control station, which had 4 outputs, each controlling one pneumatic switch.

Here is a 3 to 4 multiplexer which uses transmission parts: The dark-gray axle is the input, and the 4 light-gray axles are the output. Depending on the position of the red sliders, a different output is chosen. The interesting aspect of this one is that you can have two outputs active at one time, which is not possible with the 2 to n multiplexer.

As a final note I would like to point out that I have used all of these methods in actual RCX/NXT projects in order to do more than what I could otherwise have done with just 3 motors. They are not just theoretical solutions.

I do not see the maximum of 3 motors as a disadvantage, but as a limitation which challenges me to find other solutions to the problem so it can be done with just 3 motors.

• Cheers for this - are you suggesting that the multiplexer is a physical solution (unlike the electrical solutions proposed in the other answers)? If so do you have an example of one built that I could look at? Commented Nov 16, 2011 at 14:32
• Yes, it can be done as a physical solution. I will try to dig up some old photos (and perhaps take some new ones), however it will have to wait for tomorrow. Commented Nov 21, 2011 at 0:39
• I added 4 examples. I had to recreate 2 of them, since the original photos were either too blurry, or that the actual mechanism was hidden away inside the construction. Commented Nov 21, 2011 at 18:36
• Cool! I linked to this in a blog post of mine. Commented Mar 3, 2012 at 15:42
• R.I.S. 2.0! I had one of those as a kid. Commented Nov 21, 2022 at 13:57

Mindsensors sells third-party parts that are compatible with the NXT. They sell several motor drivers and multiplexers, for use with NXT motors, RCX motors, hobbyist servo motors, or by sending commands to a PF motor remote control receiver.

HiTechnic is another such company, and they likewise make a device that sends remote control signals for PF and train motors.

(It seems to me that a company in Ukraine also made a motor multiplexer, but I can't recall the details offhand).

There are two non-wireless ways that I know of.

One of them, (which is better most likely) is to use a Mindsensors Motor Multiplexer (Motor MUX for short), which allows the use of all motor functions and splits one port into several. Note that each multiplexer requires an additional battery box, making your robot heavier and less compact. Each multiplexer costs \$55, and each battery box costs \$8.

Another way is to use converter cables, and split an NXT port by connecting them like so. This technique is cheaper, and does not require an additional battery box. A drawback to using this technique is that you have less individual control over the motors. Both motors will need to turn at the same time, with the same power, and in either the same or the opposite direction depending on how you orient the connection. Furthermore, this method will negate access to the motors' rotation sensors, so movement will have to be timed.

This technique has some limitations, but if those don't matter for your creation, then converter cables are a nice and cheap alternative that helps preserve compactness. I recommend using it over the motor MUX unless your robot simply can't function under the constraints. For a demonstration of a robot using the Mindsensors motor MUX, see this video. To see a demonstration of a robot using the converter cable technique, see this video.

Everybody else has pretty much said it all, but there is one more thing I can think of.

The IR Link Sensor can communicate with Power Functions, RCX, and trains.

So you can use three NXT motors, plus, say, two Power Functions motors. (Only the NXTs will have rotations sensors, obviously.)

If you already have some PF kit, you will only need the sensor (£40). If you don't already have the remote, PF IR sensor, PF motors, and battery box, it will cost you a lot.

If you have the trains or RCX, you shouldn't need to buy anything new.

I have one of these, and use it quite a bit, it's quite a versatile piece of kit!

I built the 3 to 4 multiplexer posted above (thank you for posting that) but was able to tweak it into a 2 to 4 mux. The axles that are connected to the large gears are used to select the outputs by rotating the large gears.

It ended up being too big for what I needed though so I went a different route and built a 2 to 4 multiplexer that uses a turntable to move the drive gear around to the various outputs. You could easily add more outputs to this if you wanted. Just be aware that unlike the larger 2 to 4 mux, only one output is active at a time with the turntable mux.

The LDD files, videos of these in action, etc are on my blog:
Lego Technic Two Input, Four Output Motor Multiplexers