How to 3D Print a Copy of your House Key

What You'll Need

Preparation

First, figure out if your house key is a Kwikset or Schlage. If it's made by another manufacturer then you'll need to find someone who's made parametric or similar files for your brand of lock.

Next, download the appropriate OpenSCAD file from the bottom of this article.

Measure Your Key

Now, get out your calipers and measure the depth of each of the "Valleys" of the cut, beginning with the valley closest to the shoulder of the key (the end you hold with your fingers when using the key).

The depth is the distance from the flat side of the blade to the bottom of the valley. Write down the values, as we'll use them in the next step.

Note: If you have an original key already, it may be printed with the 5-digit cut code right on the key already. In that case, skip ahead to the section on Setting up the OpenSCAD model.

Figure out the Cut Code

Keys are cut from the factory with "Codes". Each "Code" value corresponds to a cut depth. What we need to do is work back from the cut depth to the code.

To do this, go to this chart of key code cut depths and scroll down to the section with the values for your lock.

Now, match up the depths you measured with the closest Root Depth value. Write the code (0-9) next to the measurements from before, again working from the shoulder out.

Setting up the OpenSCAD Model

Now that you have the codes, open up the OpenSCAD model for your key type, and scroll to the bottom. Replace the codes with the code for your key, render, and export as an STL file.

Printing The Key

I printed my key on the highest quality setting my printer would allow. I recommend you do the same. Being such a small part the print was very quick.

Using The Key

The first time you go to use your key you may find it difficult to get into the lock. My print lacked the precision in the profile cuts that would allow it to move smoothly at first. With a little bit of scraping or chiseling, you should be able to get it into the lock without too much force, and it should turn freely.

Note: Do not force the key! You do not want to break the key (or any parts) off in your lock, as this could render it unusable!

What if it Doesn't Fit?

Recheck your pin depth measurements and print again, if necessary. Now that you have a printed copy it should be easier to see where things went wrong. Measure your key vs. the printed key to find any codes that are mismatched, then update them in the model and reprint.

Parting Thoughts

I would recommend that you not use this key on a daily basis. A 3D printed key, especially if you're printing with PLA (a very soft material), is going to lose material into the lock each time you use it. Over time you're likely to accidentally introduce plastic fragments that jam your lock or break your key off in the lock.

However, a printed key can make a great emergency key. Key it on hand in a drawer or at a friend's house in case you need an extra key in a hurry.

If you really need a permanent key, try Key.me, or your local hardware store.

3D Printing

I got my first 3D Printer on January 6, 2016. I ordered a Maker Architect 3D Printer from Monoprice for $299. It turns out that the Maker Architect 3D is basically a Flashforge Creator, with a single extruder and no heated bed. It came with 1kg of white PLA filament.

Unboxing

The unboxing experience of this printer was pretty poor. I had already read the reviews and knew that the instructions were limited at best, so it wasn't surprising. As poor as the experience was, it was pretty easy to get going. Just a matter of bolting the extruder to the rails, attaching the filament holder, then booting it up and running the startup script.

Leveling the Bed

As I was reading up on 3D printing before my printer arrived I kept reading over and over how important it is to have a perfectly level print bed to get good prints. So when it came time to walk through the bed leveling process I went very slowly, following the instructions as closely as possible.

One problem I've run into is that, during the leveling process, the printer moves the head to the back-center position and asks me to slide a piece of paper for measurment between the bed and the extrusion head. The problem is that the head is actually beyond the bed at this point, so there's no great way to measure. I haven't figured out how to fix this yet.

First Print

My 3D printer came with an SD card that included some test prints available for you right away. I started printing the 42mm test cube, but pretty quickly aborted the process. It was going to take forever to print this cube.

Instead, I downloaded a 22mm test cube from thingiverse to print. This is where I first ran into confusion in dealing with software, which at least at this time was very convoluted.

Software

In order to print on my printer, I need to give it files in x3g format. X3G is a kind of GCode format that's common among Makerbot and compatitble printers. However, the object files you download are in STL format. So, what do you do?

