Introduction: 3D PRINT a STEAM TRAIN 🚂 With Live Camera Streaming and Wifi Controls

Hello I’m Lewis and this is how to make your very own 3d printable steam train complete with a cool water based smoke effect, inbuilt miniature camera which streams a live view as it drives around your garden, living room or model railway and a working front lantern. It looks soooo cool at night! 😄

The tracks are also 3D printed and are suitable for outdoor or indoor use. My train was printed in PLA for ease and the track in PETG as I installed mine outdoors permantley. The track has been outside for around 28 months and still works perfectly fine.

All of this is controlled from your existing smart phone by connecting directly to the trains own inbuilt web server and wifi network powered by an ESP32-CAM.

Everything has been designed to an ‘O’ gauge model railway standard so you can mix and match it with other O gauge models and track.

I wanted a garden railway for some time but the trains were expensive, especially those with smoke effects, this one was much cheaper to make,plus I got to paint it how I want it and learned a few things along the way whilst making it.

On this page you'll find everything you need to know to be able to build your own. You’ll need a 3D printer and a few basic electronic components. 

Step 1: Instructional Video

I have created an in-depth instructional video which goes hand-in-hand with these written instructions. You'll be able to follow the entire project through to successful completion using just these written instructions here. The video offers the opportunity to see the train in action and might serve to clarify any steps I might struggle to fully articulate here.

Let's start with a list what you'll need to make your own...

Step 2: Things You'll Need to Make Your Own

As well as the below items you'll also need a 3D printer and soldering iron (or a friend with both who may also be willing to lend a hand).

Step 3: Printing the Base, Cabin and Coupling Mount

