Drive small motor with 2N2222A Transistor
KB3JJG
Posts: 95
I just want to verify that I am doing this right, I love my stamp and do lot's with it, but I have always stuck to using motor controllers and servo controllers for this kind of stuff. Anyways, here goes.
I am driving a small 9v hobby motor, I am using a board of education powered by a 9v 500mA class 2 wall wart. I have a bunch of 2N2222A transistors, from a FM transmitter project I did some time ago, that I want to use to power this motor.· I gleened what I could from·my ·microcontroller application cookbook chapter 4, outputs, but my knowledge on the "electronics" part of this hobby is limited at best.
Here is my schematic, based on my research I think I can make p15 high and it should work. Could someone verify that I am doing this properly? Thank you in advance for your time and any assistance!
·
I am driving a small 9v hobby motor, I am using a board of education powered by a 9v 500mA class 2 wall wart. I have a bunch of 2N2222A transistors, from a FM transmitter project I did some time ago, that I want to use to power this motor.· I gleened what I could from·my ·microcontroller application cookbook chapter 4, outputs, but my knowledge on the "electronics" part of this hobby is limited at best.
Here is my schematic, based on my research I think I can make p15 high and it should work. Could someone verify that I am doing this properly? Thank you in advance for your time and any assistance!
·
Comments
Depending on the 2N2222A transistor gain, you may need some more base drive. I suggest replacing the 1K base resistor with 470 Ohms.
When in doubt, use a little 5V reed relay (the Shack has these, OK). The coil only draws 20 mA, so you can drive it directly from an output pin (use a flyback diode)
erco
KM6DS
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
-Phil
Mike, following your advice, I put a 1N4001 diode in place. I got a lower voltage motor, 3V, and put in a 500ohm resistor, I forgot to get some 470's at the shack and the 500's were all I had. Below is an updated schematic, the changes are the addition of the diode, resistor value change, a lower voltage motor,·and changing the the negative terminal on the motor·to Vdd from Vin.·I fired up the stamp, made pin 15 high and it worked!
I have one followup question to this excersize. I am using what I believe to be quality transistors, ST 2N2222A, I say this in reference to erco mentioning the lower quality ones the shack sells. Anyways I have attached the datasheet for the part to this post. Could someone help me figure out how much current I am sourcing from my stamp. As I move foreword and away from simple projects·using just a few parts and start integrating more, I want to be mindful of the current draw on my stamp.
Thanks to all 3 of you guys for your guidance and assistance!!!
Post Edited (KB3JJG) : 12/23/2008 5:11:53 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Omar
Abunayyan
··· The short answer to your question is that the transistor acts as a switch to turn the motor on.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Omar
Abunayyan
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Omar
Abunayyan
http://forums.parallax.com/attachment.php?attachmentid=37701
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.