Spark controlled safe / lockbox

Ok, this is a very basic project, but I wanted to share anyway.

I had one of those fun little $25 SentrySafes

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.


Wow cool! I’m surprised you get a signal inside that metal? box.

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.

1 Like

the black part is metal and the grey part is plastic…so range was fine the 20-30 ft i was from my router (which has monster antennas)

i like that idea @zach …the beauty of a community, it can be a group project :smile:

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.

GENIUS! That’d be awesome for hotels. Gotta go pitch this to SentrySafe…


quick question - checking the twilio API it says an SMS can be sent like this:

curl -X POST{AccountSid}/Messages
-d “To=+14159352345” \
-d “From=+14158141829” \
-d “Body=Hello world!”
-d “MediaUrl=”
-u ‘{AccountSid}:{AuthToken}’

flipping this around, what is then easiest way in firmware to send this from the for it to send an SMS?