(Beginner) Type of (NPN?) transistor to use for RasPi

npnraspberry pitransistors

I'm new to EE. I burned out a Raspberry Pi by running an electric motor directly from its GPIO pins, and then I learned about transistors. I now have another RasPi, but I'm not sure what transistors to buy. I plan on using the RasPi's 3.3v GPIO pins for the base and a 4 AA batteries connected for the collector. What NPN transistor should I buy (or what pack of general-use NPN transistors should I buy that I can adapt to fit) for this project? Are there any methods to determine which transistor values are required? If it's best to just get a pack of general-purpose transistors, what do I need to do to accomodate for the difference in voltage/amperage tolerance? Would any capacitors be required in the circuit to account for the motor's interference? If I wanted to replace the motor with an antenna, would I have to change anything?

Let me know if my phrasing is unclear. Thanks for any replies, I know that this kind of thing must be annoying to you.

Edit: The motor is an example. I just wanted to know what to use for that current.

Best Answer

You'll want to keep in mind what kind of motor you'll be driving and what voltage it is rated for. That said, to control a motor, for simplicity sake you'll want to use an h-bridge motor controller. This will allow you to take the guess work out of how to start/stop/reverse the motor without great concern for fault conditions/motor stall.

For example, I found this one here that can be used specifically with an embedded system http://www.amazon.com/Makerfire%C2%AE-Raspberry-L298N-Motor-Driver/dp/B00N7IYTKE/ref=sr_1_3?s=electronics&ie=UTF8&qid=1424107521&sr=1-3&keywords=raspberry+pi+motor+controller