Go download and install Makerbot Desktop. Then, drag your STL file into Makerbot. From there, click Settings, and configure your print settings. For your first test print, try just going with the standard quality preset. The only things to look for would be bed temperature (set to 0° if you don't have a heated bed) and max movement speeds. In my case the manual listed those out, and all of the standard template values were within range, so I just stuck with the defaults. Then, it was time to export the X3G file, copy it to the SD card, take the SD card over to the printer, and try to print.

First Print, Actually Printing

This time, the print moved along at the speed I was expecting. It took about 15 minutes to print the 20mm cube on top of a raft.

Getting the Print off the Bed

My printer came with a sheet of 3M material that I stuck to the top of the acrylic bed before leveling. For me, getting the prints off has been pretty easy with my knife. Just stick the edge of the knife under the edge of the raft or part, and start prying gently. I haven't had a problem with a part sticking to the board (parts sticking to the raft is another story). For the cube, it popped right off, and the raft also peeled right off for me. First print success!

Next

I've printed about a dozen items since then. I'll cover the more interesting ones in other articles. For those looking for objects to print, there's a reason everyone goes to Thingiverse.

Building a (Siri Controllable) Raspberry Pi Thermostat

When it first came out, I was really enamoured with the nest thermostat. The idea of a remotely-accessible, app-controlled thermostat appealed to the gadgeteer in me, but the price and lack of flexibility (it really wanted to be left alone to learn and do its own thing, as opposed to being controlled by a fixed schedule), plus my propensity to tinker, led me to build my own.

For a long while I had an Arduino-based thermostat running in my house, but I wasn't very happy with it. Writing code for the Arduino isn't always very fun (for me), especially when you want it to be web-accessible.

Then came the Raspberry Pi.

This is what I had always wanted: a little full-blown computer with a bunch of GPIO pins. It runs Linux, which means you can leverage all the great software you're already using elsewhere, and you're free to use your programming language and web technologies of choice when building the software.

Overview

The basic idea of the PiThermostat is this: The Raspberry Pi reads the current temperature from a Dallas 18B20 temperature sensor, and then turns on/off the relevant relays on a linked Relay Board. That relay board can either control the direct wires from your existing thermostat, or can control the A/C power to an outlet, etc. This gives you full flexibility to replace an existing central HVAC thermostat, or just control a window A/C unit. I have two thermostats running, one in each of those configurations.

Parts List

This is the current parts list:

Setting Up the Raspberry Pi

  1. Download the latest version of Raspbian from raspberrypi.org.
  2. Install the image to your SD card.
  3. Connect your Raspberry Pi to the network, wait for it to boot, then SSH to it.
  4. Run raspi-config and configure your Pi as desired, changing passwords, etc.
  5. Turn your Pi off.
  6. Wire up your temperature sensor. I used GPIO pin GPIO04 (hardware pin #7). See the pinout here
  7. Wire up your relay board. I used GPIOGEN0 - GPIOGEN3 to control relays 1-4, respectively.
  8. Install the software to run the PiThermostat code as explained under 'Setting up the Pi' over on the project Github site

Controlling the Thermostat From the Web

By default, the rails app powering the thermostat runs on the web. Just point your browser to that IP Address / URL and you can set the temperature, set schedules, override schedules, etc. Just make sure you setup the thermostat on the rails console first.

Controlling the Thermostat From An App

The rails server has a full REST API for handling a native app. I've hacked together a few UIs to manage my thermostats, but none are polished enough to be worth releasing. If you write one I'd love to know.

Controlling the Thermostat From Siri

This is where things get even cooler. First, go install Homebridge, which basically involves installing node.js and editing a single config file.

Once Homebridge is installed, go get the accessory file for the PiThermostat, and install it into your accessories folder. Then edit your config, restart Homebridge, and boom, you should be able to tell Siri to "Make the thermostat colder." If you have an Apple Watch, you can even do it from your wrist, Dick Tracy style.

The Cashflow

In Stephen King's, The Langoliers, we are introduced to the creatures that consume the past, preventing us from ever returning to it. Merciless devourers, they relentlessly follow us all through time, ingesting history, insatiably pursuing us in an eternal chase.

As the story progresses, the main characters find themselves face to face with these gluttons, and they must do their best to outrun them; winning the race is their only hope.

As a micro-business owner I awake most days with the weight of an awareness on my shoulders; I must to attempt to evade my own kind of Langolier, the ravenous and unquenchable monster of Cashflow.

Each day I travel down the rough-shodden and mostly gravel road of business, always trying to get away from the beast.

From time to time I am able to find a bicycle to ride. Landing a new deal yields strength for pedaling, at least until the tires run flat or the chain snaps.

When the rusty wheels skitter to a halt I may take a moment to catch my breath and look behind me to appreciate the distance that I have put between me and the leviathan that pursues me.

Though while I may wait, he never stops.

Relentless in his pursuit, I jog ahead, legs burning from the journey, looking for another ride; I might even take a skateboard if I find it. Anything to keep moving, and stay ahead of him.

When I stand still, I can hear the churning of his teeth and the bones breaking in his mouth. I can feel his steps in the ground.

There are times he has been close. So close that I could smell the stench of debt on his breath. Close enough to see the blood dripping from his lips as he devours everyone in his path. I have been separated from those I cared about as we tried to outrun him together.

You can't fight the Cashflow. You can try to slow it down, or get ahead of it. You might find yourself, as I have, on the ground, the gravel ripping into your back while you throw everything you can find at it in an attempt to satiate it for just long enough to get back on your feet and get away. You might even manage to succeed, to get back up, hitch a much needed ride, and put a little distance between you and the savage.

If things go well for you, you may find yourself moving quickly down the road, putting so much distance between you and the monster that you can't see him anymore. You may find a ride that carries you for years.

But no matter how far ahead of that devourer you are, when you stand still and the wind is blowing gently from behind, you will still hear that churn, still remember that crunch, and still feel those steps. Your pulse will quicken, your muscles will tense, and you will be reminded: you can never stop, because if you do, he will find you.