If you keep a smartphone or tablet long enough, it loses resale value to the point that it may eventually end up sitting in a drawer somewhere, gathering dust (try selling an iPhone 3 on Craigslist these days…). Technology advances so quickly that within a couple years, many of these devices are pretty much useless for their original purpose.

However, with a little bit of ingenuity, you can turn an old iPhone into a high quality home security camera—for free! It’s a pretty simple process and the only extra equipment you’ll need is a stand or mount and a charging cable.

Follow these four steps and put your old phone to a new use in minutes.

Step 1: Select An App

First you need to find an app that will turn your old phone into a streaming camera. Working with an iPhone 5, I found several apps in the Apple App Store that purported to do what I was looking for. After some trial and error, I settled on AtHome Camera, which I found to be the simplest system to get up and running. I spent a lot of time (and some money) on iCamPro, which has a lot of good reviews but was very complicated. In the end, I couldn’t get it to do what I needed it to.

Start by downloading the “AtHome Video Streamer” (AVS) app onto the device you want to use as a camera (in my case, the old iPhone 5, which we’ll call iPhone #1). Then, download the companion app, “AtHome,” onto the device you want to use to view the video (my iPhone 6+, which we’ll call iPhone #2). You don’t need to download both apps onto both devices.

Step 2: Link the Two Phones

Launch the AtHome app on iPhone #2, register and log in.

Select “Add by QR code,” and launch the At Home AVS app on iPhone #1, where you should select “Generate QR code.”

When the QR code pops up, scan it with iPhone #2. Now the two devices are connected. (You can also use a CID code to connect the two devices if you prefer).

Step 3: Change Your Password

Before proceeding any further, open the AVS app on the camera device (iPhone #1), select the hamburger menu (three lines in the top left) and choose “CHANGE.”

Here you can change the username and password for that device, which is set by default. (For security reasons, it is very important to always change any device from the default password to a strong, unique password). Once the password had been changed, do the same thing on iPhone #2. You also have the option of changing the name of your camera here—useful if you want to set up multiple camera devices to monitor different areas.

Step 4: Mount Your Security “Camera”

Now that the devices are connected, it’s time to set up iPhone #1 in the best position to monitor your chosen area. The easiest way to do this is with a mount of some sort (car windshield mounts such as these work well, as you can attach them to most surfaces easily). I used an Apple iPhone 5 dock that I happened to have lying around.

Once you have iPhone #1 correctly positioned, simply open the AtHome app on iPhone #2 and view live footage from iPhone #1. From this app you can choose to use the front or back camera, turn on flash and enable other basic features. Now you are all set to access this feed from anywhere over cellular or Wi-Fi – as long as the Wi-Fi is on in your home and the camera device has power. (If you want to set up the camera device to be on continuously, simply turn off auto lock in the phone’s settings and make sure it is plugged in.)

Tips For Turning Your Camera into a Security Device

Once you have your old iPhone set up as a camera, turn it into a security camera by enabling some or all of these optional features. Some are free, and others come as in-app purchases (including portrait mode and pan/tilt/zoom capabilities):

Motion detection: Whenever motion is triggered, a 30-second video will be recorded, with email and push notification to inform you.

Pre-scheduled recording: Specify two time intervals each day to automatically start/stop video recordings.

Two-way Talking: Communicate with people in your home through the camera.

Remote on/off: Remotely turn off the camera, and schedule a time to automatically wake it up again.

Using AtHome’s app, or others like it, it is easy to turn nearly any device equipped with a camera into a security camera. Be it an old iPhone, a tablet or even your smart TV and your computer’s webcam, every camera in your home can become a security camera within minutes, and you can view them all through your smartphone, wherever you are in the world.

It’s smart to supplement your smartphone camera with motion detectors and window alarms, all of which can be worked into a comprehensive DIY home security system. Whether you’re keeping an eye on your kids in the yard or protecting your home while you’re away for the weekend, the ease of building a simple system—including with an old phone—has made home security accessible to anyone.