I am going to connect NodeMCU to a latching relay board like tis one (4 channel version): LINK
Both MCU board and relay board will be powered from the same 5V voltage regulator.
Now I have two problems to solve:
Problem 1 - logic levels
NodeMCU logic level is 3.3V and relays board works in 5V levels. I can either use logic level converters or simple transoptors. Because I am going to attach NodeMCU to a custom PCB, I think transoptors will be simpler to solder.
Problem 2 - relay triggers with low pulse on the control pin
This relay boards works like this: every time the channel pin (T1 - T4) is connected to ground for few miliseconds - the relay flips to other state. Here is the question: when the MCU board resets/reboots on power cycle, how do I ensure that the control pins are HIGH from the beginning? If they are not, the relay can flip randomly before my program starts and I will not know the initial state of relay.
What would be the best approch here ?