baronobeefdip
Posts: 76
Joined: Sat Sep 27, 2014 6:20 pm
Contact: Website

Is there a way to control motor speed without any chips

Wed Nov 18, 2015 5:51 pm

I am on a budget and all of the tutorials on motor speed control with a raspberry pi have been involving chips in order to do so. I am on a budget and have no time or money to go out and hunt down chips. Even though some might be relatively easy to find, and cheap, I don't want to spend money on them. I am wondering if there is a way to control the speed of a motor by simple use of a GPIO pin and transistor.

User avatar
RST8
Posts: 64
Joined: Tue Nov 25, 2014 1:57 pm

Re: Is there a way to control motor speed without any chips

Wed Nov 18, 2015 6:13 pm

baronobeefdip wrote:I am on a budget and all of the tutorials on motor speed control with a raspberry pi have been involving chips in order to do so. I am on a budget and have no time or money to go out and hunt down chips. Even though some might be relatively easy to find, and cheap, I don't want to spend money on them. I am wondering if there is a way to control the speed of a motor by simple use of a GPIO pin and transistor.
Short answer is No.

GPIO can provide tens of milliamps. A motor needs significantly more. You risk damaging your Pi, which is going to cost you a lot more than getting a suitable chip or power transistor.

User avatar
rpdom
Posts: 17173
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Is there a way to control motor speed without any chips

Wed Nov 18, 2015 6:17 pm

RST8 wrote:
baronobeefdip wrote:I am on a budget and all of the tutorials on motor speed control with a raspberry pi have been involving chips in order to do so. I am on a budget and have no time or money to go out and hunt down chips. Even though some might be relatively easy to find, and cheap, I don't want to spend money on them. I am wondering if there is a way to control the speed of a motor by simple use of a GPIO pin and transistor.
Short answer is No.

GPIO can provide tens of milliamps. A motor needs significantly more. You risk damaging your Pi, which is going to cost you a lot more than getting a suitable chip or power transistor.
The OP mentions a transistor...

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

Re: Is there a way to control motor speed without any chips

Wed Nov 18, 2015 6:18 pm

Yes, you have to implement the functionality of the motor driver in discrete components. That might be feasible if you already have all the needed diodes, resistors, and transistors, otherwise it may be cheaper to order a inexpensive motor driver board.

E.g. http://www.ebay.co.uk/itm/351527222931 will drive 2 DC motors forward and reverse and accept PWM speed control.

User avatar
mikronauts
Posts: 2783
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Is there a way to control motor speed without any chips

Wed Nov 18, 2015 6:44 pm

Save yourself a lot of headaches, and use an L293D chip.
baronobeefdip wrote:I am on a budget and all of the tutorials on motor speed control with a raspberry pi have been involving chips in order to do so. I am on a budget and have no time or money to go out and hunt down chips. Even though some might be relatively easy to find, and cheap, I don't want to spend money on them. I am wondering if there is a way to control the speed of a motor by simple use of a GPIO pin and transistor.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

baronobeefdip
Posts: 76
Joined: Sat Sep 27, 2014 6:20 pm
Contact: Website

Re: Is there a way to control motor speed without any chips

Wed Nov 18, 2015 7:08 pm

mikronauts wrote:Save yourself a lot of headaches, and use an L293D chip.
baronobeefdip wrote:I am on a budget and all of the tutorials on motor speed control with a raspberry pi have been involving chips in order to do so. I am on a budget and have no time or money to go out and hunt down chips. Even though some might be relatively easy to find, and cheap, I don't want to spend money on them. I am wondering if there is a way to control the speed of a motor by simple use of a GPIO pin and transistor.
Yeah based on the other responses that seems to be the way to go, but I have heard of just simply using an assortment of transistors and I might check that out to make things more clearer. In the meantime, ordering that chip would have to come all the way from China and a deliver like that could take about a month which is time that I don't have.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Is there a way to control motor speed without any chips

Wed Nov 18, 2015 7:13 pm

mikronauts wrote:Save yourself a lot of headaches, and use an L293D chip.
+1
For £3 / $3 it would be a false economy not to use one.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

baronobeefdip
Posts: 76
Joined: Sat Sep 27, 2014 6:20 pm
Contact: Website

Re: Is there a way to control motor speed without any chips

Wed Nov 18, 2015 7:17 pm

DougieLawson wrote:
mikronauts wrote:Save yourself a lot of headaches, and use an L293D chip.
+1
For £3 / $3 it would be a false economy not to use one.
From what I have been seeing, the big caveat for me would be that I would have to wait a month for it to get to me.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Is there a way to control motor speed without any chips

Wed Nov 18, 2015 7:28 pm

baronobeefdip wrote: From what I have been seeing, the big caveat for me would be that I would have to wait a month for it to get to me.
That's better than having to wait a month for a new $35 RPi.

