0
\$\begingroup\$

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.

Functionality desired:

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.

Questions:
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

enter image description here

\$\endgroup\$
  • \$\begingroup\$ Suggestion: Unless you are low on I/O pins have the ESP do the work when you can. Once you turn ot on it can latch itself. Without working through it in more detail it seems that you only need the ESP. || Ensure that input to switch reg can handle automotive environment - you can get tens of volts occasionally and nasty spikes. More input available if wanted. \$\endgroup\$ – Russell McMahon Jun 6 '20 at 10:38
  • \$\begingroup\$ The 5v VR is automotive rated up to 60v inputs.I'm unsure how what you mean of how the ESP32 would latch itself? Lets use the example of wanting to power on the ESP32 when the parking lights flash, IE when you press the unlock/lock button. I want to use this as a remote way to power up the ESP32. The parking lights flashing would be quick, the ESP32 wouldnt have enough time to power on and decide what to do. <br> What about ESP32 deep sleep. Could an input on an ESP32 wake it from deep sleep? Would the power draw on deep sleep be enough not to drain my battery while the truck is off? \$\endgroup\$ – captCC Jun 6 '20 at 17:46
  • \$\begingroup\$ @RussellMcMahon , what would be the best way to have the ESP32 latch itself, if I went that direction? \$\endgroup\$ – captCC Jun 7 '20 at 2:20
  • \$\begingroup\$ ESp can drive equivalent of Q1 to hold itself on. Crystal oscillator from deep sleep wakes in 10's of uS on bare processor. How long ESP takes to start working depends on what overhead they have added. A capacitor charged by lock / unlock button can hold Q1 or equivalent on long enough as required. || The 051KV version claims not to be auto qualified ... \$\endgroup\$ – Russell McMahon Jun 7 '20 at 8:45
  • \$\begingroup\$ ... the datasheet says that the 05Q1 version is but the 05Q1 datasheet seems not to say so. Either way, a 60 V part with some hald decent input filtering should be 'OK enough'. \$\endgroup\$ – Russell McMahon Jun 7 '20 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.