For ease of printing I have printed all of my train parts in PLA plastic. (The track was printed in PETG - I'll elaborate more on this towards the end of these instructions when we prepare the track).

The first three parts that you need to print are attached to this step. They are:

  • Coupling-Mount.stl
  • Train-Cabin.stl
  • Train-Base.stl

None of these parts require supports when printed in the correct orientation. I have already orientated the STL files for you so they should be correct as soon as you add them into your slicing software to prepare them for printing.

Step 4: Decorating the Parts

I decided to decorate each of my printed components before assembling them. This is an entirely optional step - you can leave the parts in their original filament colour if you wish.

You'll need a just a few things to decorate the train as I did. If you're lucky enough to have an airbrush, great, but I didn't (as much as I wanted to treat myself to one) so I used spray cans and paints along with a small basic kids paint brush. You'll find these listed in the first step above.

Undercoat

To help disguise the original colour of the filament used for the printed parts I started with a base coat of 'Hycote Grey Primer'. Not only does this cover the parts original colour, but also provides better adhesion for the following layer of paints and slightly reduces the appearance of layer line artefacts from the printing process.

Follow the instructions on the can. Mine required shaking for a few minutes and then painting several thin layers with a side too side motion. To help me get at all the surfaces I used some blue tac to temporary fix the printed part to then of a glass bottle.

Decorative coat


I used a common cheap children's painting brush and some Vallejo acrylic model paints to add the colours. I found these to have excellent coverage quality and further helped to reduce the visibility of layer lines. I applied at least two coats of this allowing around 10 minutes to dry at room temperature between applications.

They also stock a range of 'liquid metal' paints which create a very smart and eye catching metallic metal effect. I opted for gold on one of my models and bronze on the second. Both really gave a fantastic feel of a highly cared for and polished steam engine.

Protective coat


To help protect the paint job from abrasion and dampness I finished the model with a few coats of clear gloss sealer. This is also gave everything a lovely sheen. If you wanted something less reflective then you can get sealing sprays in matt and satin finishes as well.

Step 5: Assembling the First Prints

For the step you'll need:

  • Your three 3D prints from the previous steps
  • M3 x 8mm bolts (x4)

First attach the cabin to the base with two bolts through the inside pair of holes whilst ensuring that the 'cap' like end of the cabin is pointing away from the base print.

We can then add the Coupling Mount print over the two remaining holes so that its arm is also pointing away from the base print like the cabin before adding the last two bolts through all three prints.

Step 6: Securing the Way Connectors

For this step you will need:

  • Your pair of Wago style wire connectors

In preparation for the wiring later we can use some hot melt glue to fix the two wago wire connectors into place in the two parallel recessed slots in the base slots. The slots can accommodate a three or five way Wago connector.

You should install them back to back with their levers for opening and closing facing outwards.

Inject some additional glue between the two connectors, filling the gap, to help provide additional strength when we are opening and closing the little levers on them later.

Step 7: Printing and Painting Lantern

For this step you need to print:

  • Lantern-Case.stl (x1)
  • Lantern-Insert.stl (x1)

As before I printed these two parts in PLA. The Lantern case is the first part which would benefit from some support material when slicing the model for your 3D printer.

Once printed I painted my Lantern-Case to increase its visual appeal and highlight the details. There is no need to decorate the Lantern-Insert as it will not be seen when the project is completed.

Step 8: Installing LED Lantern

For this step you will need the two prints from above as well as:

  • 5mm LED (I used cold white) (x1)
  • 220 Ohm resistor (x1)
  • Two 11m long lengths of wire

Pass the LED’s legs through the lantern insert (there are two little holes in the front) and then gently slightly spread the legs apart from the other side to hold the LED in place. 

The resistor is added to the positive leg of the anode which is the longer of the two legs, Shorten both of the resistors leg with snips and the anode on the LED before soldering them together.

We can then also shorten the remaining LED leg and solder an 11cm long wire to the resistor and another separate 11cm wire to the other leg.

When you bend the completed legs downwards the positive leg and its resistor should not be any longer than the print - this is so we can conceal them inside the lantern.

Use some hot melt glue to fix the legs in place and provide insulation between them.

Step 9: Add Some Shine

For this step you'll need:

  • The parts from the previous step
  • Kitchen foil (preferably the thicker/stronger variety)

To create the reflective cup inside the lantern I used some strong kitchen foil. Simply cut some small trips and fit these inside the bowl surrounding the LED.

Be careful not to push the foil so far into the opening that you create a short between the LEDs legs. If you’re worried about this you can use some more glue to seal the edges of the LED first. 

Fold it tight around the front so that we can then slide the lantern cover over the top of the insert. Tahdah!

Step 10: Mounting the Lantern

For this step you will need:

  • The parts from the previous step

And to print:

  • Lantern-Bracket.stl
  • Train-Front.stl

Thread the wire from coming from the back for the Lantern through the bridge like hole on the top of the Lanterns Bracket.

We can then use some glue to secure the lantern to the top of the mount towards the front edge.

Continuing along the front section of the train we can print the very front of the engine. I printed mine with a large brim to ensure it remained attached to the print bed.

A quick lick of paint and we can then pass the LED wires through the front section (there is a small tunnel just at the bottom of the funnel) and use some glue to attach the lanterns bracket to the front of the model.



Step 11: Adding Connector to LEDs Cables

The wires from our LED will need attaching directly to the ESP32-CAM shortly.

I’ll be adding Dupont style connectors to these wires which is easy to do yourself - in fact I have made separate video showing you just how easy. You can see that here: https://youtu.be/jET1QTP1B7c

If you don’t want to add connectors to these two wires than you could instead directly solder them to the microcontroller later.

For the rest of wiring I will be trimming down female jumper wires by cutting them to the length required and stripping the other end to show bare wire. It’s also good practice to tin the stripped end by adding some solder. This will help improve your electrical connections.


Step 12: Adding the Atomiser

Now for the atomiser, the magic behind the smoke effect....

I want to quickly explain to you how it works so that you know what we are aiming to do as we incorporate it into our project. The disc which atomies the water has two sides - the larger silver side should touch the top of the wick which when wet will draw the water to the atomiser. To test yours like I am you can use a USB cable to power the driver and then press the button on top to start the atomiser. After ensuring the wick is wet (just use normal tap water) gentle touch the larger side of the silver disc to the top of the wick and you'll see ultra-fine water droplets propelled from the top side of the disc.

We will make some simple modifications to the driver later so we can control it from out smartphone as opposed to using the button.

To begin installing this into our model the wick material should be trimmed to about 37mm in length and then inserted into the top of funnel leaving it slightly proud so we can certain that the disc will make contact with the wick later.

Insert the atomisers cable down the cable chute in the top of the funnel. If needed you can use your brass rod to help feed it through. Then carefully fix the atomiser into place on top of the wick so that the wick remains in contact with the underside of the disc. I used hot melt glue so I could readjust it if necessary later if needed.

Don’t forget that it is the larger silver side which should be pressing against the wick. The smaller one faces upwards.


Step 13: Preparing the Brass Rod Axles

For this step you will need:

  • Brass rod
  • Saw
  • Clamp / Vice

And to print:

  • Drive-Carriage.stl

Once you have printed the Drive-Carriage we can use the drive carriages handy cutting aid which I have incorporated into the printed part to cut 7 lengths of brass rod to the appropriate length (approximately 39mm’s) before we then use it to assemble the driving components. 

To use it we will insert the 3mm brass rod all the way into the opening at one end until it hits the stop at the end of its travel.

First gently but firmly clamp the carriage in a vice, insert the rod as far in as it will go and then whilst holding the rod steady with one hand, use a saw to cut the rod between the two fins at the end. (As shown by the arrow in the above photos).

Repeat this until you have seven rods each about 39mms in length. We can then use a file or similar to smooth off the sharp edges and any burrs. This will save hurting yourself later or damaging the bearings.


Step 14: Preparing the TT Motor

For this step you will need:

  • TT Motor
  • Two 15cm long wires

Turning to the motor next, cut and strip two 15cm long lengths of wire, solder a separate one to each terminal on the motor. These can be a little delicate so take care when bending them to accommodate the wires.

To help prevent them breaking later add a dab of hot melt glue to act as a basic strain relief on each of the connections.

I also painted my motors plastic parts black so as to blend in better than the standard super bright yellow would.



Step 15: Installing the Motor

For this step you will need:

  • The motor assembly from the previous step
  • Four M3 x 8mm bolts

The motor is simply slid into the inside of the Drive Carriage. The end with the wires should be towards the centre, and one side has an additional plastic dimple on it which should align with he cutout in the side of the 3D print (take a look at the first photo showing this).

This is then secured with your four M3 x 8 bolts. 

Step 16: Printing & Preparing the Wheels

For this step you will need:

  • The rubber gaskets (x4)

And to print:

  • PoweredWheel-Round.stl (x2)
  • PoweredWheel-Keyed-90.stl (x1)
  • PoweredWheel-Keyed.stl (x1)

Begin by fitting the four gaskets onto the four wheels by stretching it around their front and then pushing into the outer groove so it sits in tight to the wheel. We add the gaskets to provide the train with better traction on the 3D printed tracks and to reduce the noise from the wheels.

Step 17: Fitting the Wheels

For this step you will need:

  • The four wheels from the previous step
  • One of your cut brass rods
  • Two of your bearings

Powered Wheels - Keyed

For the wheels which will be mounted directly onto the motors axles (the 'Powered Wheels') you will find two different versions to print - one has its connection for the linkage rod rotated 90 degrees so the drive wheels are less likely to jam in whilst using the finished model.

It does not matter which one of the PoweredWheels goes on each side, they are simply press fitted onto the white axle of the motor. You should not need to, but if you do, you can also install a small screw to hold them into place.

Powered Wheels - Round

To prepare these, insert one of the brass rods we cut earlier into one of the wheels from its flatter side, followed by the two bearings and then the other wheel. You may need to use a hammer or vice to press everything together. 

Add this into the carriage ensuring that the two bearing align with their respective slots and then are pushed firmly into place, this may also need some persuasion - just check that the axle still turns freely after insertion.

Step 18: Linking the Wheels

For this step you will need:

  • Four M3 x 8mm bolts
  • One M4 x 20mm bolt

And to print:

  • Drive-Link.stl (x2)

Print two identical wheel links and attach them with M3x8 bolts to each pair of wheels on each side. Ensure that the wheels are rotated before you install the link so that the linking rod itself will remain horizontal to the ground. (See comparison photo for clarity).

The carriage itself is then fitted to the rest of the model using the M4 x 20mm bolt after passing the motor wire though the arc shaped cutout. The bolt is inserted from the top. The bolt should be loose enough to allow the two parts to swivel in relation to one another but not so loose that you experience excessive wobbling of the developing engine section.

Step 19: Fitting the Motor Driver

For this step you will need:

  • Motor driver board
  • Two M3 x 8mm bolts

The driver board is fixed into position on the trains base using at least two M3 x 8 bolts.

The two wires from the drive motor can then be connected to the screw terminals marked as for Motor A. If later you find the train drives in the wrong direction compared to what you tell it then just switch these two wires over.

Step 20: Programming the ESP32-CAM

For this step you will need:

  • ESP32-CAM
  • USB Cable
  • FTDI Board
  • Computer

Next up is the microcontroller, We will upload the code for this project to the ESP32 before fitting it into the front of our train.

To make following how to upload the code easier for me to keep up to date (as changes in software regularly occurs) I have posted the written tutorial on my website with links to the code and a detailed step-by-step guide for the programming of the ESP32-CAM.

You’ll be guided through exactly what to do even if you’ve never programmed one of these before. It’s really easy so don’t be put off.

https://www.diymachines.co.uk/wifi-3d-printed-steam-train-with-live-view-camera

In short, as an overview, it involves downloading the Arduino IDE, adding a board manager for the ESP32 and the libraries we are using followed by uploading the code to the board itself via the FTDI ver USB.

Once you have followed that short section on programming the ESP32-CAM you continue on with the next steps here on this Instructable. 🙂



Step 21: Installing the ESP32-EYE

For this step you will need:

  • Programme ESP32-EYE from previous step
  • Four M3 x 8mm bolts

You'll need to 3D print:

  • Board Retainer.stl

After you have uploaded the code we can print the Board Retainer (attached) and prepare it by partly installing the two bolts from the side of the retainer without the 'bump'.

Before adding the ESP-32 you will need to remove the protective film covering the cameras lens and then gently introduce a z-like fold to the cameras ribbon cable.

To fit it inside the 3D printed Engine Front begin by ensuring the camera module is pushed into its square recess on the inside of the model beneath the funnel. You’ll then need to encourage a slight fold of its ribbon cable again as before whilst you secure the ESP32 so that it nestles into position against the top of the print. 

The bright red one in the images above I printed in half just for the purpose of being able to show you what I’m trying to explain. 😊 The black circle I drew is highlighting the Z-like folding of the cameras ribbon cable. This continuously keeps the camera pressed into place.

Hold the ESP32 in place with the 3d printed Retainer ensuring the protruding side is pressing against the microcontroller.

This assembly is then attached to the rest of the train using another two M3 x 8mm bolts from the underside of the train.


Step 22: Wiring Things Together

I'm going to guide you through the wiring step-by-step now for all the connections going to the ESP32. You'll find a wiring diagram attached to this step for reference as well as a video stepping you through the same steps here: https://youtu.be/2DW-F3tMyNs?t=1128

For this step you will need:

  • Wires of various lengths with female Dupont connectors

Prepare a pair of 14cm long wires with female connector at one end - I trimmed down some jumper wires for convenience and connect to the 5v and GND pins on the ESP32, that’s the top two on the right as seen from inside the train.

The 5V wire from the top pins should be connected to one of the wago connectors and the GND wire to the other. Take note of which one of your wiring blocks is your positive 5v one and which is ground so you connect your future 5v and ground wires correctly.

Your next two wires should have female connectors on both ends and will be used to control the steam effect. They go below the first two wires on the ESP and then the bottom one of this pair connects to B-1A on the motor driver, and the other wire to B-1B.

Again, add two more female jumpers to the next pair of pins down on the ESP and the top one of this pair connects to A-1A and the other to A-1B on the motor driver. This pair controls the speed and direction of the trains motor.

Use two short female jumpers with one end removed and the wire exposed to connect the VCC connection of the motor driver to your collection of positive wires and the other to join the GND to your grounded collection of wires.

The positive wire coming from the lanterns LED connects to the next available pin on the right hand side whilst the ground lead connects to the fourth pin down from the top on the left hand side.

Step 23: Assemble the USB Power Cable

For this step you will need:

  • DIY USB Connector
  • Two 22cm wires

We will connect the power next so we can test what we have assembled so far. To do this we need to make up our USB power cable.

Prepare two 22cm long wires and solder them onto the positive and negative contacts of your male USB connector. On mine the positive is on the right and negative on the left - you can verify this on your own one with a multimeter if you are unsure.

Assemble the plug by push fitting the two plastic halves of the USB casing together around the connector and then pass the bare wire ends through the boiler via the cabin and then connect the positive lead to the positive wago connector and the negative to the other.

Step 24: First Power, Camera, WiFi and Light Test

For this step you will need:

  • USB Battery Pack

Let’s start it up for the first time so we can test the wifi, camera, motor, and LED in the lantern before continuing.

Connect the USB cable to your USB battery pack. 

If power is present the red LED on the motor driver will illuminate. Wait a few seconds and then search for wifi networks on your phone.

Connect to the one labelled as ‘Smart_Train’

Once connected open the web browser and navigate to 192.168.4.1

You should see a live view from the camera you mounted in the front of your train. (Pretty cool huh?) 🙂

Press light on to test the LED circuit.

Before you test the motor, prop your model up so the wheels are not touching the ground, and then choose a direction and then press ‘faster’ to increase the speed until the wheels turn. Don’t forget, If the wheels are going the wrong direction just swap over the two motor wires where they connect to the screw terminals on the driver board.

If your having any problems check your work so far, and if you’re still stuck on anything check this projects Discord server or its FAQ section on my website where I’ve included answers to common questions.


Step 25: Completing the Steam Effect

For this step you will need:

  • Atomiser Driver Board
  • Two 6cm wires
  • Two M2.5 x 8mm bolts

We need to slightly modify the control board for the atomiser so that we can control it remotely. First prepare two 6cm long wires which need soldering to the power points marked + and - behind the USB connector.

Secondly, on the underside of the board we need to bypass the control switch by using some solder to bridge across the two points as marked in the fourth photo and bridges in the 5th.

The board is then secured to the train using the two M2.5 x 8 bolts

Connect the atomiser lead to its driver board and then the positive power lead to the Motor Bs outside screw connection of the motor driver and the negative lead to the inside connectors screw connection.

Before we can add water and test the stem we need the train to be level so let’s add the other set of wheels quickly.

Step 26: Fitting the Top of the Boiler

For this step you will need:

  • Two M2.5 x 8mm bolts
  • Two M3 x 8mm bolts

You'll need to 3D print:

  • Train-Top.stl

We can now print (and optionally paint) and secure the top of the trains boiler sections using two M3 x 8mm bolts at the front and two M2.5 x 8mm bolts towards the rear.

Step 27: Assembling the Front Bogie & Wheels

Before we can add water and test the stem we need the train to be level so let’s add the other set of wheels quickly.

For this step you will need:

  • Two Cut Brass Rods
  • Four bearings

You'll need to 3D print:

  • Passive Wheel.stl (x4)
  • Passive Boggie.stl (x1)

3D print the bogie itself and four wheels.I added some additional red paint to my wheels, choosing not to paint the surface that makes contact with the track as this would wear off eventually.

Ass before in an earlier step - add a wheel to another of your previously cut brass rods, followed by two of your bearing and then the other wheel. Fit this to the bogie (which might require the persuasion of a hammer, vice, or clamp) and then repeat for the second axle.

This is then all screwed to the underside of the train chassis using the M4 x 20mm bolt. Again, leave it loose enough to swivel but not so loose as to excessively wobble.


Step 28: Test the Steam

For this step you will need:

  • Some clean tap water

With the train now able to stand up level we can add some clean tap water to the funnel - avoid getting it down the channel our electronics pass through - if you like you could add some hot melt glue over it to help prevent this from happening.

You should fill it up but stop before it reaches the top edge of the printed plastic internals - the wick will draw the water up towards the underside of the atomiser. 

Whilst we wait about 30 seconds for the wick to saturate itself we can connect the USB power once again and reconnect our phone as we did earlier. Now this time pressing the steam buttons should result in the effect springing into life. If you have any difficulty with yours check that the wick is touching the underside of the atomiser plate correctly.

How cool is that! And there is no risk of children, pets or plants burning themselves on it as the mist is not created with heat so remains cool and refreshing. 🚂


Step 29: Print and Fit the Plow

For this step you will need:

  • Two M2.5 x 8mm bolts

You'll need to 3D print:

  • Plow.stl

The plow can then be printed and attached to the front with two of your M2.5 x 8mm bolts.

Step 30: Assemble the Tender

Now we can make the tender - this will house the lithium ion battery pack ensuring it is easy to change or recharge and is capable of accommodate a range of battery pack sizes.

For this step you will need:

  • Four M3 x 8mm bolts

You'll need to 3D print:

  • Tender-Base.stl
  • Passive Wheel.stl (x8)
  • Passive Bogie.stl (x2)
  • Tender-Mid.stl
  • Tender-Top.stl

Begin by bolting together the Tender-Mid and Tender Base with four m3x8 bolts.

We can then build another two sets of bogies just as we did for the trains front section and attach these with M4 x 20 bolts. Don't forget not to over tighten the bogies.

The Tender-Top 3D print nestles into the top of the model without any fixings required. This is to allow easy access to the battery pack.

Step 31: Assembling the Coupling System

The system for connecting the train and as many extra units as you want together is made possible with magnets.

For this step you will need:

  • Six M3 x 8mm bolts
  • Two magnets

You'll need to 3D print:

  • Bogie-bottom.stl
  • Coupling.stl (x2)

Your 10x3mm magnets are glued into place inside of the couplings ensuring the polarities are arranged so they attract instead of repelling each other. I let the two magnets attract themselves together and then added red dots to the two outside faces. I then ensued I glues this dots into the couplings.

The coupler for the train engine is fitted in place with a M3x8 bolt on the underside at the rear.

The other coupler is also fitted with a M3x8 bolt on the bogie bottom. The bogie bottom itself is then fitted to front bogie on the underside of the battery tender. 

Guess what?.... Don’t fully tighten the bolts so that the magnetic arms are able to rotate freely. 😄

Step 32: Printing Track

Built to an O gauge scale you can use your existing tracks or print new ones on your printer.

The train track is based on the design started by Depronized. I have made some tweaks to the track included on this page (to improve printability and strength slightly).

I printed mine in PETG as I would be leaving outside year round in my garden. My track has bee outside for roughly 28months and still functions just fine.

You can of course use the track indoors, in which case you should be fine to use PLA.

To create the two tone colour I change the filament in the printer part way through the printing process.

Step 33: Project Complete!

To make the cable going to the usb connector less distracting I wrapped mine in black insulation tape and then glued a 3D printed cradle for my USB battery pack into the tender to prevent it from rolling around.

Now it’s time to head out and play - and yes, sometimes you’re going to have to share the controls with the kids. 🚂

Thank you so much for reading through to the end - please do check out my other projects here on Instructables.

I also have some things for sale in my Etsy shop such as additional carriage designs for you to download and print which all help support the channel. And if you would consider regularly supporting these projects by becoming a Patreon that would be just wonderful.

Take care, do some good, and ciao for now.

Lewis

Backyard Contest

First Prize in the
Backyard Contest