I have a problem I cannot figure out. I have this circuit which should control two LED strips either by wemos OR (methods are switched between by SPDT because I don't know automatic way) manually. Each "switch" should be able to turn on one or both leds.
Circuit details
Wemos uses two N-mosfets (irlml2502) to turn on/off leds. Manually I turn them on/off by SPDT switch. Circuit is powered by 12V adapter going to the LEDs and buck-converter to convert to 5V to power wemos. To separate LEDs powering I use Schottky diode SB540.
PROBLEM
The problem is, when I use manual switch, it turns on both of the leds everytime. Also, the buck-converter´s power led is ON on that time but the IN- is not connected to anything.
Even when I connect ground to buck-converter IN- both ledstrips are turned ON.
As I understand it, ground to the mosfets should flow through buck-converter but it is flowing flowing somewhere else.
Only thing I can think of is that MOSFETs are allowing ground to flow "backwards" from drain to source and power the circuit through each other. Could you please help me fix the circuit?
Picture description
- Circuit is not powered on pictures.
- Purple colour shows the ground when I want to power single ledstrip.
- Turquoise should power both strips.
- Bold black wire upper-right is manual switch 2 and blue is manual switch 1. Curved blue on the right side is ground.
- In schematics I ignore buck converter and wemos pins output to mosfets.
simulate this circuit – Schematic created using CircuitLab