If you want to build a H bridge with discrete components watch this video https://www.youtube.com/watch?v=SsB_ezlict4
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

baronobeefdip
Posts: 76
Joined: Sat Sep 27, 2014 6:20 pm
Contact: Website

Re: Is there a way to control motor speed without any chips

Wed Nov 18, 2015 7:49 pm

DougieLawson wrote:
baronobeefdip wrote: From what I have been seeing, the big caveat for me would be that I would have to wait a month for it to get to me.
That's better than having to wait a month for a new $35 RPi.

If you want to build a H bridge with discrete components watch this video https://www.youtube.com/watch?v=SsB_ezlict4

I guess I have a bit of a poor man's arrangement but I am not sure how it will all go. the schematic in the following link is the best that I can do.

http://i.imgur.com/a8GwOoh.jpg

All the gpio lead on the left side of the schematic will not all be turned on at the same time. Each lead will be activated alone while the others have no current flow. meaning that whenever a gpio port is on, it will go through a different number of resistors along the way. the lead at the very top is the connection which goes through no resistors so it powers the motor at full power, while the ones below it will go through either one or more resistor depending on which one is activated. these varying degrees of resistance will alter the current and then run the motor at different speeds depending on the resistance applied to the base of the transistor. I am hoping that this might be an appropriate connection.

boyoh
Posts: 1468
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Is there a way to control motor speed without any chips

Wed Nov 18, 2015 8:42 pm

I don't think your Idea will work, using a ladder network of resistors and witching it with out/puts.

A out/put will be ether 1 ( high ) or 0 ( low ) Your resistors will not be additive ( Shorted out)
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

danjperron
Posts: 3502
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Is there a way to control motor speed without any chips

Wed Nov 18, 2015 9:08 pm

Before buying any motor driver, we should know what kind of motor you want to connect to the Pi. This is a big consideration and it is the first one.


Is it a AC, DC , Servo or a stepper?

It is a 2 H.P. or a little toy motor?

What is the Voltage, running and stall current?

What will be the purpose of the motor?

User avatar
mikronauts
Posts: 2783
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Is there a way to control motor speed without any chips

Wed Nov 18, 2015 10:38 pm

+1
danjperron wrote:Before buying any motor driver, we should know what kind of motor you want to connect to the Pi. This is a big consideration and it is the first one.


Is it a AC, DC , Servo or a stepper?

It is a 2 H.P. or a little toy motor?

What is the Voltage, running and stall current?

What will be the purpose of the motor?
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13099
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Is there a way to control motor speed without any chips

Wed Nov 18, 2015 11:16 pm

baronobeefdip wrote: I guess I have a bit of a poor man's arrangement but I am not sure how it will all go. the schematic in the following link is the best that I can do.

http://i.imgur.com/a8GwOoh.jpg

All the gpio lead on the left side of the schematic will not all be turned on at the same time. Each lead will be activated alone while the others have no current flow. meaning that whenever a gpio port is on, it will go through a different number of resistors along the way. the lead at the very top is the connection which goes through no resistors so it powers the motor at full power, while the ones below it will go through either one or more resistor depending on which one is activated. these varying degrees of resistance will alter the current and then run the motor at different speeds depending on the resistance applied to the base of the transistor. I am hoping that this might be an appropriate connection.
That won't work, if only for the simple reason that connecting a GPIO to the base of a NPN transistor (which has its emitter tied to GND) is big no-no, you are in essence tying a diode between the GPIO and GND, and that will draw unlimited current from the GPIO when it is trying to put 3.3V on the anode of this diode, this will destroy the GPIO, and with it the SoC (broadcom chip).

If the big idea is to have a variable current flowing into the base of the transistor (which is somewhat of a valid idea), then your network is laid out wrong, you should tie all resistors on one end (the end connected to the transistors base) together, and use resistors with a binary sequence of values, say 1K, 2K, 4K, 8K each controlled by a GPIO pin, that at least would give you a chance of adding currents together (at least if you also put a diode in series with each resistor, so that a GPIO can only source a current, not sink it too). then you can adjust the flow through the base of the transistor, but that isn't enough. but its a beginning, and also you MUST add a diode over the motor, or stopping the motor will induce large negative voltages over the motor, which may blow the transistor and the GPIO's.

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: Is there a way to control motor speed without any chips

Wed Nov 18, 2015 11:20 pm

You could modify a servo for continuous rotation. Then you get speed and direction control from one GPIO, and no chips.

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Is there a way to control motor speed without any chips

Thu Nov 19, 2015 12:05 pm

ame wrote:You could modify a servo for continuous rotation. Then you get speed and direction control from one GPIO, and no chips.
You can also buy them pre-configured for continuous rotation.
Doug.
Building Management Systems Engineer.

Return to “Automation, sensing and robotics”