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.

DC Motor help

Status
Not open for further replies.

versimilitude

New Member
Hi all,

I'm looking for some help with a simple circuit i'm trying to build.

I'm trying to control the below DC motor using a PIC (16F870). I am not interested in controlling speed, just simply turning it on and off. I have set the circuit below up and it works except for the fact that when the motor turns on the LEDs start to flicker. Eventually I intend to swap other things in for the LEDs but want to get the circtui right first.

I'm guessing the motor is causing interference somewhere but i'm not sure how to stop this. Can anybody make a suggestion?

Thanks in advance for your help :)

Motor: https://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=454-0849
 

Attachments

  • Show Circuit.jpg
    Show Circuit.jpg
    96.7 KB · Views: 193
You will probably want to wait for a reply from someone who actually knows what they are talking about, but it struck me that perhaps moving the LEDs closer to the power supply, or using a bigger power supply capable of handling the power drain might help...
 
Where is your circuit getting power from?

The way it is drawn makes it look as though the 12V is generated from the 5V through the regulator. That is possible, using a boost regulator (https://en.wikipedia.org/wiki/Boost_converter) but it is unusual.

The more normal thing to do is to produce the 12V from a battery or transformer, and regulate down to 5V from that. That is much easier. In your circuit the 12V does not need to be accurately regulated as it will only affect the motor speed and LED brightness a bit.

I think that your 12V line is not at 12V, and particularly when the motor is on, the voltage is so low that the LEDs don't have enough voltage to run.
 
The 12V comes from a battery and the regulator brings it down to 5V. I realise that it looks a bit funny in the drawing.

I have put the multimeter across the battery and it is at 12V.
 
As you are running the 5V supply in a conventional way, I can't see what would make the LEDs flicker.

However, motors can be very noisy, so I would look at your layout and capacitors sizes. You should always have ceramic capacitors close to the PIC. It could be useful to feed the regulator through a diode, and add a big capacitor to ground after the diode. That will let the regulator ride dips in power caused by the motor.
 
Please describe your 12V battery. How much current can it deliver?

Your motor might require 5A or more when it first starts.

As I understand it, you have no indication that the PIC is being bothered by the motor, it's just the LEDs, correct? If that's the case, then a huge capacitor on 12V might help.

Your MOSFETs have logic-level gates, correct?
 
If motor can handle it, I would run it off the unreg 12v side.
 
You drew P-channel Mosfets that are upside-down and backwards.
Your LEDs are also upside-down. Very confusing.

If you use N-channel Mosfets then their max gate voltage from the PIC is only 5V but most Mosfets need 10V on the gate to turn on fully.
 
Thanks everyone for the replies.

Firstly, I'll apologise for my poor diagram. I drew it in a hurry and now looking back can see all the errors! oops.

I'll try putting a big capacitor on the supply a shot to see if that will help.

At present it now seems to be working properly. I added a resistor on the line into the motor controller transistor and this seems to make a difference. But i'd like to make it as robust as possible so will try some of the other suggestions as well.

Diver300 mentioned having capacitors as close to the PIC as possible. Do you mean the capacitors from the power supply or do you mean adding new capacitors?
 
Once again, thanks to everyone for their help above.

I managed to get the circuit working well from my battery but wanted to change it to run from a mains supply.

I bought a 2.5A variable 0 - 15V volt supply.

But this is causing me more problems. The circuit works until I swithc the motor on. It then runs for around 20 secs before just cutting out and the PIC resetting. This happens anytime I try it.

Any ideas why this happens and what I can do about it?

I have attached an updated version of my circuit since the last one was rubbish :)
 

Attachments

  • Show Circuit2.jpg
    Show Circuit2.jpg
    79.6 KB · Views: 147
Excuse my ignorance but 'overloading' in what way?

I have checked the current of the motor and when running it's roughly 0.5A while the supply is rated at 2.5A. The motor runs fine at this current for around 30 seconds before simply cutting out.
 
Maybe your new 2.5A power supply is sensing the peak current pulses of the motor, instead of the lower average current that you measured.
Maybe the power supply is defective so that it cannot supply 500mA continuously.
Then its voltage drops.
 
Ok, i'll try a higher rated supply. Thanks!

I have tried the motor onto the supply directly though and this works fine which kind of suggests that it's not the supply?
 
The circuit pulses power to the motor. Then the peak current is much higher than if the motor is connected all the time. Maybe that is why the power supply fails.

The big capacitor across the power supply will provide the peak current and the power supply will provide the average current.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top