I decided I wanted it to be unlocked via Wifi, without disabling any of the keycode or key override functionality.
This ended up being much easier than I imagined.
All I needed was a basic Mosfet, and a 10k resistor.
The red and green wires are spliced into the 4 AA batteries (I threw that toggle switch you see on the front of the safe in line since I didnt think the Spark would last long on AAās)
Then, the Mosfet is spliced into the live wire on the actuator. There are two wires leading to it, be sure to pick the same one I did.
If you wire everything up like I did, you can simply use the Tinker app and set D0 to analogWrite, and then hit it to 255 to unlock, then 0 to lock.
Super simple. Iām sure someone can make a nice little iPhone or Android appā¦but im taking the core out for another project.
Too much fun stuff to keep these cores in one project at a time.
Here is a 30 second video showing the final usage.
I really want to use this to do a two-factor authentication tape. Can you override the keypad entirely?
Iād love to see a safe where you put in the combo, which hits a web service and requests a second code thatās texted to you via Twilio (or use Google Authenticator or something like that via Authy), which you then type on the safe keypad, and now youāve got two-factor authentication for a safe.
if what we want is pseudo two factor authentication, i can think of a relatively easy method.
it would work like this. Someone types in the correct pin code on the safe. The spark senses it and sends an SMS with a URL. When that URL is clicked, the spark opens up the lock! Its not perfectly 2-factor, but its close!
It would be super easy to implement. Instead of splicing the wire going to the actuator, we just hook it up directly to the spark. When we detect voltage, it means the correct pin code has been entered. Then we shoot off the link via SMS, and when the URL is loaded, we can go ahead and send voltage off to the actuator.
No need to mess with their pin pad, just one more wire splice that i have now!
Just another idea⦠not sure how relevant to two-factor, but⦠when the safe is unlocked, you enter your phone number into the keypad, and it texts you a special random pin via Twilio, which once you enter it, your phone number becomes the first part of the authentication. Once locked, you need to enter your phone number, and then a new random pin is generated and expected to unlock the safe. Once itās unlocked, a new phone number can be entered and the process started again. There could be a master code, for someone like a Hotel that would have to reset these daily.