Hello,
I need a circuit that can be turned ON and OFF depending on the case.
- Everything is OFF. I connect a 12V to the optocoupler circuit, and turn the power ON.
- When needed, I will disconnect the 12V rail from the optocoupler circuit
- The MCU is powered ON as it gets the power, and continues to set power ON for itself and other things
- Meanwhile, if I disconnect the 12V from the optocoupler, the MCU will allow the power supply to be ON
- After the condition is met, the MCU will cut OFF the power
Here is the schematic:
So, here you can see the btnIn1 where I will connect the 12V when needed. On onOffCut is connected digital pin from the MCU.
The question is, am I working in the right direction? Do I need to change the resistor values? Maybe some other approach?
The basic thing is, the setup should start working when I press the button with 12V, until the MCU says it is enough. The button might be a switch, so it could be a longer ON period on the optocoupler side.
This is not the final design. It can be changed if there are better solutions, suggestions, etc


