Repurpose Old Earphones to Capture 3D Printing Time-Lapses

13K12041

Intro: Repurpose Old Earphones to Capture 3D Printing Time-Lapses

As a writer here on instructables I've always wanted to film the process of 3D printing. However, 3D printing takes a really long time, so you have to fast-forward the video if you want to make it a little more interesting. Problem is, you can't just capture 6 hours of film and turn in into a 5 seconds video, because everything would be moving really fast and you'd be giving your audience a headache. So people have come up with a cool solution- instead of capturing the entire 3D printing process, reduce the number of images to 1 image per layer. After every 3D printed layer is complete, the printer head moves to a certain position, and an image is taken. The results are hypnotizing - the object you're printing seems to be forming out of thin air.

So, I wanted to do be able to capture these awesome videos myself. I looked around, and it seems that most people are using a Raspberry Pi or some kind of a micro-computer connected to a web app called OctoPrint. It's awesome, it really is. But Rasberry Pi costs over 100$ these days and are pretty hard to find ever since the COVID chip crises started. Honestly, I just wanted to start capturing 3D printing time-lapses today. Also, my 3D printer is working perfectly, and I didn't want to mess with my workflow - I don't want a new micro-computer and I definitely don't want a new software.

In this instructable I'll show you how to start capture 3D printing time-lapses in about 1 hour from now.

All you need is a few basic components you're likely to already have, and a access to the Cura slicer.

Here's a short overview of the instructable:
  • We'll use a smartphone camera to capture the time-lapses.
  • To use a smartphone, we'll need a way to trigger its camera externally.
  • We'll build a simple external trigger using a pair of old earphones, and see how it works.
  • The trigger will be mounted to the 3D printer, and a simple Cura command will tell the printer to press the camera trigger once each printed layer is complete.

Let's get going then :)

I hope you follow along, and let me know if you have any questions or comments!

STEP 1: Video Version


For those who want to see a narrated video version the project, feel free to watch the one I made

This is a good point to mention that if you want to support my future projects (for free!) subscribing to my new YouTube channel is the best way to do that! :) Thank you so much!

STEP 2: How Is This Going to Work?

To get everything up an running with the least amount of trouble, I decided to capture images with my smartphone. Many people, including myself, have old smartphone laying around, usually with pretty decent camera.

The idea here is to add an external camera trigger, which we will later mount on the 3D printer. A simple setting in Cura will help us capture images with this trigger (1st image).

The most common way I know of to trigger a camera is a selfie stick. You connect a cable to the audio jack of your smartphone, and when you press the button on it, the smartphone camera is triggered (2nd image). This is exactly the mechanism we need here.

So I pulled out my multimeter and checked what happens when you click the button on the selfie stick. It turns out that when the press the button the only thing that happens is that the 3rd and 4th terminals are connected via a 220-Ohm resistor (3rd image).

So all we need is a a triggering mechanism with a 220-Ohm resistance. I made a simplified circuit diagram to make things clear (4th image).

STEP 3: Prepare the Old Earphones

Say goodbye to your old earphones, and cut them off, leaving the headphone connector and a the wire attached to it.

Expose the electric wires in it. Remove protective cover. I primed the wires using soldering wire to make things go smoothly.

Finally, identify which wires are connected to the 3rd and 4th terminals and cut off the other two.

STEP 4: Add Resistor

Connect a 220-ohm resistor to one of the wires coming from the headphone jack.

If you're adding extension wires like I did, connect one of the extension wires to to other side of the resistor.

Put some electric tape or a heat-shrink cover over the soldered wires to protect them.

STEP 5: Connect to the Limit Switch

Connect the two wires to the limit switch. Most limit switches have 3 terminals. Clicking the switch connects the outer terminals with the middle one. So pick one of the outer terminals, and connect one of the wires to it. Now connect the other wire to the middle terminal.

STEP 6: Test It!

At this point you should have the headphone jack on one side, connected to a limit switch on the other side, with a resistor connected to it in series (see the diagram in step 2).

Before we move on, test your wiring and make sure everything works!

Use a multimeter to check that the switch is working properly - it should show 220-Ohm resistance between the 3rd and 4th terminals once the circuit is closed.

Now plug in the audio jack, open a camera app, and make sure it triggers your camera.

** Please note that this method worked with 3/4 phones I tried. I have no idea why it didn't work with the 4th one, but it's something to consider. However, if it doesn't work with your regular camera app, it still might work with the 'Open Camera' app, I mention in Step 8.

