One pin dc motor control, not sure if idea feasible

This is a special forum devoted to educators using Adafruit and Arduino products for teaching.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
pmidthun
 
Posts: 10
Joined: Fri Jul 24, 2015 10:23 am

One pin dc motor control, not sure if idea feasible

Post by pmidthun »

Hello from the Science Museum of Minnesota.

Due to cost restrictions I am trying/hoping to run two DC motors, forward and reverse only, safely off of one Gemma for a project like this: https://www.youtube.com/watch?v=F4y79PmGUXM

High pin state=forward, Low pin state=reverse. See attached jpeg for (shoddy) circuit diagram.

-Is this feasible?

-In particular I'm concerned about the lack of safety diode in parallel to the motor...is there a way diodes are typically incorporated with DC motors and H-bridges to prevent damage to the pin in arduino setups?

-If not, since the motor is tied to legs rather than wheels, is it likely it could survive without a safety diode across the motor?

-Will this circuit work with two JFETs and two MOSFETS/Transistors tied to one pin? If not, can it be run off of one trinket with two pins to each motor?

Thanks

Image

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: One pin dc motor control, not sure if idea feasible

Post by adafruit_support_bill »

There are lots of circuit designs on the web for H-bridges. This one is pretty well explained: http://www.modularcircuits.com/blog/art ... he-basics/

You might also consider something like this: https://www.pololu.com/product/2511
It will control 2 motors and uses one pin each for direction and one for speed. If you don't need speed control, just tie the speed pin high. All the necessary protection diodes are built into the bridge chip.

User avatar
pmidthun
 
Posts: 10
Joined: Fri Jul 24, 2015 10:23 am

Re: One pin dc motor control, not sure if idea feasible

Post by pmidthun »

Thank you for your fast and helpful response. I have only one more concern:

I am still curious about running four transistors/FETs off of one pin. Is this reasonable/common? If so, will it require a different type of transistor/FET because they are all running off of one pin?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: One pin dc motor control, not sure if idea feasible

Post by adafruit_support_bill »

The gate current for the FETs is miniscule and well within the capabilities of the GPIO pin.

User avatar
pmidthun
 
Posts: 10
Joined: Fri Jul 24, 2015 10:23 am

Re: One pin dc motor control, not sure if idea feasible

Post by pmidthun »

Thank you so much for your help.

User avatar
pmidthun
 
Posts: 10
Joined: Fri Jul 24, 2015 10:23 am

Re: One pin dc motor control, not sure if idea feasible

Post by pmidthun »

I had to sideline this project for a while, but I'm back. I ordered the suggested part; however, in the meantime I'm confused about why my circuit won't work. I have tried the attached circuit with a variety of resistors between D1 and the transistor base pin with no success. BUT it will work when I connect 3Vo or Vout directly to the base, not when I try to run it off of the pin.

Image

Motor: I don't know the specs on the motor but it is intended to run on 1.5 volts
Transistor specs: http://www.onsemi.com/pub_link/Collater ... 222A-D.PDF

Code:

int SENSOR = 0; // This ties port 0 to the variable SENSOR to help us read the code more easily

void setup() { // the setup routine runs once when you press reset:
pinMode(1, OUTPUT); // initialize the LED pin (D1) as an output.
pinMode(2, OUTPUT); // initialize the D2 pin as an output
pinMode(SENSOR, INPUT); // initialize the SENSOR pin as an input. //
// digitalWrite(SENSOR, HIGH); // ...with a pullup (Not sure why we need this, but we do)
}

void loop() { // This runs forever over and over again
digitalWrite(1, HIGH);
delay(5000); // then wait one second
digitalWrite(1, LOW);
delay(5000); }

Locked
Please be positive and constructive with your questions and comments.

Return to “For Educators”