Introduction: Electric Locomotive for Wooden Train Tracks (USB Rechargeable)

This is a 3d-printed locomotive for Brio/Lillabo/... tracks that looks like an actual 19th century “cowboy” locomotive, is USB rechargeable, and can pull a quite large train. At the same time, it is small enough to fit under most standard tunnels and bridges, an relatively sturdy (my two-years-old had quite some fun with it).

The funnel acts as a switch. Turn it right once and the LED lights up. Turn it light once more and the motor starts.

For this I used a 2-pole, 3-position rotary switch. One of the poles is wired to the LED (+ appropriate resistor) and the other one goes to the motor. The positions are wired to the voltage supply depending on the wanted effect.




  • 3d printer
  • soldering tools

Step 1: Print the Parts on the 3-d Printer

I attached all the .stl files for printing here; they are also all included in this Thingiverse item.

I also included the OpenSCAD file in case you wanted to modify the model.

Using your preferred 3d printer (even a small and basic one will suffice), print all the parts.

  • Only the engine part will probably require support. In the default orientation, quite a lot of support is generated, but it is in the inside of the model and thus removing it leaves the outer surface quite nice. You can also flip the model upside-down: this generates far less support, but the model will not look as nice.
  • You will need two copies of the front_wheel, spacer and rear_wheel parts.
  • Use your imagination for the colors!

After printing you can check that everything fits together:

  • the three larger parts should fit together with the electric motor. Points to look for are the small “clicks” at the front end (between base and engine) and the insertion of the rear end of the base between motor and cabin.
  • At this stage you can also screw one M3 bolt (which is our front wheel axle) through each spacer (with the broader part of the spacer on the screw head side). This should be a very close fit.
  • The rear wheels should be a good fit on the motor.
  • The front wheels should be a loose fit on the spacer. This is on purpose: a loose fit allows those wheels to turn, which in turn helps the locomotive stay on the track.
  • You can also attach the M3 bolts (plus spacer and front wheel) to the base part.
  • The chimney should fit quite tightly on the rotary switch's handle (although leave them apart for now), and be comfortable to handle (I lightly sanded the asperities on top).

Step 2: Make the First Electric Connections

  • Using the battery wires, check the rotation direction of the motor. In my case, the positive wire goes to the upper pin of the motor, and the negative goes to the lower pin. (This is true independently of the rotation of the motor: if you rotate it by 180 degrees then the direction of rotation of the motor is reversed, but so are the pins).
  • Solder the two wires of the battery to the BAT- and BAT+ contacts of the USB card.
  • Strip a red and a black wire (~ 9 cm) and solder one end of these to the OUT+ and OUT- contacts of the USB module. (We don't use the IN+ or IN- contacts).
  • Check the operation of the rotary switch. On mine, the poles are on the positions marked x and y. When the switch is on first position (fully turned anticlockwise), x is connected to 1 and y is connected to a; when the switch is on second position, x is connected to 2 and y to b, etc. (On the 3-position switch, pins 4 and d are unused).
  • We will later connect the pole x to the LED (anode) and the pole y to the motor (+). This means that the pins labeled 2, 3 and c must be soldered together (as shown on the picture) and then connected to the OUT+ pin of the USB module.
  • The LED must also be soldered in series with the resistor; I found that soldering the cathode (shorter leg) made it easier for later assembly.

I had a 2-pole, 3-position switch. A variant existed in the same package as a 2-pole, 4-position switch. I should have ordered this variant instead, because then I could have used the switch to select the motor speed. If you have the 4-position switch then you need to solder together the pins b, c, d (so that the LED is on starting at the 2nd position of the switch) and 4 (so that the motor is on for the 4th position), and solder a resistor between pins 3 and 4 (so that the motor runs at a reduced speed on the 3rd position).

Step 3: The More Difficult Connections

Now it becomes a bit harder, because this is quite crowded in this locomotive.

  • Turn the engine part upside-down.
  • Looking from the rear, insert the LED in the hole. Turn it so that the anode goes towards the right side of the locomotive (facing up, so the left side when currently facing down).
  • Put a length of heat-shrink wrap on each LED leg.
  • Insert the rotary switch in the hole with the pins turned towards the rear of the locomotive. Ensure that one LED leg goes on each side of the switch.
  • Solder the LED anode to the x pin of the switch (see picture).
  • Run a wire from the motor + pole to the pin y of the switch and solder.

Step 4: Final Assembly

  • First insert the USB module and then the battery at the top of the cabin part.
  • Then assemble the motor (taking care that the + pole goes is above the - pole) and engine part.
  • Solder the black wire (that comes from OUT- of the USB module) to the motor - pole and the LED cathode.
  • Finally, insert the base below the locomotive and screw the M4 bolt at the rear end (through the ring magnet) to hold the whole thing in place.


First Time Author Contest

Participated in the
First Time Author Contest