Controlling two 24v solenoids

I would normally trust myself (and I actually did for a bit, but that part of the story comes later), but I'm going to ask for the help of the community, mainly the n00b helping community on this one.

Prologue A young aspiring tinkerer/maker/electrical engineer/lunatic tries to hook up two solenoids to an Arduino with N-channel MOSFETs, diodes, resistors, and a 24v DC power supply with this attached to it so I could attach it to the breadboard. I had succeeded to do this with only one solenoid following this tutorial. Now, after doing it with one, I wanted to try controlling two solenoids with two pins, two MOSFETs, etc. Well, long story short, now one of the USB ports on my laptop is no longer operational due to (I think) back current from the power supply (I think that's what it's called).

TL;DR How do I control two solenoids with an Arduino? How do I make SURE that my second USB port doesn't get blown? In short, how do I convert that tutorial that I linked to into a circuit that operates two solenoids?

Thanks in advance!

So you brought 24V into the arduino to power it? And now the USB is shot?

Yes. Embarassing, right? Fixing/replacing the port is a whole other problem. But while I'm doing that, I also want to continue trying to get my solenoids to work. I also forgot to mention that although I'm trying to trigger 2 (at different times) right now, I eventually want to do a lot more.

Have you fully powered down and rebooted your laptop? Sometimes this will reset an internal protection circuit.

Now for my Iron Law #1. ALWAYS use a powered USB hub for electronic experiments. ALWAYS.

Restarted, not working. As for your iron law, do you think just loading the sketch and then hooking up another 9v power supply straight into the arduino would do just as well? But for the adapter, would this be good?

BUT, the question that is more important to me right now, is how would I make that circuit work for two solenoids? I'm gonna do a little protoytpe in fritzing tomorrow and show it to you guys so you can tell me if/why it won't work.

OK, if you got scared by this and want to prevent this from happening again, then you can consider to use a fully isolated solution. Normally you need to have at least the grounds coupled so there is always a connection between the different power levels. But if you use an opto coupler, you will send the PWM volve control signal to the valve by light. This means there is no coupling between the different power supplies and it will be unlikely to destroy the Arduino or a connected computer. The combination optocoupler and PWM is a perfect one. It will also prevent "back emc" caused by the solenoid and PWM pulses to arrive on your Arduino and anything connected to it.

It will however mean a bit more expenses and more attention to the schematics (to keep the separation intact).

Restarted, not working. As for your iron law, ... But for the adapter, would this be good?

The main issue is the quality of the power adapter. Lots of current capacity is desirable. The best one I have came from Staples with 7 ports and a 3.5A supply. I never use all the ports but the spec requires 500ma/port. Thus more ports should mean a better supply.

Some hubs will supply 1A or more out of a given port, others stupidly restrict output to 500ma - slavishly following a spec designed for laptops.

The main point is to protect your PC. Zap the cheap hub not your laptop.

one of these is always a good start for power working

Alright, I'm gonna get a powered usb hub so I can just experiment without having to confirm that my circuit is perfect.

Did the high voltage come back into your arduino on D3 ? There was only ground and D3 connected as I see it. How about a resistor on D3. I don't know this circuit that well, but It looks like a resistor there would have helped.