Author Topic: PIC16F1703 - can't overcome stall current of motor  (Read 1117 times)

0 Members and 1 Guest are viewing this topic.

Offline JoePTopic starter

  • Contributor
  • Posts: 37
  • Country: gb
PIC16F1703 - can't overcome stall current of motor
« on: December 08, 2018, 04:09:48 pm »
I'm trying to drive a small motor (around 20mA when spinning) directly from the output of a microcontroller. The datasheet says it can cope with 50mA, however when the motor is turned on, the pin output voltage is pulled down from 5V to under 1V, stopping the motor from getting started. I tried giving it a little nudge, and once it's spinning, the pic handles it fine, but it just struggles getting it going. Without having to introduce an H-bridge, how can I get the motor to start?
 

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 221
  • Country: au
Re: PIC16F1703 - can't overcome stall current of motor
« Reply #1 on: December 08, 2018, 10:50:03 pm »
You will probably find that while the no-load current of the motor spinning is 20mA, the stall current of the motor is likely to be much higher.
It sounds like the stall current, or at least the peak current required at startup to get the motor spinning is probably more in the order of 250mA or so.

Usually running loads like motors isn't a great idea directly off a micro's pins. LEDs etc are usually fine.

Might be an idea to try and run this using external mosfets, or an external motor driver chip, and use an o-scope across a current shunt resistor to see what kind of current peaks are required at startup.
 

Offline Nauris

  • Regular Contributor
  • *
  • Posts: 188
  • Country: fi
Re: PIC16F1703 - can't overcome stall current of motor
« Reply #2 on: December 09, 2018, 02:45:47 pm »
I'm trying to drive a small motor (around 20mA when spinning) directly from the output of a microcontroller. The datasheet says it can cope with 50mA, however when the motor is turned on, the pin output voltage is pulled down from 5V to under 1V, stopping the motor from getting started. I tried giving it a little nudge, and once it's spinning, the pic handles it fine, but it just struggles getting it going. Without having to introduce an H-bridge, how can I get the motor to start?

First try if it helps to put the pin in open-drain mode. (ie. Connect other end of motor to +5V and use the output pin to ground the other end). Usually nmos devices are stronger.
If that does not help, use two outputs pins in parallel (preferably in open drain mode)
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3238
  • Country: gb
Re: PIC16F1703 - can't overcome stall current of motor
« Reply #3 on: December 10, 2018, 10:51:48 pm »
Really not a good idea to drive inductive loads like motors directly from a port pin.
 
The following users thanked this post: Kilrah

Offline picandmix

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: PIC16F1703 - can't overcome stall current of motor
« Reply #4 on: December 12, 2018, 09:21:12 am »
Hi,

Just plain silly to try and drive a motor form a Pics port,  all you are likely to do is blow up the pic.

As with any "power" device, you never run things at their full output.  eg why don't you drive a car at maximum revs all the time ?

All thats needed is a simple transistor and resistor like this circuit, many similar circuits on the web; a flyback diode is needed as well, in not already fitted.

If you want to do more advance motor control then get one of the L298 modules for under £3.





« Last Edit: December 12, 2018, 11:28:40 am by picandmix »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf