Electronic – What transistor should I use to power a motor from an xbee

amplifiermotortransistorsxbee

I have a small motor what operates at 3.3V at 50mA (sorry no documentation) and a Xbee radio which outputs 1mW.

I would like to allow the Digital I/O pins output on the Xbee to drive the motor though it is currently to weak. I've thought of these two solutions though I need help on either of them.

  1. The Xbee Documentation says the 1mW output is "software selectable." I have XCTU which I've been using to get the Xbee's to talk. Is there an option is XCTU to change the Xbee's output to >1mW ?

  2. Design a amplifier. I thought that maybe using a simple amplifier curcuit might work. I'm just not sure how to amplify the 1mW signal properly.

Best Answer

It's most likely you are confusing the RF output power with the digital outputs as Chris notes . In any case it's unlikely the outputs will be able to source/sink 50mA (usually <20mA) Their current capability should be mentioned in the datasheet though.

EDIT - I checked the datasheet which confirms the 1mW transmit (i.e. RF comms) power, but I can't find a current sink/source value for the digital pins. So with no specs to follow you have no choice but to assume they are not capable (edit - as Steven notes there is mention of a 2mA test condition for the max low/min high outputs, so this figure is likely to be the nominal source/sink rating)
EDIT 2 - I just came across this 2010 version of the xBee datasheet (I think it describes the same hardware) which has the necessary information added - they say:

The combined source and sink capabilities of the module are limited to 120 mA for all pins on the module. Module pins 11 and 15 can source/sink a maximum of 2 mA; pins 9, 6 and 13 can source/sink a maximum of 16 mA; all other pins can source/sink a maximum of 8 mA.

So there you have it, none of the IOs can handle 50mA.

This means you will need a simple transistor to handle the current. Something like this should do:

Motor driver

The NPN can be pretty much any "general purpose" transistor, and the diode can be changed for a similar part also. If you use one of the low current I/Os (pins 11 or 15) you'll have to increase the base resistor to 1.5 kΩ.

Suitable transistors:

As mentioned the BC337 or BC817 is an excellent, cheap, high gain general purpose transistor. To find more, have a look on a site like Farnell and use the very useful parametric search. For the parametric search input, we know we need an NPN transistor capable of 50mA and 3.3V (pretty much anything)
The only possible issue is the gain - since the xBee pins are low current, the higher the gain the better (we can use a higher value base resistor and save power). So if we select NPN, and then order results by hFE (current gain) we get a few pages of darlingtons at the top, then on page 9 we start seeing standard bipolars with gains of ~800.
For example the 2SD2114KS has a minimum gain of 820, so to get 50mA we need 50mA / 820 = 61uA. If we use say 200uA to be "safe" we can have a base resistor of (3.3V - 0.7V) / 200uA = 13K.
In reality this is a bit overkill and a BC337-40 or similar with a minimum gain of 250 would be fine (with e.g. a 5k resistor on base)

A suitable logic level MOSFET will do the job too as per Stevens answer, you just have to make sure the gate threshold voltage (Vth) is low enough to allow your drive signal to turn the MOSFET on adequately.
A possible issue if you are wanting to use through hole is there is not a good selection of decent logic level MOSFETs in e.g. TO-92 packages. If we apply the parametric search again, we need the same current/voltage rating, but now we need to look for a part with a threshold voltage well below 3.3V.
I say well below as Vth only indicates when the part begins to turn on, and will only pass a few uA at this level. To get the full story we usually need to look at the gate voltage versus drain-source current graphs.

So we search for: N-channel, continuous drain current >100mA, drain-source voltage >5V (to cover the 3.3V) and threshold voltage Vgs typical of <1V. There are thousands of results, but we still need to check in the datasheet just to make sure the MOSFET will be sufficiently turned on at 3.3V.
Something like the NTS4001N has a max Vth of 1.5V and according to the graph (see below) will pass ~130mA at a Vth of 2.25V. It has a pulse current of 800mA which should handle the motor startup surge.

Vgs vs Ids