Enable LED light bar control via multiple high-beam if enabled.  

Purpose is to enable multiple control modes via ESP8266 (used as a cheap, high memory arduino-ish).


I.e., enable LED bar via highbeam, but only if in-dash button is pressed within 3 seconds of high-beam on, then remember that setting till poweroff.


There are two inputs, and three outputs.

In1: Highbeam tap, via Add-A-Fuse from the hibeam fuse (brought to ground via NPN transistor, with pull up to 3.3V)

In2: In-dash button (pulled up to 3.3V, ground-sink switch)


Out1: In-Dash Button LED1 (top, via PC817 optocoupler)

Out2: In-Dash Button LED2 (bottom, via PC817 optocoupler)

Out3: Ground sink via NPN transistor to control automotive relay for LED Light bar


Outstanding questions:

1) In Dash LED's are dimmed via a fixed +12V and a PWM controlled ground/12V. As ground is not fixed, I wasn't sure the best technique to control these LEDs, and opted for PC817 photocouplers, since the source side is relatively static. Does this seem reasonable?

2) Anything else stand out to anyone?