Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Connecting a Tranistor to a Microcontroller Pin

Status
Not open for further replies.
Need to know:
Vdd for the Pic?
Supply voltage for the motor?
Motor stall current?
Motor running current?
 
The link you provided:
**broken link removed** (figure 2)
has a number of things that have not been covered for your particulr case.
When a motor is used as the load, the starting current is much higher than the running current and your circuit must take this into account so that the motor will start.
In addition, the gain of the transistor will be lower at this higher current-flow and that's why you need a power transistor and a low base resistance between the micro and the buffer transistor.
.
 
Use a logic level N-channel Fet like the PSMN3R5-30LL.

You can connect it via a low value resistor (100Ω) directly to the µC output pin.

It will drive loads up to 30V at max 40A.

Here is the data sheet.

Boncuk
 

Attachments

  • PSMN3R5-30LL.pdf
    402.3 KB · Views: 304
Hi,

I'm not sure how to tell what the motors stall and running current are. I do know that if I supply 5 volts to the motor it will turn on. I'm not sure how to test the current.

The Vdd for the PIC is 5 volts.

Thanks,
Vsh3r
 
I'm not sure how to tell what the motors stall and running current are. I do know that if I supply 5 volts to the motor it will turn on. I'm not sure how to test the current.
Place a multimeter in series with the motor and power supply with it set to measure current.

Clamp the motor shaft so it can not turn. Momentarily turn on the +5V and measure the current. (Note: Leave the power on only long enough to measure the current.) That is the stall current.

Turn on the +5V with the normal motor load and measure the current. That is the running current.
 
Last edited:
The link you provided:
**broken link removed** (figure 2)
has a number of things that have not been covered for your particulr case.
When a motor is used as the load, the starting current is much higher than the running current and your circuit must take this into account so that the motor will start.
In addition, the gain of the transistor will be lower at this higher current-flow and that's why you need a power transistor and a low base resistance between the micro and the buffer transistor.
.

The supply voltage to the motor to get it to turn on is between 5 volts and 4.5 volts. I'm not sure on what the current is....

Do you have any links to some datasheets for a typical power transistor that need low Ic (base current) with a voltage of around 5 volts?

Thanks,
Vsh3r
 
Place a multimeter in series with the motor and power supply with it set to measure current.

Clamp the motor shaft so it can not turn. Momentarily turn on the +5V and measure the current. (Note: Leave the power on only long enough to measure the current.) That is the stall current.

Turn on the +5V with the normal motor load and measure the current. That is the running current.

I figured it would be something like that... I just worried that it might hurt my multimeter and thought there might possibly be another way to do this...?

Thanks,
Vsh3r
 
Use a logic level N-channel Fet like the PSMN3R5-30LL.

You can connect it via a low value resistor (100Ω) directly to the µC output pin.

It will drive loads up to 30V at max 40A.

Here is the data sheet.

Boncuk


Thanks for the datasheet link.

The pin of the pic will have 5 volts and about 25 mA connected to the gate pin of this transistor. The source will be connected to the 5 volt supply and the train will be connected to the motor.

Do I need to also connect up some resistors to this... how do I calculate the resistances that I need?

Thanks,
Vsh3r
 
Here is a sample schematic.

**broken link removed**

Any ideas on the resistors I would need to use if the input gate has a current of about 25 mA and a Voltage of about 5 volts coming from the PIC?

**broken link removed**

(see attachments)

Thanks,
Vsh3r
 
Last edited:
What are the resistors I need to use to connect up to the PIC and NPN transistor? R2 is the first resistor connected from the PIC to the Gate of the Transistor and R3 is connected from the Gate to the Drain of the Transistor.

R = V / I
R2 = 4.5 /.025 = 180 ohms
R3 = .5/.025 = 20 ohms

or I could have 4.5 volts at the gate

R2 = 200 ohms
R3 = 180 ohms

Something doesn't seem correct with either of these calculations. These resistances seem really low.

Example: **broken link removed**

From what I read I need to have .5 volts across the Gate and Drain. Do these resistances seem correct? How much current is going through the transistor from the Gate to the Drain... not much? uA?

**broken link removed**

Thanks,
Vsh3r
 
Last edited:
The 2N2222 is a bipolar junction transistor (BJT) and has a collector, base, and emitter terminals. A BJT requires a base current to turn on.

A field-effect transistor (FET) has a drain, gate and source. It requires a gate voltage to turn on.

The base-emitter voltage of a BJT is about 0.65V when the transistor is on. To turn the transistor fully on as a switch, the base current should be about 1/10 of the collector current, so you need to know the motor current. For a maximum current of 25mA from the PIC, the collector current should be 250mA max (that's with all the PIC current going through R2 to the base and no R3). You also need to know the PIC output voltage when it is sourcing 25mA to calculate the value of R2.


If your motor draws more than 250mA you either need to add another stage of gain, or use a logic level MOSFET which can carry the current. (A MOSFET requires no gate current, just gate voltage).
 
Last edited:
The 2N2222 is a bipolar junction transistor (BJT) and has a collector, base, and emitter terminals. A BJT requires a base current to turn on.

A field-effect transistor (FET) has a drain, gate and source. It requires a gate voltage to turn on.

The base-emitter voltage of a BJT is about 0.65V when the transistor is on. To turn the transistor fully on as a switch, the base current should be about 1/10 of the collector current, so you need to know the motor current. For a maximum current of 25mA from the PIC, the collector current should be 250mA max (that's with all the PIC current going through R2 to the base and no R3). You also need to know the PIC output voltage when it is sourcing 25mA to calculate the value of R2.


If your motor draws more than 250mA you either need to add another stage of gain, or use a logic level MOSFET which can carry the current. (A MOSFET requires no gate current, just gate voltage).

About how much current should I be expecting go into the base of the BJT? I'm seeing about 15 mA on my circuit simulation.

I'm using LTspice to simulate.

Thanks,
Vsh3r
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top