100mA 12V Motor Current Monitor

Discussion in 'The Projects Forum' started by GioD, Sep 18, 2009.

  1. GioD

    Thread Starter Active Member

    Mar 20, 2009
    30
    0
    Hi to all,
    I'm designing a motor driver circuit. The H-bridge is already ok. I want now to stop the motor if it’s current reach 100mA. So, I’m thinking about a circuit that sense the 100mA and send a signal to the 5V microcontroller. I’m searching for a simple circuit, with 1 transistor that amplifies the shunt voltage of a resistor. I don’t need a lot of precision. I don’t want to use opamp.

    Any idea ?
     
  2. JDT

    Well-Known Member

    Feb 12, 2009
    658
    85
    Because you are using an H bridge, the motor current can go both ways. The usual solution is to connect the sources of the bottom two transistors together and connect these to ground through a low-value current measuring resistor. No matter wich way the motor is going, the current through this resistor is always same direction.

    For example you could make this resistor 2 ohm. At 100mA there will be 0.2V drop. Feed this into a comparator that switches at this value. The output of the comparator goes to your micro-controller.
     
  3. GioD

    Thread Starter Active Member

    Mar 20, 2009
    30
    0
    Yes I have already think to make a single resistor.
    The issue is about the voltage amplification of R shunt. I don't have the AD converter, I need a 5V signal or a open collector, when the current go over 100mA.



     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    That is what a comparator will do for you.
    Take a look at an LM339 quad comparator or LM2903 dual comparator.
    Datasheets are available at http://www.national.com
     
  5. GioD

    Thread Starter Active Member

    Mar 20, 2009
    30
    0
    I know opamp, and is easy to do this with them. My need is to build the circuit with a transistor.
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    This is starting to sound like a homework assignment.

    Is it?
     
  7. GioD

    Thread Starter Active Member

    Mar 20, 2009
    30
    0
    This is the project need that I have in my circuit.
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    That doesn't quite answer my question, so I'll re-state it.

    Was your project assigned to you by a teacher, instructor or professor as part of a course/class requirement?
     
  9. GioD

    Thread Starter Active Member

    Mar 20, 2009
    30
    0
    No, this project is about my work.
     
  10. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    OK.
    Well, you could use just a single transistor, but it will be very inefficient.

    Use a 6.2 Ohm resistor from the bottom of the H-bridge to ground.
    Connect the high side of the 6.2 Ohm resistor using a 100 Ohm resistor to the base of an NPN small signal transistor, like a 2N3904.
    Connect the transistor's emitter to ground.
    Connect the collector to Vcc using a 4.7k transistor.
    When current through the 6.2 Ohm resistor exceeds about 100mA, the transistor will turn on, causing Vce to decrease.
     
  11. russ_hensel

    Well-Known Member

    Jan 11, 2009
    818
    47
    Op amps are so cheap and simple that avoiding them for a one off circuit is not worth the bother.
     
  12. GioD

    Thread Starter Active Member

    Mar 20, 2009
    30
    0
    I'm agree with you, russ. But I don't have space on the board and the application is very low power. Every uA is important. If I use an opamp I have to power off it. And the precision isn't important.
     
  13. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well, the single transistor suggestion I gave you will waste 62mW via the 6.2 Ohm resistor when the motor is running at 100%. Keep that in mind.
     
  14. GioD

    Thread Starter Active Member

    Mar 20, 2009
    30
    0
    Right, but the motor run only few second a day. An opamp waste power 24h/day. I already do some calculation, in my application the problem is to reduce the continuous (24H/day) current. The momentary current consumption isn’t a problem.
    The issues of the circuit that you suggest, is the value of the Rshut that cause a 0,62V loss in motor voltage. I have to verify this.
    And I have to test also the precision and repetitiveness.
     
  15. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    They make pretty tiny OpAmps these days.
     
  16. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You could use something like a LMC6762 dual micropower comparator. It has push-pull outputs, which wouldn't require a pullup resistor on the output. 10uA current draw max per channel. You could power it using a uC pin set high. Set the pin low before putting the uC to sleep.

    You could then use a 0.5 Ohm or less resistor to sense motor current. You'd still need a couple of resistors to use as a voltage divider. That could also be powered by the uC output pin.
     
  17. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
  18. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,170
    395
    What neat little comparators, Sgt.I've got to have some.
     
  19. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
  20. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Roman,
    Ran your circuit in simulation; it didn't perform very well. Using a 2N5088 helped, but I was not able to get a reasonably accurate window.

    Adding the load of the LED and current limiting resistor really throws things out of whack.

    I've attached a simulation that shows your basic circuit, plus another using a channel from an LM339 comparator.
    The b and a 'scope markers correspond to 95mA and 105mA through R1, respectively.
    Much of the time, the output from your circuit is at an indeterminate voltage level for TTL or CMOS.
     
Loading...