STEP 7: Attach to 3D Printer and Find the Right Settings

In the next step we're going to tell the printer to move to a certain position after each layer is complete, and we want the camera to capture an image at that point. The way that's going to work is by having the print head manually press the limit switch, which will trigger the camera.

Mount the limit switch to your printer at a position you think is best. It should be somewhere that moves with your z-axis (if it moves) but you also need to make sure that it doesn't interfere with your prints. I mounted it at the end of my x-axis rail, so when the print head moves all the way to the right, it press the limit switch. To connect the limit switch, I printed a small custom holder, but you can also use hot glue or something to get the job done**.

To be as precise as possible, follow these steps:

  • Home your printer.
  • Using the printer's interface, slowly move the print head towards the limit switch.
  • Once the limit switch is pressed, write down it's position. You'll need it in the next step. For me, that happened at x = 195mm.


** I would share the file for the limit switch holder, but it's really specific to the limit switch you're using, so I don't think my design could help many people, and I don't want people to print useless parts.

EDIT - due to requests the STL for the holder is now available. Honestly - chances are you'll need a different holder for your print & limit switch.

STEP 8: Cura Settings

Now we're going to use a built-in Cura plugin that'll help us capture the timelapses. It'll tell the printer to repeat a few simple instructions after each layer.

  • Go to in the Extensions tab go to Post Processing -> Modify G-Code.
  • Press Add a script, and look for the 'Time Lapse' script.

How to set it up

  • The 'Park Print Head X', 'Park Print Head Y' will move the print head to these x & y values after each layer. Use the values you measured in the previous step.
  • The 'Pause Length' tells your printer how long it should remain at the parking spot. This depends on your phone's ability to capture images. If it's quick, pauses should be short. I used an old smartphone so it had to stay parked for about 800ms for an image to get captured without getting blurry. However, if you pause for too long, the smartphone may capture multiple images after each layer, which is annoying.
  • Set the Retraction Distance to a value similar to the rest of your print. If you don't do this, your print is going to get a ton of stringing.
  • Finally, I set the 'Z-hop...' to about 2-3mm, which means the print head slightly moves in the Z-direction before each pause (and moves back when it's all done).

Press close, and you're done.

Notice that the modified G-code won't be shown in Cura just yet. You can only see it if you slice the model and re-open the G-Code file in cura instead of the STL file.


STEP 9: Open Camera App

Instead of using my phone's built-in camera app, I used an open source camera app called 'Open Camera'. It's awesome. You can set the focus and exposure manually and keep them locked for the entire video (which is important), and pick whatever resolution you want the images to be (I picked 4K since that makes for a really high resolution video).

Another convinient option is to automatically save the images to a google drive folder, so you can view the print from a distance and see how things are going.

STEP 10: Tips and Tricks for the Perfect Timelapse

Here are a few extra tips to get you start smoothly

  • Make sure to only use artificial lighting. We're used to people saying that the best images are captured with daylight, and that's true, but when capturing 3DP time lapses you have to remember that a video can last longer than 24 hours. If you don't want your videos to flicker, close the curtains and turn on those LED's. See First GIF for an example.
  • Start small! Test your Cura settings and make sure the X, Y parking spots are perfect and that clear images are taken. I had to find the sweet-spot between capturing 2 images after each layer and capturing blurry images by modifying the pause length. See second GIF for an example.
  • Once the images are all captured, you have to stitch them together into a video using whatever video editor you like. To really have a smooth looking video, make sure you play around 30 frames per second. That's 30 layers per second! So if you have a print with 300 it should last for 10 seconds max.

STEP 11: Capture Your First Timelapse

You're all done! It's time to give it a go! Like I said before, you should start small, because things do take some fine-tuning, and you don't want to find out you have something wrong 24 hours into the print.

That's all for today! Hope you enjoyed reading, and if you have any questions - let me know in the comments!

If you like my instructable and want to see more, you're welcome to visit my instructables page and my website

34 Comments

Great write up. I have some advice for people who aren't comfortable with soldering and/or can't find a limit switch: Use that same pair of earphones with the button... but keep the wires intact. Download the Android app, "Tasker" and make a profile that takes a picture every time the headphone button is pressed. Now all you have to do is mount that button in a way that the print head is going to press it. Perhaps you can print a tiny pointing finger to do it. :)
Thank you, I am still learning more about soldering and I am not quite comfortable soldering this. Thank you for the advice!
Take a look at my "tiny pointing finger" in the "I Made It" section.
Nice idea! Thanks:) I tried looking for apps but they all seemed either too sketchy or had to be purchased, I'll look into your suggestion:)
Thanks for the input! I'm sure some people will find it useful!
Simple yet brilliant solution. I've always admire these videos.
Thanks Yonatan! :) I love your projects, and to think you were 13 when you posted some of them :)
I made it! BUT... I built it as instructed with a switch and wiring to trigger the camera on my Samsung Galaxy phone. After constructing everything, I found out that triggering it via the wire just didn't work. So I borrowed the ideas and took a different approach, using a Bluetooth button. Please look at my details in the I Made It section.
And many thanks to Nir for inspiring me to carry through with this.
Thank you for recommending Open Camera. The default camera app on my Samsung Galaxy would timeout between layers. Open Camera saved the day.
I'm glad it helped! Did you manage to capture a timelapse?
Thanks for the positive comment:)
I love it - and my students would, too!! Only problem is - we have MakerBot Sketch machines in our classroom, and I don't think they use Cura (do they? I'm still learning all of this, myself). Is there a way to do this with MakerBot Print? Or - any other way that it could be done with MakerBot Sketch machines?

