[Project isn't complete but submitting anyway. As luck would have it internet died in the middle of finishing and still hasn't come back online, so submitting what I have and will update.]
IdeaWhile brainstorming Star Wars Photon ideas, I asked my friend "How do you open doors on the Death Star?"
"Burn through them with a light saber." he said. "Alright, well what if you're not a Jedi? What if you're Han?"
"Shoot it with a blaster!" "Bingo."
There are a million ways to unlock your home doors from the outside.. your phone with bluetooth, remotely with wifi.. but what about when you're leaving? Why not have some fun? :) Let's use a wireless blaster to "shoot" open your door! Why? Because reasons, the force, because stars, and wars.
1. Install Automated Door LockGet yourself a Remotizer, Open Sesame, or any other triggerable wireless deadbolt. I'm using a Remotizer, they're supposed to be pretty good. Can be found on Amazon or eBay.
If this is your Photon's first rodeo, you'll need to set it up so it can talk to the clouds. The Particle app makes this pretty easy. You'll need to create a Particle account, and follow the onscreen instructions to get your phone talking to your Photon. Pretty straightforward, so complete that and come back. You should end up with something that looks like this:
3. Connect Light Sensor input to PhotonWe're going to use a simple ambient light sensor called a photoresistor (aka photocell / LDR / light-dependent resistor) to detect a laser from our blaster and trigger all the things. If you picked up the $29 "Photon Kit" that comes with a breadboard, it will have included one for you! Place the Photon in the middle of a breadboard, and connect the photoresistor by sticking each end in the hole nearest an Analog pin. For instance, we could place one end next to A0, and the other next to A5, as shown below. Using the Photon we can measure the resistance across these two pins to see how much light we're "seeing".
Hook up Digital 0 such that it will trigger on your door lock. This will vary by lock, but for the Remotizer, I spent some time trying to figure out how to trigger the unit directly, but ultimately wasn't able to. I will figure it out eventually, but in the interest of time just hooked up a relay that will bridge the "unlock" button on the keyfob when I activate pin D0. You can test it with the Photo app by setting D0 to HIGH, and make sure it works. Your phone unlocks your door now, sweet!
5. Code and Mount PhotonNow you should have a door lock you can trigger with your phone, which is pretty nifty in itself, but let's add some code to detect (huge) light changes, and when they happen, activate D0 to unlock the door. This is pretty straight forward and you can even use the light sensor included with the Photon as your sensor! Attach it to A0 as I described so we can sense changes. First use print commands to observe what ambient light values are like, then shine your light (something super bright like a laser) on it and observe the values. Write a loop that sets pin D0 to HIGH when the light level is above the appropriate threshhold. I've supplied my code to do this, but keep in mind your values will be different depending on your sensor's sensitivity.
This is some code
Herp derp
Awesome, you should now be able to unlock the door by shooting it!
6. Add Some EffectsWe can't just stop here.. a shootable door lock is cool and all, but that's not all that happens in the movies, the panel blows up and the door opens, right?! Now comes the fun part! Alongside your code to set D0 to high, add additional code to set D1 to HIGH, or to blink, etc. Add some "movie" effect you'd like such as a red LED or a Buzzer (maybe an explosive that shoots sparks everywhere!) to D1. Add another to D2 or D3 as well if you like, and write similar lines of code. Flashes, noise, now we're talkin! I'll be adding a red LED, a buzzer, and maybe something super cool to give that "whoa you blew it up" effect.
< Insert disclaimer about safety - don't do this if you're under 18, don't blow your hand off, I'm not responsible etc. etc. >
I won't be demoing this, but if you're a budding pyrotechnic engineer with a responsible adult around.. (key word responsible..), you couuuld use something like a model rocket starter to electrically shoot a small spark effect, very tiny firecracker, something of that sort. Maybe build a tiny metal enclosure for the Photon, and use a pneumatic motor to "blow the panel off" just like the movies if you want to go the safe route! The possibilities are endless, so be your own Industrial Light and Magic! (Just be careful and for the love of god disconnect it if you're not home :P)
6. Mount Motor / Servo and Tie to DoorWe've now occupied D0 through maybe D3 or so, so on the next pin like D4, let's hook up a motor to actually pull the door open a bit after we "blow the panel". You could use a pneumatic motor, servo, bunch of possibilities here too. I'll be using a motor with a gearbox (and thus a lot of torque) that I will turn on with a relay for a second or two to (hopefully) yank the door open a bit. I'll attach it with some tape and string. You could make it prettier on your own - you get the idea.
Bam! Finished!Bask in the glory of your creation, and check out the video for my implementation. Now you can blow open doors just like Han! Show your friends and you're sure to land a Leia of your own.
Comments