User avatar
fespinoza.developer
Posts: 14
Joined: Tue Aug 02, 2016 6:11 pm

NPN Transistor and DC motor GPIO18

Tue Aug 02, 2016 6:39 pm

Hi all, in my project I arises the need to control the speed of a DC motor with GPIO18.
The engine has a voltage of 3 ~ 4.2V and a current of 1.9A with a revolving speed of 50000rpm.

What I have clear is that transistor use, will clearly have an NPN, but which would not give me better performance for the voltage and current of My Motor.
I appreciate that indicate which could use.

Sorry for my English, Thanks! :D

User avatar
brekee12
Posts: 335
Joined: Wed Feb 03, 2016 3:36 pm
Location: HU

Re: NPN Transistor and DC motor GPIO18

Wed Aug 03, 2016 6:05 am

TIP120 series npn darlington transistor is perfect choice. The motor can be powered from 5V and the darlington driven by the 3.3V Pi outputs.
Brekee12
on a Raspberry B+ with whezzy, two Zero with Jessie Light

User avatar
fespinoza.developer
Posts: 14
Joined: Tue Aug 02, 2016 6:11 pm

Re: NPN Transistor and DC motor GPIO18

Wed Aug 03, 2016 3:36 pm

Thank you very much for the help, my idea is to make a circuit like this.

Image

The question I have now is whether it will be correct to use a 1K ohm resistor at the base of the transistor.
Also reviewing google I found some posts where they place a diode, if not in this case would be necessary.

Thanks! again and sorry for my English :D

User avatar
joan
Posts: 14887
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: NPN Transistor and DC motor GPIO18

Wed Aug 03, 2016 4:16 pm

Why not buy a L9110S or L298N based motor driver board? You can buy them on eBay for a couple of GBP.

User avatar
brekee12
Posts: 335
Joined: Wed Feb 03, 2016 3:36 pm
Location: HU

Re: NPN Transistor and DC motor GPIO18

Wed Aug 03, 2016 4:44 pm

Yes, the resistor value is OK, if you could not reach 1.9A use lower value, but seems to be ok. The diode has been integrated into the darlington's package.

In case you are not very experienced in assembling, a motor driver board maybe bring you more success. The PCB has been done and parts has been soldered, you have got some warranty. And do not forget about the external power supply, because based on your drawing Pi supply should power the motor which is not a good solution.
Brekee12
on a Raspberry B+ with whezzy, two Zero with Jessie Light

User avatar
fespinoza.developer
Posts: 14
Joined: Tue Aug 02, 2016 6:11 pm

Re: NPN Transistor and DC motor GPIO18

Wed Aug 03, 2016 5:57 pm

Thank you for your comments and responses.

I have not thought of buying a motor driver board for now, for now I'm experimenting and more than anything back to the electronics that allow more less 10 years ago, so I want from the basics of craft.

Alimentare the engine with another power supply 5v 2a, thanks for the recommendations on the assembly, this I will.
The resistor, if less then increase the motor amperage?, If if how small would have to be to get more least 1.9 A, 220 ohm?

Thanks for everything!, Sorry for my English :D

User avatar
brekee12
Posts: 335
Joined: Wed Feb 03, 2016 3:36 pm
Location: HU

Re: NPN Transistor and DC motor GPIO18

Thu Aug 04, 2016 5:52 am

The resistor value controll the maximum amperige. The current flows into basis multiplyed with beta (h21, amplifying constatnt which is about 1000) gives that value. 3.3V-1.2V=2.1V Ube / 1000Ohm =2.1mA Ibe * 1000 = 2.1A, so theoretically 1 kOhm is enough. Although it is not enough 910 or 820 Ohm must be perfect.
Brekee12
on a Raspberry B+ with whezzy, two Zero with Jessie Light

Return to “Automation, sensing and robotics”