Home › Forums › Microcontrollers › PIC Microcontroller › Unexpected behaviour of 12V DC Motor with PIC Microcontroller
Tagged: 16F877A, DC Motor, microcontroller, PIC
- This topic has 6 replies, 2 voices, and was last updated 9 years ago by George Mathew.
-
AuthorPosts
-
December 17, 2015 at 5:53 pm #11921George MathewParticipant
Dear Sir,
I am trying to make a robotic car with two 12V dc motors(30 rpm) and an L293D and using PIC16F877A.
My problem is that when motors are disconnected,The voltage levels on on the output of L293D (already connected its inputs to outputs of PIC) is changing as per the sequence in the Program. But Once the motors are connected, The sequence sometimes change,may not change and may sometime stay constant and voltage levels not changing according to program.
For eg if ‘1’ ‘0’ is the condition for motor to rotate in anticlock wise direction.and suppose we change it to ‘0’ and ‘1’,If the motors are not connected,the program is working fine and output is behaving properly else not.
Actually what is the problem,Is there any solution??
December 17, 2015 at 6:26 pm #11922Ligo GeorgeKeymasterHi,
Your problem seems to be with Power Supply. Hope you are using same power supply for powering DC Motor and PIC Microcontroller. There will be a sudden drop in the supply voltage when the motor is powered, this will reset the microcontroller and program starts from the beginning again and again.
Try the following,
- Use separate 12V and 5V power supplies.
- Make sure that every components used in the circuit is able to provide peak current required during motor switching
- Increase the capacitance of both 12V and 5V rail. Eg : Put 1000µF for 12V and 100µF for 5V. Add 0.1uF near each ICs.
December 18, 2015 at 8:08 am #11924Ligo GeorgeKeymasterPlease let me know whether the problem is solved or not.
December 18, 2015 at 11:00 am #11925George MathewParticipantThank you for your response sir…
As you said,I am using a 12V common power supply.By using a 7805 regulator,it is cut down to 5V and is supplied to PIC board section and IC supply voltage .
For 12V pin (Vs) in L293D,It is taken in parallel from 12V dc power in the board and there is no connection with PIC section.then how this will happen??
Also Is capacitances necessary??
Rgds,
George
December 18, 2015 at 12:20 pm #11926George MathewParticipantchecked with seperate power supply also……but no result.
December 18, 2015 at 12:23 pm #11927Ligo GeorgeKeymasterRipples in the 12V rail will be coupled to 5V rail also and DON’T FORGET to make ground common when you are using separate power supplies.
December 19, 2015 at 11:11 am #11928George MathewParticipantDear Sir,
I connected power supply like that only.Ground was common. But that was not the problem.I connected back the supply as earlier in parallel.
As you said, problem was that ripples.When I connected a 1000uf(25V) capacitor in parallel with Vs Pin(12V) and the Ground pin of L293D, the problem was solved.
Thanks for your support.
Rgds,
George
-
AuthorPosts
- You must be logged in to reply to this topic.