Thanks!!
@fstegall If the printer can print G-code from a file, you can have students manually modify the file before printing. It can probably be done very easily with search and replace in any text editor or even better have them write the script for it. There is probably a clear way to find in the G-code where the layer change is by searching for Z axis movement or some slicer comments. This would help your students understand how 3D printers and G-code works
Hi,
Honestly I don't know about MakerBots, but a short google search told me you can't use Cura with them that easily. However, they often have a built-in camera, and in that case you could use it to capture time lapses. I googled "how to capture a 3d printing time lapse using ultimaker" and found this post about doing it using python. See the comments for help:
https://community.ultimaker.com/topic/16598-making...

On the other hand, I saw some stuff about a merger of MakerBot and Ultimaker so I guess maybe Cura will support MakerBot printers soon? I don't know :)

Anyway, I hope that helps!
Very good idea. Just wondering, when you talk about leads 3 and 4, where do you start counting? At the tip of the jack or at what is usually called 'the ring'.
Thanks for the question:) as parapedro mentioned, I count from the tip (I show it in the video by the way)
Great idea.
I have a manual knob on the top of the Z-axis feed screw on my Ender. I was wondering if you've given any thought about fitting the microswitch to the top so it clicks on the knob. Or maybe attaching a magnet to the knob and using a reed switch.
Thanks for the comment :)
I was thinking it would be convenient to keep it in the x-y plane of for two reasons:
1) The built-in plugin for Cura has limited control over the z-axis movement, and I wanted the project to be accessible to as many people as possible, so I didn't want the project to include any coding.
2) The z-axis is meant to be a lot more accurate than the x-y axes, and that means it moves a lot slower. Moving all the way to the top of the built volume will probably make the time-lapse pauses to be very long (which will make the print itself much longer as well).

Your idea of using a reed switch is fantastic! I used a limit switch because that's what I had laying around, but a reed switch would be perfect! It would require less fine tuning of the position of the print head.

By the way, out of curiosity, is that knob you added used for shutting down the printer when a print is done?
The knob was originally fitted to act as a bearing at the top of the feed screw and stop it flapping around. But it is handy when the machine is powered down. By utilising the the knob and an arrangement for the switch you would eliminate the need to make changes to Cura, as the print head would not need to move from the model to trigger the photo.
I guess the disadvantage is that the print head would appear in the movie.
First of all, your printer looks amazing, well done:)

You're saying maybe the knob should trigger the camera? Something like making it go 1 full turn after each layer? That's a nice idea. Wouldn't the camera be triggered on other occuasions too? Every time the printer moves a certain amount in the z direction the knob would be in its triggering position, right?
Yeh! I did some maths and it didn't work out. 1 turn of the feed screw moves the head up 8.2mm. Divide that by layer thickness .04mm comes out to 205 increments in 1 turn. Divide 360 degrees by 205 means it has to be triggered every 1.75 degrees. A bit too fine for a little 45mm knob to be divided into and be able to trigger a switch. Might have to look at making a gear train to get a better result. Oh well. It was just a thought.
I love the creative thinking though! It's not common to have someone look at a problem/solution and look for a completely different solution. And I appreciate how you gave it a serious thought and tested the idea before actually building it. I'm sure your idea of counting turns could be useful sometime, I'll keep it in mind!
Thanks for the comments and for the nice conversation! :)
Nir
More Comments