Arduino Forum

Topics => Robotics => Topic started by: TwinkleToes on Aug 05, 2018, 10:55 pm

Title: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 05, 2018, 10:55 pm
Hey everyone,
I am building a controller that needs to drive two 12V dc motors (2A) independently of each other. I am looking for the best Shield/drivers to do this. Are there any suggestions? I am new to this and could really use the help.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: groundFungus on Aug 05, 2018, 11:49 pm
Is 2A the "running" current or the stall current?  The rated voltage and stall current are specifications that are important when choosing a drivers.

Some Pololu motor drivers. (https://www.pololu.com/category/11/brushed-dc-motor-drivers)
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 06, 2018, 12:54 am
Ok so the two different motors I am attempting to run are linked below. I am new to this and don't know exactly how to tell. I assume it is the running Amps though.

https://www.amazon.com/gp/product/B0791YL351/ref=oh_aui_detailpage_o09_s00?ie=UTF8&psc=1

https://www.ebay.com/itm/Dual-Head-BPT-Tube-Lab-Dosing-Micro-Self-priming-Peristaltic-Liquid-Pump/362164888278?ssPageName=STRK%3AMEBIDX%3AIT&var=631375460094&_trksid=p2057872.m2749.l2649


If you could help me I would really appreciate it.

Someone on another forum reccommended this type of driver

https://www.amazon.com/gp/product/B01M29YK5U/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: groundFungus on Aug 06, 2018, 01:17 am
The L298 motor driver is ancient and inefficient technology.  They drop 2 to 4 volts and dissipate the power as heat.  If your motor supply is 12V, the best that the motor will see is 10V, probably less.  Modern motor drivers use MODFETs on the output and drop very little voltage and therefore waste much less power.

Do the pump motors need to run in reverse or only in one direction?  If they run in one direction the driver is much simpler.   A logic level MOSFET rated for the stall current is a simple driver.   The flyback diode is necessary to protect the MOSFET from high voltage when the motor shuts off.

(http://forum.arduino.cc/index.php?action=dlattach;topic=561930.0;attach=269114)

Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 06, 2018, 01:21 am
They only need to run one way.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: groundFungus on Aug 06, 2018, 01:28 am
I was working on inserting the driver schematic when you replied.   I asked the seller for the stall current.  Hopefully he knows.  If not, we can estimate the stall (starting) current by measuring the winding resistance.   Do you have the motors?  Do you have a multimeter to measure Ohms?
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 06, 2018, 01:47 am
I have a generic voltmeter I could use. And thank you so much for helping! This is looking promising.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: groundFungus on Aug 06, 2018, 01:53 am
Measure the resistance between the positive lead and the negative lead of the motor power.  The stall (starting) current is the rated voltage (12V) divided by the measured resistance.  For instance, if the resistance is 2 Ohms:  12V / 2 Ohms would be 6 Amps.  When measuring low resistance, short the test leads together and measure the test lead resistance.  Then measure the winding resistance and subtract the measured test lead resistance to get a true(er) winding resistance measurement.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 06, 2018, 01:56 am
Ok I will measure it now. I will need to find the meter so I may not reply today.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 06, 2018, 02:03 am
Here is what it says I'm not sure if I did it right though.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: jremington on Aug 06, 2018, 02:39 am
Put the meter on the X10 scale, and make sure that the meter is properly zeroed (connect the multimeter leads together).

Ohms are read right to left off the green scale.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 06, 2018, 03:52 am
This is what I got after touching leads and having it on X10
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: groundFungus on Aug 06, 2018, 03:29 pm
This takes me back, I haven't used an analog meter for, well, a while.

Quote
This is what I got after touching leads
To zero the meter you hold the leads together and physically adjust the meter to read 0 Ohms.   Carefully adjust the screw in the yellow box till the needle lines up with 0 Ohms.  Then, please post a new reading.

(https://forum.arduino.cc/index.php?action=dlattach;topic=561930.0;attach=269200)

Title: Re: driving 2 12v 2A DC motors with Mega
Post by: jremington on Aug 06, 2018, 05:43 pm
The zero adjust screw on the front, at the base of the pointer is for zero Volts, not Ohms!

Most meters of that type also have a zero adjust thumb wheel for Ohms, as zero is the other end of the scale. You have to adjust both.

Instructions on meter reading. (https://www.electronics-notes.com/articles/test-methods/meters/multimeter-resistance-measurement.php)
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: groundFungus on Aug 06, 2018, 05:52 pm
Sorry, like I said it has been a (long) while since I used an analog meter and I do now remember the Ohms adjust.  

(http://forum.arduino.cc/index.php?action=dlattach;topic=561930.0;attach=269226)
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 06, 2018, 07:08 pm
Ok so I put it on X10 and adjusted the meter. and this is the reading that I got.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: jremington on Aug 06, 2018, 07:40 pm
Did you follow the instructions to zero both ends of the scale first?

What is your interpretation of the indicated value?
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 06, 2018, 08:42 pm
yes I zeroed in both ends of the scale. it seems like it is 1.8 ohms.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: jremington on Aug 06, 2018, 09:24 pm
1.8 Ohms sounds reasonable, in which case the start/stall current, operating from a 12V supply, would be around 6.7 Amps. A 10 Amp motor driver should work.

Or, follow this tutorial for a MOSFET driver http://bildr.org/2012/03/rfp30n06le-arduino/

Contrary to the advice given in that tutorial, you should use a logic level MOSFET, like the one recommended.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 07, 2018, 12:14 am
1.8 Ohms sounds reasonable, in which case the start/stall current, operating from a 12V supply, would be around 6.7 Amps. A 10 Amp motor driver should work.

Or, follow this tutorial for a MOSFET driver http://bildr.org/2012/03/rfp30n06le-arduino/

Contrary to the advice given in that tutorial, you should use a logic level MOSFET, like the one recommended.
Ok so the tutorial makes good sense and all. Now On one of the motors I need to be able to connect the Optical sensor to the Single-head pump. This is what will controll on/off. So I would need to run the sensor in-line with the mosfet between the gate and the arduino?
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: groundFungus on Aug 07, 2018, 01:10 am
Quote
Optical sensor to the Single-head pump
What optical sensor?  I see no optical sensor in any of the links.

Is this a sensor that counts motor rotations or something else? 

There are many types of "optical sensor".  We need more information about your sensor.  What is the sensor sensing?

Quote
So I would need to run the sensor in-line with the mosfet between the gate and the arduino?
No, you would connect the sensor to the Arduino, read the sensor with the Arduino and control the motor based on the data from the sensor and some rule(s).
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 07, 2018, 08:01 pm
So the sensor can be found at this link. And if I understand correctly I attach that separately to the Arduino and use the Arduino to read the optical sensor and then based on the reading of the sensor the Arduino talks to the motor?

https://www.amazon.com/Optical-Infrared-Sensibility-Controller-Marinecolor/dp/B00Z9NUJWW/ref=pd_nav_hcs_rp_t_1?_encoding=UTF8&psc=1&refRID=5TAZMG4NSD6FTGK8DA06
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: groundFungus on Aug 07, 2018, 08:20 pm
Quote
And if I understand correctly I attach that separately to the Arduino and use the Arduino to read the optical sensor and then based on the reading of the sensor the Arduino talks to the motor?
That is right.

Have you connected the sensor and can you read it?
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 08, 2018, 12:34 am
I really don't have any idea how to properly connect the sensor. The 4 wires are all different. This is why am looking for advice on here. I honestly know nothing about how all of this is supposed to work.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: jremington on Aug 08, 2018, 01:20 am
For wiring and usage instructions, consult the technical or user manual that comes with the sensor.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 08, 2018, 01:45 am
Part of the issue is that I have contacted the manufacturer and they haven't gotten back with the wiring diagram or anything
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: jremington on Aug 08, 2018, 01:51 am
I buy only sensors that come with technical data and instructions.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: groundFungus on Aug 08, 2018, 03:31 am
I think that the sensor is wired like this:

(http://forum.arduino.cc/index.php?action=dlattach;topic=561930.0;attach=269451)

Google "Optical Infrared Water Liquid Level Sensor " and this is a common 4 wire diagram.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: BanditDave on Aug 08, 2018, 08:08 am
yes I zeroed in both ends of the scale. it seems like it is 1.8 ohms.
It's been a very long time since I used an analog meter BUT

On the X10 range that would be 18 ohms
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 08, 2018, 07:03 pm
I think that the sensor is wired like this:

(http://forum.arduino.cc/index.php?action=dlattach;topic=561930.0;attach=269451)

Google "Optical Infrared Water Liquid Level Sensor " and this is a common 4 wire diagram.
Wouldn't that mean that I would need some resistors off the yellow and red wires before going to ground? Im new to reading schematics and the like.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: groundFungus on Aug 08, 2018, 07:15 pm
Yes.  Blue wire and white wire to +5V.   Red wire to one end of 390 Ohm resistor.  Other end of resistor to ground.  The yellow wire to one end of 4.7K resistor.  The junction of the yellow wire and 4.7K resistor to a digital input.  Other end of resistor to ground.  The resistor values are not critical.  One value higher or lower will still work.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 09, 2018, 01:22 am
So if I understand correctly the sensor would be connected in a similar manner to what I have diagramed in the attached image? the wheel will stand in as the sensor. I think that the only modification would be grounding the circuit to the Arduino and powering the + rail with the Arduino.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 24, 2018, 02:41 am
I still need help understanding how to add in the transistor... I currently have the part #LM7805 however, I can not find anything telling me if this is a PNP or an NPN configuration. Is there any way to tell?
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: groundFungus on Aug 24, 2018, 03:45 am
LM7805 is a voltage regulator, not a transistor.  An LM7805 cannot be used in place of a transistor.
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: TwinkleToes on Aug 24, 2018, 03:59 am
LM7805 is a voltage regulator, not a transistor.  An LM7805 cannot be used in place of a transistor.
What part would you recommend that I use?
Title: Re: driving 2 12v 2A DC motors with Mega
Post by: nielyay on Aug 27, 2018, 07:05 pm
Hi,
Quote
two 12V dc motors (2A) independently of each other. I am looking for the best Shield/drivers to do this.
i suggest you to use adafruit motor shield v2
https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/overview
its have 3 L293D IC motor driver, you can controlled 4 DC motor with 12V and 2A of each motor supply.