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.
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