Transistor and Solenoid Valve Help

Hi, I am working on a school project for my engineering class, and I had a few questions.

I am wanting to power this 12v solenoid valve:

I read that many of these valves can open with 9 volts. Say I use a 9 volt power supply with this valve. Would it work properly if I used a 2n3904 transistor, resistors, and a diode alone in the circuit, or would I need to purchase a better transistor or a relay to work in conjunction with the transistor, or will the 2n3904 be good enough.

I am very limited on time, so I can't really order anything.The 2n3904 transistors, resistors, and diodes are the only components I currently have. Thank you.

12 volt is a standard voltage for pwr supplies. Use that. Check the current drawn by the solenoid. Check the data sheet of the transistor. They tell about maximum current. Personally I would use a logic N-channel MOSFET transistor.

I just saw that the current drawn by the solenoid valve is .3 A and the collector current on the 2n3904 transistor is .2 A. Does this mean that this specific transistor is not going to work.

Yes. That transistor will burn up.

Dang okay. Thank you for your help.

Personally I would use a logic N-channel MOSFET transistor. They don't cost much and they are capable to handle some 5, 10 Amps or more.

Yeah I definitely want to purchase that. I just don't know if it will be here in time if I ordered it.

Check what You've got in the transistor storage. If You swap the solenoid to a simple LED and a resistor You can go ahead with the code while awaiting a proper transistor.