11/09/2016 at 01:31 •
Since the prototype works without any issues, I went ahead and ordered a PCB from OSH-Park, to make it a little easier to knock a few more of these switches together. The board is 50mm long and 15mm high, so that it fits down the side of the battery box in the "dollar-store" LED light case that I'm using for these units. There are no mounting holes, as the board is so small and light that it can be held in place with double-sided tape or hot glue.
Be warned that (as of early Nov 2016) I haven't received the first batch of boards yet, so it's untested, but the OSH-Park shared project order is here:-
07/27/2016 at 05:58 •
This circuit was prototyped on a small offcut of stripboard, with the AO3415 (SOT23 device) soldered directly onto the track side and the other components (all through-hole) mounted normally on the top side.
The AO3415 is the actual power switching device and has impressive specs for something so small (4A of continuous drain current?!?! I don't think the stripboard can handle that). The main reason for choosing a device from this family though, is the impressively low gate switching voltage. This means that it should work well down to the discharge point of the battery where the ESP8266 will no longer function.
Then I went and spoiled it all by using a 2N7000 N-channel as a driver buffer. That's a little unfair to the (good ole' workhorse) 2N7000, as it's still a very decent MOSFET, but it will definitely stop working before the AO3415 when the battery gets low (so if you need equivalent low-voltage switching, choose one of the even-numbered devices from the AO341x family tree, like the AO3414). If, on the other hand, you have a junk box full of 2N7000's, just throw one in and live with it.
The reason that buffer N-channel is there to begin with is that my battery-pack actually supplies a much greater voltage than 3v3 (when fresh) and there's a voltage regulator downstream from this power switch (a low quiescent current, Holtek 7333). That means that if the gate connection for the P-channel were made directly to the ESP8266, the voltage would exceed the max limit for the ESP GPIO pins when the device was off. The N-channel provides protection for the GPIO pin.