Controlling a DC Motor

Discussion in 'The Projects Forum' started by KansaiRobot, Jun 9, 2010.

  1. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    Hello Everybody.

    Finally I discard using brushless motors since I dont understand them. So I am going to use a DC Motor for my project. (sorry, in japanese)

    to do this I have several questions.

    1) First. I am thinking of using a chip with an h-bridge (Toshiba TA7257P)

    What are the advantages or disadvantages of using this as opposed to doing it myself with transistors and diodes??

    2) talking about simple circuits (not h-bridge) take a look at the attached picture

    2a) is R2 really necessary? i got some docs saying it is , other saying it isnt

    2b) is D2 necessary?

    2c) some book recommended putting a condenser in parallel to D1, but I wonder if that is a mistake of the book

    3) Talking about the circuit in 2 and also about the H-bridge (either the chip or the one built with transistors) since this motor is 6~12V, should I use an opto-coupler to separate the chip from the motor as I did in my previous project?

    btw, when the datasheet of the motor said 6~12V does that mean that I have to put 12V and only get the 6 V through PWM the signal from the microcontroller???

    Thank you very much for your help

  2. retched

    AAC Fanatic!

    Dec 5, 2009
    Ive done the same with plenty of women.. ;) Just kidding.


    The obvious space and component count savings using the IC opposed to discrete parts.

    You have more control with fewer parts, Also, If something goes wrong, you can troubleshoot or debug quicker with fewer components.

    I would say both are necessary.

    Back EMF from the motor will be suppressed by D1. this will keep the EMF from damaging other components and/or causing odd operation.

    And for R2, that will help also to shunt any excess current to ground that a blown diode or other over-current problems may cause.

    As for using the opto, If everything is in spec, It isnt a bad idea. It will isolate the control components from the motor, protecting it from feedback problems and back-EMF.

    Basically all these are doing the same thing. Thats why some books have them and some dont. How much you want to protect the other components.

    If you are dealing with a larger motor, more EMF is produced, so more protection is needed.
    KansaiRobot likes this.
  3. R!f@@

    AAC Fanatic!

    Apr 2, 2009
    I don't kid.
  4. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    Yesterday I started trying circuits for the motor (in the figure). The motor can only work in the ranges of 6v to 12V. I am very confused so I would appreciate any help.

    As transistor I used Fairchild 2N3904.

    Diodes were 1N4004

    I tried no R2. And for R1 I tried the following and I got the following voltage accross the motor whe applying 12V (not 5V) to the base

    Code ( (Unknown Language)):
    1. R1     Voltage across the motor   Current accross the motor   current in the base
    2. 82K     0.1 V                                  0.02A                               0.0524mA
    3. 27K     0.6V                                                                           0.16mA
    4. 4K       1.35V                               0.1A                                  1mA
    5. 1K       2.5V                                 0.18A                              7mA
    6. 520     3V                                   0.23A                                8mA
    7. 100      9.5V                              0.16A                                56mA
    obviusly i could only move the robot with the 100 Ω resistor.

    Now ok, I moved it but I am worried since I have to control the robot with all kinds of voltages from 6v to 12V. And also i have to control it with a microcontroller (providing only 5V)

    my question is how can I increase the voltage passing through the motor? So far the only thing I have tried was changing the R1 resistor. Can someone enlighten me?


    P.S. i can understand Ohms law for transistors. Somewhere I read that the voltage E-C is always 1.6V. but that is not the case of course. if this were true no matter what the current in the base the voltage in the collector would be the same and it is not like this. Can someone explain this to me???

    Thanks a lot
  5. Bernard

    AAC Fanatic!

    Aug 7, 2008
    Your measured values do not look normal, & 2N2904 is probabily not happy with 110 mA base current. Might use a higher rated transistor, 1 or 2A collector I, with good gain at 1/4 A.
    What does motor draw at 12V under load?
  6. nikomaster

    New Member

    Nov 24, 2007

    I suggest optocoupler triggered using small transistors. It's easier and you will save your microcontroller from high currents.
  7. Bernard

    AAC Fanatic!

    Aug 7, 2008
    The chip would be much simpler, no learning curve required.
    2a no, depends on controller, low out should be near ground, not floating.
    2b no
    2c no
    3 no
    3b best operation with 6 to 12 V, 6v is not a limit, 0 to 12V OK
  8. Audioguru

    New Member

    Dec 20, 2007
    The datasheet for the 2N3904 shows that its max allowed current is only 200mA and it performs poorly above only 100mA. Its max allowed base current is about 20mA.

    A 2N4401 transistor has a max allowed current of 600mA and should replace the 2N3904.

    A DC electric motor has a low running current. Its current is much higher when it starts, when it works hard and when it is stalled.