PIC32 intermittent resets - revisited
If it was me, I would use opto ICs to drive the solenoid valves with back EMF blocking diodes. This would stop the sudden decrease of power to the micro and put less strain on the circuit. Still drive the optos with FETs or darlington drivers.

If you're using a PIC32, then you could interface with a secondary PIC to control the solenoid valves - this way you can recover the secondary and primary PIC by a protocol between the two (fail safe). I have used SIL 5V relays and opto/FET switches with no problems. Some of the units I developed are still running 2 years solid, without being turned off - albeit these are PIC18s, but it proves how robust these PICs are.

In another project, I had failed to CLRWDT() during a lengthy process and yes, it reset, so check that you have plenty of them in your code.

Also check your timings for USARTs and any interrupts causing your program to be busy, include CLRWDT() in your interrupts too if this is where the program fails.

I would advise getting the interrupt - dealing with it and getting out as quick as possible so that you do not miss another interrupt. Timing is a pain and yes, I have had to go through code time and time again due to typos etc. Good look.

Hope this helps.