Regarding your questions:
Yes, the relay boards are all 12v types and I replaced them already by other 12V boards --> no change.
Therefore the relay boards shall not be the root cause.
There are no remaining jumpers on the boards, all are connected only via JD-VCC and GRD.
The expansion boards are connected via 3V3 pin of the arduino ESP32
I also unplugged 3 of 4 expansion boards.
The remaining expansion board and the related relay board are showing same effect: firstly the relays are following the button typed on the via bluetooth connected tablet and then other relays are also switching.
I tried this with 2 of four expansion boards, same effect.
Everything connected, but no power on the relay board.
By pressing all buttons randomly the reaction of the indicator LEDs on the relay board is as expected.
BUT after pressing one button many times after 15 – 20 times the system is getting out off control. Other relay indicator LEDs (no power on relay board) are switching on and off randomly, sometimes all together.
The software is switching the relays on by pressing the button and with a delay of 200ms the relay is switching off.
But even this is not working anymore; sometimes the relay is switched only on and is remaining on. After pressing the button again the LED is switched off?!?
This all is only related to the relay board with the related button. All other relays are not involved. Butt this effect is appearing on all boards.
And then after clicking some times more everything is dead, no indicator LED is swithing on /off until depowering the arduino, waiting for a while and starting again.
Now I have two different situations:
With powered relay boards the mismatch between pressing the buttons and the uncontrolled switch of the relay is happening imediatelly.
With unpowered relay board the first system behaviour is as expected, but after pressing one button many times the trouble is appearing also.
Therefore maybe no hardware related trouble?
But why this is happening only after pressing a button many times and why the switching off operation with the software controlled delay is ignored?
Below you will find a link to my sketch, something wrong here?
For better understanding:
Purpose for this setup is to controll the crossovers of my model railway.
Every crossover needs one relay powered for 200ms for direction „straight“ and one for „turn“.
I started the sketch in German, therefore the variables are using mainly German words, I added English translations, hopefully understandable.
As you can see on my setup, not all relays are available as given by the sketch.
I blanked them out as a comment, but didn´t deleted them.
Link:Sketch model railway crossover