Soil Moisture sensor

At "case 4:", you should use Pin41 and Pin42, but you also use Pin11 and Pin12. So that's an program error.

To avoid such errors you should write a function for just one probe. And you can call that function 4 times for the 4 probes.
Also setting the output mode could be done in that function.

The usage of pins can be done by calling that function, but they could also be declared in an array.