Electronic Safe version 3 |
This safe is a variant of the previous v2 Safe. You should read that page to read all about the software and how the safe works. Disassembly instructions are also the same. So, yes, read that page! That's also where you'll find the software links.
This v3 is logically identical, but instead of messing around with MOSFETs and soldering and other stuff, we're going to use more off-the-shelf components. And no soldering at all.
The main board is a combined esp8266 and relay. It looks like this:
This board comes in a couple of versions; the biggest difference is whether headers at the top left are present. I recommend getting them pre-installed because these boards don't have USB connectivity; you program them using a 3.3V serial adapter connected to them.
This time I picked a safe (Amazon link) with a slot in the top. The normal idea is that the safe can be locked and then money added. Well, we could do the same with keys. It's about $33. There's a lot of similar models on Amazon.
The internals on this safe are a little different to what I've seen before. Previously there was a simple plunger solenoid. This time the lock rotates.
In the locked position it looks like this.
When almost totally open we can see it's rotated down out of the way
This would appear to fix a major issue of the previous design; the old one is susceptible to hitting it hard to send the plunger down, or even a strong magnet.
Of course the metal is still very thin so it's not a high security safe!
Open the safe cover and disconnect the solenoid wire as we did in the v2 safe. I made a small hole in the door near the battery compartment so it can exit there. That's it. Put the cover back on.
At this stage I recommend programming the esp8266 with the safe software. It's easier to get to the contacts.
To do that we need to power it. So let's talk about this. These boards can typically be powered from 7V up to 20V, if not higher. The power supply will also power the solenoid. I measured the coil at 18 ohms, so I think any power supply 500mA or higher would do; maybe call it 750mA for safety?
Now I had some spare 2.1mm x 5mm power pigtails spare.
Connect the red wire to the right side, and the black to the left
Now you can program it using the Arduino software and your adapter.
Hook it up to your network and test the safe software works. You'll hear the relay clicking. Remember to change the configuration so it uses "4" (GPIO4) as the trigger.
It still sticks out but it's good enough
Now we need to add a diode to the output. This is to prevent "back current" from potentially damaging the ESP8266 (when I tried without the diode the board would reboot maybe 1 time out of 3). Almost any diode should work; I used a 1N4001. This needs to connect between the convenient 5V output at the bottom of the "common" on the relay. The stripe side of the diode should be at the relay end.
Now we just need wires going from the negative power at the top of the board and from the far right relay connection at the bottom of the board to go to the solenoid cable.
And that's really it!
This is what a diagram of the wiring looks like. Did I just scribble something on a piece of paper? Yes, I did!
To mount this I used some 3mm plastic stick-on standoffs. And I figured I could stick it to the roof off the safe!
This makes the whole thing very clean.
And no one would ever know what's hidden inside.
| | | G . | | | R . . B | + | - | T . . B +---+---+The G pin is Ground The R pin is Rx The T pin is Tx
Remember that Tx on your adaper may need to be connected to Rx on the HW622 and vice versa.
Now to get the machine into program mode, you need to join the B pins and then power on the board. This should be enough to get let esptool send flash updates.
After programming has completed, remove the B link and then power cycle.
Note that you can also short the ESP reset pin to ground instead of power cycling
+-------------+ first pin here --> | | | | | | | | | | | | <-- first pin here +-------------+ | | | . | | | . . | + | - | . . +---+---+