0

Need help picking a transistor
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Need help picking a transistor

by nicat23 on Wed Sep 15, 2010 2:54 pm

Ok, so I have a project that I am building for a friend of mine that will have a servo that turns about 30 degrees. I dont want the servo to constantly have power, so I want to be able to switch its connection on and off as needed, and I figured that a transistor would be the best bet to do something like this. I however am no expert when it comes to knowing the difference between the transistors, I'm guessing I'll be going with a NPN of some sort but I'm not really sure. The servo's power requirements are 4.8-6.2v.. Will something like a 2N2222 work with this or will I have to use a TIP120 or similar? I'm wanting to use a transistor so that I can control the power with a micro controler's pin driving the base to high (turning the transistor on and activating the switch for the servo).

This is going to be for a lock mechanism.. User inputs correct code, it will turn the power onto the servo, activate the pwm to move 30 degrees, then turn off the servo till an external interrupt switch in the lid which then activates same process in reverse (turn on transistor pin, activating power supply to servo, send pwm to return), locking the box back.

At this point I have the schematic drawn and the logic planned in the software, I just need to know which transistor will work as a switch! I don't know how to do the calculations to figure out which to use as I am just really beginning with small electronics..

Any advise from the gurus would be greatly appreciated and thanks in advance!
nicat23
 
Posts: 11
Joined: Thu Jul 08, 2010 2:07 pm

Re: Need help picking a transistor

by Philly on Wed Sep 15, 2010 3:01 pm

What kind of current will it be switching? If low, just about any transistor will do :)
Philly
 
Posts: 57
Joined: Sun Jun 20, 2010 7:53 am

Re: Need help picking a transistor

by nicat23 on Wed Sep 15, 2010 3:25 pm

Actually now that I think about it, the current drain of 5.4mA @ idle isnt all that much, should I even worry about a switching system like this? I know that it would make sense if I were using a gear motor that only went one direction, but since this only draws 150mA @ load, and since it will only be at load when opening and closing (moving 45 degrees maximum, then back when closed) should I worry about it? Opinions?

From what I read the current drain at 4.8v is:
Current Drain (4.8V): 5.4mA/idle and 150mA no load operating

Hope this helps

full specs of the servo:
Code: Select all | TOGGLE FULL SIZE

Control System: +Pulse Width Control 1500usec Neutral
Required Pulse: 3-5 Volt Peak to Peak Square Wave
Operating Voltage: 4.8-6.0 Volts
Operating Temperature Range: -20 to +60 Degree C
Operating Speed (4.8V): 0.17 sec/60° at no load
Operating Speed (6.0V): 0.14 sec/60° at no load
Stall Torque (4.8V): 15.27 oz-in. (1.1kg.cm)
Stall Torque (6.0V): 18.05 oz-in. (1.3kg.cm)
Operating Angle: 40° one side pulse traveling 400usec
360 Modifiable: Yes
Direction: Clockwise/Pulse Traveling 1500 to 1900usec
Current Drain (4.8V): 5.4mA/idle and 150mA no load operating
Current Drain (6.0V): 5.5mA/idle and 180mA no load operating
Dead Band Width: 8usec
Motor Type: 3 Pole Ferrite
Potentiometer Drive: Direct Drive
Bearing Type: None, outer case serves as bearing
Gear Type: All Nylon
Connector Wire Length: 6.29" (160mm)
Dimensions: 0.89" x 0.45"x 0.94" (22.8 x 11.6 x 24mm)
Weight: 0.28oz (8g)
nicat23
 
Posts: 11
Joined: Thu Jul 08, 2010 2:07 pm

Re: Need help picking a transistor

by zener on Wed Sep 15, 2010 4:34 pm

If you are switching the high (+) side then you need PNP/P-channel. If you are switching the low (-) side then you need NPN/N-channel. PN2222 should be OK for that application, if low side switching, which is how I would do it. N-fet might be easier, like 2N7000, since you don't need to calculate the base resistor. But that's not hard really.

edit: arduwino (below) makes a good point. The PN2222 is good for a couple hundred mA maybe. Otherwise switch to something meatier, in a TO-220 package probably.
Last edited by zener on Wed Sep 15, 2010 8:18 pm, edited 1 time in total.

zener
 
Posts: 4532
Joined: Sat Feb 21, 2009 2:38 am

Re: Need help picking a transistor

by adafruit_support_bill on Wed Sep 15, 2010 4:55 pm

the current drain of 5.4mA @ idle isnt all that much, should I even worry about a switching system like this?

If you are running from batteries it might be worth it. But otherwise I wouldn't bother.

but since this only draws 150mA @ load,

