Let's Make Robots!

driving motor with bjt

i want to thank every body here for this usefull forum and the great answers i have found.

I want to run applications with PIC MCU but PIC can not sink them(like DC motor).so i need transistor.

but as i look to for example C945 datasheet,the betaof transistor is not specified!!!!!!
only a range is specified for beta.

so how can i have precise design to let my transistor work with the exact CE current I want????? 

 

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Although the beta rating determines the maximum collector current for a given base current input, the actual collector current will depend on the motor supply voltage, motor winding resistance, and transistor VCEsat (I'm assuming the most basic configuration here, things could potentially be more complicated). When you start factoring in things like how the transistor values will vary with temperature and the way the motor's effective resistance will change with increasing speed it starts to become annoying to calculate what current the motor will actually be supplied with.

Rather than relying on the transistor base current to control the collector-emitter current, consider using PWM instead. Choose a base resistor that will give you the maximum current you'd ever want, and then adjust the PWM duty cycle to scale the average current output up and down as needed.

Some PIC μC have a PWM module built it, but if your PIC doesn't support it then you can always code PWM yourself, ie: for 75% power @ 25kHz you'd enable the motor control pin, wait for maybe 30μs, then disable the pin, and wait for 10μs.

 Just a few notes about using a transistor to drive a motor, especially with a μC driving the transistor:

• Motors can cause a lot of noise on the power lines, which can easily disrupt or reset a μC. Try putting a capacitor (a few μF usually does the trick) across the leads of the motor to reduce this.

• Because there are coils and magnets involved, motors can produce nasty little back EMF spikes which can kill your transistor. Unless the transistor already has protection included, or the voltage rating is much higher than the supply voltage, add a diode in reverse across the collector and emitter pins. If the motor throws a big negative spike when you cut the power, the diode will provide a safe path for the back current, instead of having it try to punch through the transistor.

thank you very much for your information.

PWM is exactly what I have used for my robot.

but to put motor aside.for running other applications,I want to know how to design base and collector resistors somehow

the special curren that I want passes through collector.

the beta is not specific so I cont know how to design resistors.

you brought interesting subject(EMF)

I have heard that for safty we should put a diode across motor and it should be reversed biased.

but u said across collector-emitter.

does it mean that when you cut the voltage of base,the motor cause a current in the reverse direction of the time it was running???

if so,it is quite wrong to place diode across motor!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

If you're trying to adjust the load current by varying the base current it becomes quite complicated, and I'd reccomend against it unless you really really have to. If you just want to calculate your basic resistor values for a switching transistor (full power or no power only), try http://www.daycounter.com/Calculators/Transistor-Switch-Saturation-Calculator.phtml

There are a few other transistor calculators there as well which might be useful.

thank you both.I studied all the links,
for example we want to design the common emitter to work in saturation area,to let the maximum current flow through collector.
maximum current is:[ Vcc-VCE(saturation)]/Rc
then we say base current is: Ic/beta
here is my problem.
the beta is not specified in datasheet.only a range is specified.
so how is it possible to calculate base current to finally calculate base resistor to let the transistor work in maximum current?

beside,I have a general question which you would help me alot if you answer:
dude as a beginner who is so keen to learn electronics and such practical information,what do U recommend?
where can I start to learn such practical things (like you said to put a diode across transistor for EMF protection?)
buddies,
at university the only thing that I learnt was some formulas which almost non of them have been useful for practical works.what's your opinion?
right.
thank you oddbot and thank you Al1970.
about EMF:
motor is an inductor so when we cut the voltage of base of transistor the inductor wants to flow the current in the same direction it was flowing.
but why does this current cause a damage?
it is not a high current or it is not in the reverse direction.


and about PWM and noise:
I applies 10nF cap for reducing noise of my motors in my robot.
u mentioned for higher frequencies use less capacity capacitors(less than 1nF)
I thought about but I have no idea why?
what i understand about noise was that as frequency increase then reactance decrease(1/(jwc))
so for high frequencies if the capacitance be high lots of current flow through capacitor which damage the capacitor and decrease motor power.
am I right?
but EMF?
take a look at the picture you have posted for me,(a relay coil with a doide across it.)
normally current flow from Vcc to ground(up to down in the picture)
as you said, while EMF happens the current flow reversly in the coil(from bottom to up)
if so,the diode can not pass the current,
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

by the way

really appreciate your answers.

they worth a world.

thanx every body 

am I right?
in the schematic
27K resistor pull down the base while the MCU pin goes to tri-state condition.
if we do not use it,is it the leakage current of the transistor that might turn the motor on?

i guess this resistor has another effect too!
it cause the motor to stop faster.right?cause it turn the transistor off faster.am i right?