I've been working on this circuit for a few months now with lots of research. Looking for the gurus on here to analyze this board and give me some suggestions/corrections moving forward on parts/design.
1. Turn on ESP32 when either parking lights flash (this is done by the remote unlock/lock button)
2. Turn on ESP32 when ignition circuit is on (key in and on in truck)
3. ESP32 remains on for (x)mins after parking lights flash and ignition not yet on / ignition turned off after running truck
4. Bluetooth controls relays on truck to operate certain after market accessories, see offroad lights in circuit example
5. Power itself off during certain scenarios such as low voltage / ignition off x(mins)
Functionality of item 3 has been accomplished with the SR latch. The idea is to fuse tap the parking lights fuse and ignition circuit fuse (I've tested this on the truck with a multimeter and it works) and have it latch the SR Latch which will then activate the transistor and connect ground to the TL2575 power regulator which will then power on the ESP32.
Not shown in the circuit yet, but the idea was to also have the 2(12v) fuse tap lines off parking lights/ignition to run to 2 ESP32 pins via a resistor voltage divider (to get around 3.3v) that way the ESP32 can decide the power state of the truck and power itself off which brings me to functionality item 5. ESP32 will send a signal on GPIO 17 to the RESET pin on the SR latch chip via the 4N35 opto-isolator (to bring the voltage back up to 12v for the SR latch)
I do have this wired up completely and exactly as shown on the diagram on a breadboard. It works fine so far...sometimes I have ground issues when powering up the ESP32 but it seems to be a breadboard issue. I also have a basic app on ios/swift that connects via bluetooth and turns on the 12v offroad light relays on GPIO 21.
1. Is this design crap?
2. Would you change/add/remove certain transistors, resistors, diodes, parts
3. Is there an easier/better way to accomplish desired functionality?
4. Anything else you have