I believe that figure is for active, with no load. The current when moving - especially against any resistance is likely to be considerably higher.

To achieve the 5.4mA idle current , you need to call "servo.detach();". This stops the pwm signal on the servo control pin and allows the servo controller to go idle. Just remember to re-attach before you try to move it again.

adafruit_support_bill
 
Posts: 75758
Joined: Sat Feb 07, 2009 10:11 am

Re: Need help picking a transistor

by nicat23 on Thu Sep 16, 2010 1:55 pm

Yes, I will be running on 4AA batteries using a MAX756-CPA to regulate the power up to 5v, I'm using 4 batteries instead of two to make sure the servo will have enough power as well as enough power to run the micro as well

Zener: The way that I have the 2222 setup right now on my breadboard where pin 5 goes to the base of the 2222, the emitter is going to ground and the collector is attached to the negative (I think? Since electrons flow from the negative to positive) of a DC gear motor (I know, dc motors and servos are different animals, i just recently decided to switch to the servo to simplify my device) with a diode going across the motor to eliminate back EMF and with the other end attached directly to vcc. When the code is entered the ATMEGA drives the the pin attached to the transistor (which is attached with a 2.2k resistor) high, enabling the switch and turning the motor. For the servo I know I will need to change the way that I have it setup, you said that you would switch the low side as opposed to the high side? Am I guessing that I have the switch setup in the correct position for now? If so that should mean switching out the dc motor for the servo should work without many modifications, or do I have it backwards? attached is a basic schematic illustrating what I have described

Arduwino: Thanks for the great information, I have yet to finish reading the servo library so that is a really big help, thanks.. As far as a load on the servo, it will be rotating a latch hook that weighs less than half a gram that will be attached directly to the servo itself so it wont really be under much strain if any

Untitled-1_edited-1.jpg
Untitled-1_edited-1.jpg (59.32 KiB) Viewed 1955 times


Thanks again for the information guys, looking forward to your replies
nicat23
 
Posts: 11
Joined: Thu Jul 08, 2010 2:07 pm

Re: Need help picking a transistor

by zener on Thu Sep 16, 2010 3:29 pm

That looks good except I don't understand the upper wire labelled "servo PWM". Forget about what way electrons flow. Save that for physics class. In electrical circuits the convention is that electricity flows from + to -. You can say holes flow from + to - if that makes you feel better.

zener
 
Posts: 4532
Joined: Sat Feb 21, 2009 2:38 am

Re: Need help picking a transistor

by nicat23 on Thu Sep 16, 2010 4:24 pm

Thanks Zener, the servo PWM label is for the servo signal wire, I labeled it that way so that I would know what wire it was myself, I know that PWM is how the servo's positions are controlled so I just labeled it PWM for myself :-) But other than that it looks right? My servo arrives in the post soon and I'm hoping to have the schematic ready so I can just put it into the circuit when it gets here, it's the last piece of the puzzle
nicat23
 
Posts: 11
Joined: Thu Jul 08, 2010 2:07 pm

Re: Need help picking a transistor

by zener on Thu Sep 16, 2010 4:41 pm

OK. But your servo can only go in one direction...

zener
 
Posts: 4532
Joined: Sat Feb 21, 2009 2:38 am

Re: Need help picking a transistor

by nicat23 on Thu Sep 16, 2010 5:04 pm

Once again my ignorance shows itself! Thanks again for your wonderful help Zener. Looks like I'll be going to the local hobby shop to find myself a steering servo of some sort for an rc car that will allow forward and backward movement, I dont need much, just about 30 degrees or so, enough for the hook to clear the hasp

Edit:

"This servo can operate 180° when given a pulse signal ranging from 600usec to 2400usec. Since most R/C controllers cannot generate this wide of signal range, you will need to use our servo stretcher for 180° operation."

I found this on the website that gave the specs that I posted earlier(Found here), and correct me if I'm wrong but doesnt that mean that with PWM I should be able to, with the right pulses being sent out, move this servo from one side to the other (wiper style)? Or is that assumption incorrect?

Learning something new every day.. I'm really enjoying the learning process of small electronics, especially since the community is so large and helpful.. Thanks again
nicat23
 
Posts: 11
Joined: Thu Jul 08, 2010 2:07 pm

Re: Need help picking a transistor

by zener on Thu Sep 16, 2010 7:31 pm

OK. Yes I think you are right. I was thinking it was just a motor of some kind. Now I understand the PWM wire. Yes that should be fine as long as the little transistor can handle the current. If it burns up then you know it couldn't.

zener
 
Posts: 4532
Joined: Sat Feb 21, 2009 2:38 am

Please be positive and constructive with your questions and comments.