Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Driving Motor Directly from PIC

Status
Not open for further replies.

PICMICRO

New Member
I am conceptualizing a tiny Humanoid_toy with light_tracking_head. I am thinking of using a tiny DC motor. The current drain by the motor will be under 20mA, so could be directly drived by the PIC pins.
Like, this
View attachment 62352
So, that I could easily drive it forward or Backward, (eliminating the need for H-Bridge.)
My concern is, How do I protect the PIC from back_emf_surges from the motor?
 
My concern is, How do I protect the PIC from back_emf_surges from the motor?

Simple...you don't drive the motor directly from the PIC. ;)

If there wasn't a need for external circuitry for a microcontroller to drive a motor we would never have used external drive circuitry in the first place.

Microcontrollers are designed as signal devices. They're not designed to direct drive inductive loads. They're designed merely to generate the control signals only.

Keep in mind that not everything you think is a new and innovative idea is. Some things were already tried and failed, and as such ended up in the scrap heap never to be heard of from the general public. There are just some things that common sense would tell you not to do and why no one does it.
 
Last edited:
For such small powers, won't the spikes be easily suppressed by the current limiting register (that I have shown), and the internal ESD protection diodes ?
 
For such small powers, won't the spikes be easily suppressed by the current limiting register (that I have shown), and the internal ESD protection diodes ?

ESD protection diodes are for Electro Static Discharge protection. Not flyback EMF from an inductive load.

Simply put...it's bad practice to drive an inductive load from a microcontroller of any sort unless the micro was in fact designed for that application, which PICs are not. It's bad practice...don't do it.
 
What happens If I do that? (Particularly which component will be at stress?). What is the limit of inductive load that could be driven by PIC pin.
I mean, since every load is slightly inductive (due to wires used to connect them), there has to be some Numerical limit for L and R for the PIC, not just "No, don't drive motors by PIC".
 
You'll almost certainly blow the PIC, and I'm extremely doubtful any motor only takes 20mA surge at start up.

Imagining a simple piece of straight wire has similar indictance to a DC motor is absolutely ludicrous.
 
What happens If I do that? (Particularly which component will be at stress?). What is the limit of inductive load that could be driven by PIC pin.

Apparently you didn't hear me when I stated that "Microcontrollers are designed as signal devices. They're not designed to direct drive inductive loads. They're designed merely to generate the control signals only."

I mean, since every load is slightly inductive (due to wires used to connect them), there has to be some Numerical limit for L and R for the PIC, not just "No, don't drive motors by PIC".

Not NEARLY as inductive as an inductor itself. Reference Nigel's post -

Nigel Goodwin said:
You'll almost certainly blow the PIC, and I'm extremely doubtful any motor only takes 20mA surge at start up.

Imagining a simple piece of straight wire has similar indictance to a DC motor is absolutely ludicrous.
 
Last edited:
Thanks for responses.
Ok, I take it that it won't be possible. But I am trying to get an academic answer.
My guess is,
When I say switch off (tri-state) a pin driving a motor, then the back-emf will keep the current flowing through the ESD diode and through the current limiting register.
So, there is the risk of blowing the ESD diode by this current ?
Or, are you concerned about the starting current ?
Please, bear in mind that, the motor I am trying to use is a tiny one, (the vibration motor off cell-phones)
 
Ugh...what part of DON'T DO IT do you not understand? If you're gonna go that far just use an H-bridge.
 
Ugh...what part of DON'T DO IT do you not understand? If you're gonna go that far just use an H-bridge.
I wanted a better explanation than -"Don't do it, it won't work / Don't do it, it will damage the PIC"
I wanted explanation along the following line --"The Back-Emf Generated by the inductor, will puncture the Insulation of the .... .... The ESD diodes wouldn't switch fast enough to prevent this / They will expire due to thermal over-run etc. "

Why use H-bridge ?
Because I can't find-out whether the circuit I proposed is safe or not?
Good enough reason, but let me try to find-out for few more hours.
 
If you want some numbers, let's assume the voltage-spike generated at switch-off is 1kV and the motor winding resistance is 10Ω (any of you guys think those figures unreasonable?). With only 100Ω in series with the motor the current through the PIC internal protection diode (let's say having 100Ω resistance too) could be ~ 5A in the absence of external protection diodes. AFAIK PIC protection diodes are rated for only a few mA, so the diode is likely to fail. With external protection diodes rated for 5A you might get away with it, providing they have a lower forward voltage drop than the PIC internal diode and hence pass the majority of the current. I wouldn't bank on it.
 
Last edited:
My suggestion is to try it. The chips are cheap enough. You will then be able to let us know your results. Try putting 2 outputs in parallel. Also put a 100n and 10u across the motor without any resistor.
After all, RB from Qld. Aust. drove an inductor from a PIC chip and he said it lasted for years!
 
After all, RB from Qld. Aust. drove an inductor from a PIC chip and he said it lasted for years!
The PIC or the inductor?:)
 
Why is the output of a pic any different to half a H bridge? True, it can't switch much current but it can easily handle 20mA. Doubling up outputs is a good idea.

The idea that a 20mA motor can produce a 1kV 5A (5kW) spike is ludicrous (post 14). Actually, that could be an idea for my over unity power plant. ;)

Mike.
 
If you want some numbers, let's assume the voltage-spike generated at switch-off is 1kV and the motor winding resistance is 10Ω (any of you guys think those figures unreasonable?). With only 100Ω in series with the motor the current through the PIC internal protection diode (let's say having 100Ω resistance too) could be ~ 5A in the absence of external protection diodes. AFAIK PIC protection diodes are rated for only a few mA, so the diode is likely to fail. With external protection diodes rated for 5A you might get away with it, providing they have a lower forward voltage drop than the PIC internal diode and hence pass the majority of the current. I wouldn't bank on it.

ludicrous.
Inductors don't act as current multipliers.

Whatever current was flowing through the 100 ohm diode will still flow when the PIC turns the transistor off, and the esd diodes internal to the PIC will dump the current stored in the motor's inductance back to the supply.
The internal diodes on that PIC could probably handle the total energy dumped through them but that's debatable... works for 2 minutes isn't the same as 2 years.
External diodes will be necessary.
Additionally due to the voltage drop of the PIC while driving the motor, once the pic turns off the motor is going to free spin down, it won't be rotating fast enough to dump current back to the battery through the diodes.


the question is can the PIC handle the current. probably, if two or more I/O pins were paralleled.
you'll also have to check the datasheet to see if it can handle the heat generated.
 
Whatever current was flowing through the 100 ohm diode will still flow when the PIC turns the transistor off
Quite. I was hoping someone would challenge the figures.:)
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top