1
\$\begingroup\$

I have 9v DC motor that I want to use to lock a door. Control is achieved using an esp8266 board. The esp8266 also switches the direction of rotation via an H bridge. So far, so good..

Now I want to detect the stall at each end of the motor travel. Initially Im trying to do this without the H bridge, just for simplicity.

There is a good amount of info about the subject out there, but Im afraid my electronics knowledge is poor and thus far I havnt been able to get anything to work. My approach has been to use a .1 ohm sense resistor with an lm311 as in this circuit below. The supply is an adafruit variable voltage module delivering 9v and Ive tried a number of different pullup resistors. Im afraid I just dont understand enough to work this out. Regardless of the R pullup value.. 1,5,10 K and even without it, the output seems to wobble arounf 1.8v setteling down to about .9v. When the motor is stalled I detect no change at all in the output.

enter image description here

In an ideal world, I would get I nice 3.3v on the output when the motor stalls so that I can deal with it in software. Id be grateful for help. Thanks

\$\endgroup\$
  • 1
    \$\begingroup\$ Does the voltage across the resistor reach the threshold of the comparator? \$\endgroup\$ – Ignacio Vazquez-Abrams May 2 '16 at 22:18
  • \$\begingroup\$ You're on the right track and are pretty close, the problem is that comparators don't tend to need much of a voltage difference to switch (how much voltage difference is needed is called 'hysteresis'). If you can, I'd get an extra opamp and wire it as a differential amplifier, that will give you the voltage across the resistor (most comparators don't work when the inputs are at the supply rails), then the output from your opamp feeds one leg of the comparator and a voltage divider feeds the other (changing the divider will change the current limit) \$\endgroup\$ – Sam May 2 '16 at 23:52
  • \$\begingroup\$ @tom.. Thanks for the suggestion, Im afraid I just dont know enough electronics to make use of it :( For now I think Ill get my hands on a LT6106 as Andy suggests. Looks more like my understanding level. Although at £2.60 its almost the same price as the esp8266 board lol \$\endgroup\$ – Horza May 4 '16 at 10:08
  • \$\begingroup\$ Yeah, that's the catch, those fancy current sense opamps aren't cheap, there may be some cheaper ones, but you'd be hard pressed to find something similar for less than 1.50 or so. You'll still need to feed the output to a comparator, but it'll just be LT6106 on the (-) terminal and a variable resistor holding the (+) somewhere between the supply voltage and ground, that way you can change the current limit on the fly \$\endgroup\$ – Sam May 5 '16 at 0:30
1
\$\begingroup\$

There are a couple of problems here.

Firstly, you are connecting an input to the positive supply rail (pin 3 -Vin) - this won't work - the LM311 isn't a rail-to-rail device and if you were powering from (say) +15V the data sheet tells you that the usable input range is up to 13.8 volts.

Given that your top supply is +24V you must not assume that inputs can be taken as high or higher than 22.8 volts.

Next, you really need to engineer a solution that allows the voltages on the two inputs to cross each other - this guarantees switching operation on the output. Unfortunately you have -Vin always set to a voltage that +Vin can only aspire to reach.

What you probably want is a high-side current monitor. If I remember correctly Linear Technology make some: -

enter image description here

Maxim have a few options: -

enter image description here

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.