Wall-Mounted Drybox for 3D Printing with Nylon

It’s well known that nylon based 3D printer filaments need to be dried out before they’re used. What happens though when you have a 30+ hour print? The spool can take on a lot of moisture in that amount of time and compromise the print.

Many people have solved this problem by making filament dryboxes, somewhat airtight containers that contain a desiccant to dry out the air inside of the chamber.

I have to print several large parts from nylon for client, and I was having trouble in the last hours of the print due to the spool taking on water from the air. I decided to build one of these chambers but with a twist:


Mine is wall mounted! Space in my lab is a premium and the walls are free real estate.

The parts for this build is are available on my Thingiverse page. Oh and if you’re curious, I’m using a wall-outlet-rechargeable desiccant pack from Amazon which I got for $15.

The bolts are M3x10mm, and the nuts are M3 nuts, both from McMaster Carr.

Thanks for reading!

Why you should use Processes instead of Threads to isolate loads in Python

Hey! I wrote this as a part of the secret sauce series over at my startup company Telapush. You can check out the rest of the posts here.

Key Learning

Python uses a Global Interpreter Lock to make sure that  memory shared between threads isn’t corrupted. This is a design choice of the language that has it’s pros and cons. One of these cons is that in multi-threaded applications where at least one  thread applies a large load to the CPU, all other threads will slow down as well.

For multi-threaded Python applications that are at least somewhat time-sensitive, you should use Processes over Threads.


I wrote a simple python script to show this phenomenon. Let’s take a look.

The core is this increment function. It takes in a Value and then sets it over and over, increment each loop, until the running_flag is set to false. The value of count_value is what is graphed later on, and is the measure of how fast things are going.

The other important bit is the load function:

Like incrementload is the target of a thread or process. The z variable quickly becomes large and computing the loop becomes difficult quickly.

The rest of the code is just a way to have different combinations of increment and load running at the same time for varying amounts of time.


The graph really tells the story. Without the load thread running, the process and thread versions of increment run at essentially the same rate. When the load thread is running, increment  in a thread grinds to a halt compared to the process which is unaffected.

That’s all! I’ve pasted the full source below so you can try the experiment yourself.

Multiple Frequency Counter for Arduino

Ever wanted to measure the frequency of a square wave using an Arduino? There are a couple of good solutions out of there to do this, but not all of them had the capacity to do multiple inputs. I couldn’t find this quickly so here is my solution.

Here’s the link to the code if you want to skip ahead. The code uses interrupts and doesn’t use any kind of delaying so it’s good for giant state-machine applications. My application for this is measuring signals from 10Hz-100Hz in which this can measure within 1% error. The absolute limits of the code are 1Hz-50KHz.

This project is on GitHub if you want to send a pull request to make improvements.


For testing, I wrote a simple function generator and uploaded it to a separate arduino. It outputs a pulse train with periods of 10ms (100Hz) and 5ms (200Hz) on pins 2 and 3. I attached LEDs and their resistors for debugging.

Pins 2 and 3 on the function generator to pins 2 and 3 on the frequency counter.


The code for this simple function generator is here:

Frequency Counter

This code will work fine in a stateless application, because there are no delay statements (which some other frequency counters I’ve seen online use). It’s a little bit complicated, send me a pull request if you can refactor it to be cleaner.

Here’s the sketch:

I’ve written most of the important notes as comments in the source, but a couple more details:

  • The important data is stored in period_averages_ms and frequency_averages_hz. You address them using the indices defined at the top of the file. Make sure you call compute_counts()  before using this data. Keep it somewhere in main().
  • You could easily add more frequencies, you just have to NUMSIGS, make a specific ISR, and another attachInterrupt line in setup()
  • It uses interrupts which might not be right for your proejct, but normally shouldn’t get in the way of too much stuff.
  • If the ISR hasn’t seen a new edge in 1000000us, both period_averages_ms[p_index] and frequency_averages_hz[p_index] will be set to zero! This means that slowest frequency that this code can detect is 1Hz!

If you have any questions on how to add more signals, leave a comment!


Here’s the output in the serial monitor attached to my function generator from earlier:


That’s like less than 1% error! Pretty good!

I also tested the code with a real function generator. Things worked really well until around 50KHz, so I would say that this code can’t be trusted past 50KHz.

50 Hz

50 KHz

Thanks for reading!

#goodprints – Episode #1

Here’s a video:

For a while I’ve been logging my favorite prints here but some of them are two small to warrant a post. So introducing: #goodprints! At first I’m going to shoot for monthly installments, but as I print more, I’ll post more.

This time we’ve got 3 prints in the above video. Here are the details:

Raspberry Pi Wire Shelf Mount – Everyone knows that wire shelves are the best. Now you can securely mount a Raspberry Pi to one. Thingiverse Link

Here is the drawing for mating with the shelf:

Wallet, Keys & Leatherman Wall Mount – I’m constantly loosing these things in my lab, now they’re not going anywhere. Thingiverse Link

