-
1Step 1
Pick an ESP8266 version. The minimal requirement is one GPIO input, so any will work. I used a Nodemcu board (flashed with Arduino SDK and using Visual Micro for coding). The ESP12e/ESP13 dev boards and the Nodemcu board have a voltage regulator built in, but there are cheap AMS1117 power modules to use for the chip versions.
-
2Step 2
The output jack for the trigger signal uses an open collector on the tip (blue wire in RatZapper). My first version used a PNP to pull a GPIO high. The second version just uses a 10K pullup (didn't try using just the internal pullup). So it is easy to use either a 2.5mm plug or tap off the jack terminal.
-
3Step 3
I've been powering my two for several years with 5Ah 5-cell NiCD packs. One pack died last year so I'll be switching to 2S LIPO at some point. I'll probably add a 6V regulator to be safe. There may be some 3K+ mAh packs that will fit in the battery compartment. For now, I am trying an old 6V 2A wallwart. The RatZapper gives a green light with it and I could trigger it manually without total protonic reversal.
There's room in the control box lid to add a DC power jack if desired. For one, I added a jack and made a Y-cable with JST connectors, one for power in (wallwart) and one for the ESP (input to a voltage regulator or VIn on Nodemcu). For the minimal version, I'm using 3-wire servo connectors, which gives power, ground, and signal to the ESP. For both, I just used the unswitched power wires.
-
4Step 4I was having difficulty getting a sustained solid trigger with just a screwdriver. A slightly damp paper towel made it much easier.
-
5Step 5
The first version has a couple PCB relays with internal diodes and 3904s and more disco LEDs, because I had them and they fit. The nice thing about the ESP is that the hardware can be repurposed with a flash.
-
6Step 6
Software Notes:
- The code implements a simple server, emailer (POSTing to a nodejs server running on openshift), and interface logic for the trigger. I may switch to using SPIFFS once I write a persistent config library for some other projects. But there's not much else interesting to do. I may add ntp time lookup and periodic status updates to thingspeak because it makes it easy to tell if any resets occur.
- The web page just polls with an ajax json request to /api, which returns a simple json object (hostname and trigger status).
- The trigger logic requires a minimum trigger pulse width (1 second) and enforces a delay between triggers.
-
7Step 7
Hardware Notes:
- I haven't done anything with the analog input yet so I will probably experiment with a voltage divider on it to periodically measure the input voltage to check battery status.
-
8Step 8
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.