So you use a relay, obviously.
Mk1: ILS relay boardFirst off, I found a nice, and reasonably small relay board. It works off 12V and designed to take an ESP-01. It even comes with one.
All I need to do is add my own firmware and I have a 12V powered relay on the WiFi. Simple.
There are a lot of advantages, obviously :-
- Simple single complete module for relay control
- Comes with ESP-01
- Runs off the voltage we are using (be careful, there are 5V versions too)
- No wiring, no PCBs, just load my own firmware
- Also available in 2 and 4 relay modules
Mk2: More connectors
Unfortunately I don't just want a relay output, I want a door control. So I made a PCB that allowed an ESP-12F and hence more connectors. With some careful design I made it fit on top of the relay board!
This works. But is starting to get quite bulky. Bear in mind these usually have to fit in the back of a electrical outlet box, e.g. with an "Exit" button or similar. I was also not happy at how warm the main relay board got - it uses a simple linear regulator.
Mk3: Separate 3.3V relay
Time to try using the nice Pololu regulator boards. With a regulator I don't need to use the 12V relay board, I can have a stand alone board. But I still need a relay. So time to use an off the shelf 3.3V relay.
Mk4: Solid state relay
That worked, but really it is still rather chunky. After a bit of hunting around I found some nice solid state relays by Omron. I have always seen solid state relays as quite chunky, but it seems they can come in quite a small package, more than adequate for 12V at a few amps even...
The result, as you see, is a relatively small PCB, with regulator, and header to connect to the NFC reader (it does just fit passed the regulator, honest), and contacts for 12V in, exit button, door closed reed, and lock engaged contacts, as well as a relay output.