Wall Hook – This is for mounting stuff like filament spools, wire, and tape to the wall. It accepts 3/4 inch dowels. There are two version, one 85mm long and one 150mm long (designed to fit hatchbox 1kg filament spools). Thingiverse Link

Forcing a screen resolution of an Ubuntu guest OS in VirtualBox

I figured that doing this would be nontrivial but turns out it took a little work:

I’m trying to emulate an official 7″ Raspberry Pi Touch Display in a VM, so for this post the target resolution is 800 x 480. If you want to change it to another resolution swap in yours for the rest of this guide.

First, make sure Auto-resize Guest Display is deselected in Virtualbox:

Run the following command in your terminal:

The output should look something the the following, starting with Modeline

Copy the text after Modeline so in this case it would be

And paste it after the following command:

NOTE! You may want to change the 800x480_60.00 to something without an underscore in it, it was causing problems on my system. I changed it to pidisplay. The resulting command for this example is:

You should be able to run the above command without error. Next, run:

You’ll be greeted with output similar to this. Note the name of the display device, in this case VGA-1.

With that output name, enter the following two commands:

After running that second command, the window should jump to it’s new resolution! You’re done!

#codehell 2 – THERMAL RUNAWAY Errors on Prusa i3 MK2 3D Printer

This time we’re trying to work through a hardware bug!

Without warning, my printer would stop it’s current print and display “THERMAL RUNAWAY” on the display screen:

This would happen once every couple of prints or so.

According Prusa’s Docs a common cause of this is problems with the thermistor connection. They show a graph that has very erratic readings from the sensor:

 This seemed like a good place to start so I re-seated the connector and used octoprint to generate my own graph:

No erratic readings, the temp would drop off and then start heating back up.

The problem ended up being the connection between the terminal lug and the wire on the heater in the hotend. To fix this, I cut off the crimp lug and stripped away some insulation. I put this into the screw terminal block. I’ve done a couple of prints and had no issues after making this modification.

Automatically run Electron application at reboot on Raspberry Pi

Here is a quick  way to have an application built on electron run at boot on a Raspberry Pi. This worked for me running Raspian Stretch with Desktop.

Edit /home/pi/.config/lxsession/LXDE-pi/autostart with nano:

Add the following line:

The file should now look somewhat like this:

Save and exit nano and reboot. Your app should open after the desktop environment loads. Yay!

If you want to be able to get access to the terminal output of your application, install screen with:

And then swap:


In the above code snippets.

After the pi boots, you can run screen -list to see what screens are available to attach to then attach to yours with screen -r yourscreen. Here’s an example:

Press enter, and then see your terminal output.
For more info on how to use screen, check out this link:


CHAMP: Compliant Hook Arboreal Mobility Platform (Senior Thesis Project)

For my senior thesis project at WPI, myself and two colleagues (Rachael Putnam – RBE/ME and Mead Landis – RBE/ME) designed a tree climbing robot. I was in charge of designing and implementing the electronics and controls software. I was the most intense project I have ever worked on, both in terms of difficulty and potential impact. Here is our poster for project presentation day:

Here’s a video of the prototype climbing:

We did a blog during the project, here is the best post I wrote:

The report is massive, check it out below:



Find distance between two zipcodes, dump the result in an excel file

I recently wrote a piece of software for a friend working on a project, you can find it on github here. The following is from the README.md:


This is a command line utility to automatically calculate the distance between two zipcodes and then put the results in an excel (.xlsx) file. It works for US postal codes only.

It was developed to help a colleague and is very application-specific.


Downloading is easy git, which is already on most systems, on ubuntu use:

For everyone else:


A step by step series of examples that tell you have to get a development env running

Say what the step will be


in a directory with the .xlsx file that you want to modify, run:

The program skips the first row in the spreadsheet to avoid headers.

Example Usage



Terminal output:




  • Devon Braysite
  • Miranda Lawellsite


This project is licensed under the MIT License

#codehell 1 – Electron cannot be started from an SSH session

Update: If you run export DISPLAY=:0 in the terminal prior to npm start, the application runs just fine on the remote device. Thank you Alex!

In working on an project for work, I have figured out the hard way that Electron has to be started from a terminal session on your target device (ie the computer it is to be viewed on). I am developing an embedded system based on the Raspberry Pi that does not take user input but displays information on a screen.

Upon downloading the electron-quick-start example, everything installs correctly without error and can be done remotely via SSH. Upon running with npm start, the following error is thrown.

I spent most of the evening trying to debug npm ERR! code ELIFECYCLE to no avail. On a lark, I connected a keyboard to the device and ran npm start and it ran without error. Sigh.

The remote development alternative for doing this is to use Remote Desktop Connection a client comes bundled in with windows. The software can be installed on the remote system (the Raspberry Pi) using apt-get install xrdp. Upon connecting, opening up a shell in the RDP client, and running npm start, the example application works just fine.