I've got two push-pull solenoids that I need to switch the 5V supply between. The way I approached this was by dividing the voltage from I/O pin #2 between the gates of 1 N-Channel MOSFET and 1 P-Channel MOSFET, with this pin toggling between HIGH and LOW every 200 milliseconds. So ideally one of either of the MOSFETs would allow the current through depending on the state of the pin. However, the P-Channel MOSFET seems to be in an "always open" state from what I can tell, and I'm not certain as to why.
That was my original thought but that wouldn't allow me to use the one 5V pin, correct? I need to switch it between both solenoids as they both need 5V to operate.
The solenoid coils can both have 5V on them. If they need higher current, do not power them from the Arduino 5V pin, you'll take out the 5V regulator, or blow the USB fuse.
Do connect the external supply's Gnd to the Arduino Gnd.
Use two N-channel parts, and two output pins. Which ever one has a high on it's gate will have current sunk thru it's coil to energize the solenoid, just what DVDDoug said.
Gonna make quite a clatter turning on/off 5 times a second.
Although it is done in CAD, a photograph of a hand drawn circuit is just as good.
It has component and pin labels and shows signal flow.
It takes time to learn a good layout technique, but I suggest you begin drawing circuits of your projects as it helps immensely with project description.
Be aware that the inverter circuit will ensure that one of them is powered at all times - at start-up Q2 (mislabeled as Q1 in that diagram, the right-hand one should be Q2 - there are two Q1s!) will be on, and K2 will be on.
Using two pins you can have both solenoids off at the same time (or both on at the same time).
Up to you to decide which option works best for your project!
Should be fairly powerful solenoids to actually switch fast enough to make the 0.2 second interval. And indeed quite a noise. You're likely to need an external power supply to make this work well. Saves a lot of power spikes on the Arduino side, too.