Skip to content

Instantly share code, notes, and snippets.

@mighty-sparrow
Last active October 4, 2016 05:19
Show Gist options
  • Select an option

  • Save mighty-sparrow/0780ccbb7119ce355d5d81004138a01c to your computer and use it in GitHub Desktop.

Select an option

Save mighty-sparrow/0780ccbb7119ce355d5d81004138a01c to your computer and use it in GitHub Desktop.
Jedi Mind Pick

-- Original, full size image available on Google Drive.

Full contest details available on the hackster.io IoT Jedi page.

Final entry published as Jedi Mind Pick.

#Introduction

Using a combination of several devices and platforms, create a touch-free home entry system.

Since facial recognition software is a bit pricey, not to mention Jedi are notoriously cheap (at least that's what I'm told), this solution will use relatively cheap, common-place components. Aside from the two Photons, the most expensive component is the Lockitron Mechanical Assembly1. This implementation is meant for a time long ago, in a galaxy far, far away. The obvious choice for the mobile application element is Android (not an iFollowTM2). Remember, there is no "I" in Jed.....stay in school, kids.

This proposal uses two Photons but could be modified to use two [Electrons]3. They aren't available to purchase (at the time of writing this article), so makes it an easy design decision. Using the Electron would eliminate the need for detecting and connecting to the lobby WiFi. Unfortunately, the Jedi writing this article falls into the aforementioned category of cost-conscious. We'll pretend that I spend enough time in the lobby of my domicile long enough to connect to its WiFi and send a message.

Component List

Qty Name ...or, when Available: Alt. Qty Alt. Name
1 Electron
2 Photon 1 Photon
1 Lockitron Mechanical Assembly1
3 HR-S04 Ultrasonic Range Finder4
2 Breadboard5
2 Arduino6
2 9V Battery

Other Hardware

  • Number of wires and connectors for each of the previous parts
  • Two-way tape7
  • Jumper Wires8

High-Level Design

First, let's take a look at what we're trying to accomplish and the events involved. I'm a pretty graphical person and like to start with a simple, sequential digram on most of my software projects. Take a look below and get familiar with the triggers and actions.

participant Android as droid
participant WiFi as wifi
participant Photon\nInterior as pho1
participant Arduino\nInterior as a1
participant Photon\nExterior as pho2
participant Arduino\nExterior as a2
participant Ultrasonic\nRange Finder as rf
participant Lockitron as lock

droid-->wifi:Detect signal
wifi-->droid:We're "home" 
droid->pho1:"Wake up!"
droid->pho2:"Wake up!"
pho1-->a1:"Get ready"
note over pho2,rf:Determine if a valid\nmotion was detected
rf-->rf:Wave hand in\nfront of door
rf-->a2:
a2-->pho2:
pho2-->pho1:"Honey, I'm home!"
pho1->a1:Open the door
a1->lock:You are a Jedi master...of your domain
note over a1,lock: Knowing when you leave is another article ;)

NOTE: Sequence Diagram is only visible if using the StackEdit.io MarkDown viewer. You can browse the latest documentation here: JediMindPick.md

As you can tell from the sequence diagram, we'll need two use two Photons and two Arduino modules: a pair on the interior of your living space and a pair on the outside. The assumption here is that both Photon modules have a reliable connection to your WiFi at all times. ...actually, this makes me think this is a good time for a PSA: #ALWAYS BE SURE TO HAVE A PHYSICAL KEY WITH YOU ...because, well, you know that box of test 3D-prints sitting in the corner? Yeah. That's why.

So, the idea is to mount the second PhoduinoTM from the ceiling, in front of your door. This Phoduino9 pair will be connected to a battery power source and 3 Ultrasonic Range Finders. The range finders will be used to detect a right-to-left motion of a hand in front of the door.

Since we don't want anyone walking past the door to accidentally or intentionally trigger the door opening, we'll put some logic into Phoduino 2. We'll tell it not to "arm" itself until notification is received from the Android app. The Arduino app is simple and it's prime directive is to detect a specific WiFi and relay that information to the Phoduinos. This will be achieved through the use of the Particle SDK for Android10.

More to come...

I have spent too much time messing with this...would love to finish, but will just wait to hear if I won some "motivation" ;)

[TOC]

Footnotes

  1. The Lockitron Mechanical Assembly is available on Sparkfun. If you were lucky, you were able to pick one up at a discount on CyberMonday. 2

  2. There are some who may find it difficult to understand or complete the steps in this article if their friends have not already done it.

  3. The Electron link is a bit funky since it's only good if clicked on the Particle site. Regardless, this will get you to the site.

  4. There are several options out there. Just check out the eBay for HR-S04

  5. There are tons of places to buy cheap breadboards. Of course, the default go-to site for this stuff is eBay - check out their Breadboard selection.

  6. If you haven't heard of Arduino, we welcome you and your friends from whichever rock you crawled out from under. You have a lot to catch up on (like the difference between Star Wars and Star Wars). This article write-up is related to the former. Arduino should be the least of your worries. But when you're ready, a good place to start is the official Arduino site.

  7. I usually find god stuff like this Double-Sided Foam Tape at Harbor Freight.

  8. Same thing goes for jumper wires: best place to start shopping is eBay, like this page.

  9. No, I do not actually have a trademark on this word. I just think it's funny to call out words that I make up as my own trademarked "thing".

  10. All documentation and downloads may be found on the Particle web site. They have a special section dedicated to using the Particle devices with Arduino, under Android SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment