Hi to all,
Iam working on dc motor interfacing with 16f877...The pins i used was PORTC 0 pin.Data which is send out is 1..i used a 5v relay in between the microcontroller and motor but the output from the microcontroller is 2.3 volts it doesnt drive the motor...
Probably the PIC can not drive the relais. You need an extra transistor to drive the relais. If its its a small DC motor you can also try a driver IC like the L293D.
Slorn
-- Dwengo... gets you started with microcontrollers!
thanx.. i will try L293d motor driver and get back to you....
one more thing is that whether we have to use two different power supply for motor and controller..iam using a 5v dc motor...
The dc motor will ask for a lot of current when it is switched on. When its not turning a DC motor is virtually a short circuit. If the supply can not deliver the current the voltage will drop. If it drops low enough your PIC will reset. And that's not what you want.
Two supplies would do the trick of course but you can also solve the problem by decoupling the controller and the motor with some capacitors.
Slorn
-- Dwengo... gets you started with microcontrollers!
When you turn on the motor it will probably ask for a lot of current. Motors are virtually short circuits when they are not turning. The current demand for current can make the voltage of the supply drop. If it drops to low your controller will reset.
You can of course solve this using two supplies but a good decoupling of the controller and the motor will also do the trick.
Slorn
-- Dwengo... gets you started with microcontrollers!