I’m having a bit of a brain blockage and could use a fresh pair of eyes, please.
I’ve built a circuit that isn’t quite behaving as expected. I have attached 2 versions of the schematic, one normal and one with the separate parts of the circuit highlighted with different colours to make explaining easier.
The circuit is part of my home automation project and it’s meant to switch a 12V LED strip on and off and also dim it. The catch is that the switching must also work in case the Arduino fails. I’m using a bi-stable relay and a wall light switch (like a 2 switch light circuit). The dimming is done after the switching with a MOSFET. The gate of the MOSFET is pulled high using the LED supply voltage so that the MOSFET is closed even if there is no signal from the Arduino.
In the highlighted schematics the
yellow parts are the relay control,
green is the dimming parts and
blue is the LED power parts. This all works fine.
The problem is the red parts. This is the feedback back to the Arduino that tells me whether the LEDs are on or off. Since there is a manual switch involved, I don’t know whether that is on or off. So I need to detect the state.
The problem is that when I build it like in the circuit the LEDs never go off (but they do dim ever so slightly). I just can’t get my head around why that is happening. When I cut the wire where the purple X is, then the circuit works fine. But of course then I can’t read the state any more.
Any ideas what I’m doing wrong?