I have a 16 channel multiplexer connected to GPIO's 5, 4, 0 and 2, and a MCP3208 connected to GPIO14, GPIO13, GPIO12 and GPIO15.
The 16 channel multiplexer drives 16x PNP transistors, which in turn drives 16 relays. At the other end of the relays is a 48V battery bank. Each relay connected to it's own 12V, 200A battery. 4 batteries are connected in series to form 48V. There's 4 strings of 4 batteries in total.
the problem I am facing is that when the NodeMCU power cycles, for example when the power has failed, two or sometimes three random relays activate at the same time, causing those relays to burn out if they're in the wrong string.
How do I get GPIO2 to not activate while the NodeMCU power cycles? I have tried with a 10K resistor between the 4 GPIO pins and ground but that didn't work.