I have an LED strip with common 24V input and two grounds for warm and cold white.
I have two switched mains power lines to the location of the strip.
I want the whole system to be completely off when the light is off, so no power consumption for the microcontroller and it's power supply, because the lights are not on that often, and it would be a waste BUT I want to still be able to use the two switches to switch cold and warm white separately.
My solution would be to power each part of the strip (that is, cold and warm white) with a separate power supply on a separate switched line, and power the microcontroller for brightness control from either of the to lines. The two Schottkys should separate the light circuits, but supply "OR logic" to the power supply of the uC unit.
I have added he MCP1415, because uC-GND will be higher by the Schottky diode drop to GND1/2, but since the MOSFETs do not need to be completely off for dimming, I could probably even pull it off without them, as far as I can see.
Am I missing something?
EDIT: The MCP1415 are max 18V, so they need to be connected to the 5V rail.
Most circuits are designed to have the negative supply be the common point. Floating any chip above that point (like with your diodes) makes things weird when interfacing with other chips. Move the diodes to merge the power supplies together, and that should all work fine.
I missed to write it explicitly (added that in now), but I still want to be able to use the two switches to switch cold and warm white.
That is not possible anymore if I join the power supplies.
I COULD run a third power line and use the switches as inputs to the uC, but 1. it would not be completely off when all lights are off (which would cost more energy that the actuall light that is only on like 1% of the time), and 2. I would have to do the sensing at mains voltage, because running a low voltage DC signal in the same cable would be against code.
The diodes will increase the uC-GND to GND1/2+(0.2 to 0.4V), meaning that the MCP1415 will get that voltage as low. The datasheet says that <0.8V is defined as low. What weird behavior do you expect?
And max V(gs) of the fets is 20volt. Can't you find a logic level mosfet for the required current of the strip, so you don't have to use the driver chips.
The linear LM1084 is a poor choice. It will burn off (24-5) * 0.1A = 1.9Watt, needing a heatsink.
A switching regulator (5volt/0.5A) would do much better there.
Leo..
The fets are already logic level, but due to the diodes, V(gs) cannot reach 0V directly from the uC. The "5V" rail should be ~5.4V to GND1/2, so that should be fine for V(gs).
I could probably use almost any buffer. It would probably even work with V(gs)=0.4V but I need to test that and wanted to avoid the discussion.
Good point with the LDO. I just half-assed that just so show the principle. I would probably have used an MP14584 module.
I don't understand why you can't connect the gates directly to the weMos pins.
The ESP pins should fully swing between 0volt and 3.3volt, turning the fets fully off/on.
I don't see the switches you mention in your diagram.
If the strip has mechanical switches (to ground), then just use them across the mosfets.
Leo..
The switches are, as I wrote, in the mains lines to the two power supplies.
Each power supply should supply only one part of the strip (cold and warm, respectively), so I can switch them separately via the two mains switches, but both power supplies should supply the uC unit (with the uC being off when both are off as intended and required).
For the latter purpose, there are two Schottky diodes between 24V GND (from the power supplies) and and the uC GND behind the diodes. Therefore, the uC cannot go to 0V, but only to 0V+Schottky, and the 5V is actually 5V+Schottky.
If I account for that and only interface with devices that have the 0.4V of the Schottky as a defined low, this SHOULD work, though.
FYI: I tried to pose the problem to ChatGPT, and (after a few suggestions that don't work, like putting the diode ORing on the high side) came up with the same solution as I did.
For the MOSFETs, it suggested optocouplers.
Your circuit is incomplete as it doesn't show the power supplies or the switches, all of which are critical to answering your question.
Ground in a circuit is, amongst other things, the reference against which all voltages are measured and a common point for everything. Anything that isn't wired to ground isn't ground, which in this case means anything on the anode side of D1 and D2. That which you have labelled GND1 and GND2 is not ground.
Because of the lack of information I can't say if your circuit will work, but messing with ground is asking for trouble. Do your switching on the supply side and be careful of the risk of phantom powering to un powered devices.
I've just noticed you risk floating gates on the MOSFETS, you need pull down resistors on the outputs of the D1 Mini.
I don't really see a reason why you wouldn't call the grounds of the power supplies ground. That the voltage that is connected to the GND pin of the uC (flippantly called uC-GND abouve) is offset by the diode drop I did state. Mayby to be safe, we should call the 24V point ground and consider everything else negative?
I don't see any indication that the output of the MOSFET driver would float (indeed, the functional block diagram contains a Schmitt-Trigger), but to avoid an input voltage to the driver in the undefined range it would certainly be good practice to add pulldowns. As with the LDO, I kept things simple to focus on the main question.
EDIT: Before that also becomes a topic, I just noticed that I forgot to replace the part number of the switching power supplies in the schematic. They are not RAC20-05SK, but Mean Well LPV-35-24.
Refering to your schematic in post #1 :
You should have only one common ground.
The diodes should be used to OR the two 24V supplys connected to the LM1084
That was also ChatGPTs first idea. However, the strip has a common 24V and separate grounds. I can't see how to do that under these conditions, ChatGPT couldn't either. Can you?
By separating the grounds with the two Schottkys.
It mostly works in the Falsted Circuit Simulator, but there is one situation that I do not think is correct and a simulation error.
This here is the general principle, with the middle LED being replaced with the MCU module instead and the power supplies being switched off mains side instead of switches om the 24V end. https://tinyurl.com/297x7tnh
The obvious issue is that MCU LOW is above 0V by the diode drop, but I think I have mitigated that either with the MOSFET drivers (which have 0.4V as a defined low input), or by just not going to 0V on the MOSFET gate, because 0.4V is "closed enough" for dimming (which I would test first).