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.

Controling the Speed of DC Motor Using PIC???

Status
Not open for further replies.

Ayne

New Member
I want to know that
How u guys control the speed of DC Motor in both side (Clock Wise & Anti Clock Wise) using PIC.
Supose i have variable resistor connected to ADC of a PIC for controlling speed and a button connected to a PORTD.1 for reversing the position of rotation.
Infact i want to drive four motors in different direction on different speed. Cheap and easy solution???
 
The methods you mention are merely inputs into the PIC so the PIC can read them and react however you wish (like adjusting the speed). So yes, those will work as inputs to the PIC to tell the PIC what to do.

But to actually control the motor you need to use an H-bridge. To control the speed of the motor you need to PWM the motor voltage. The particular inputs on the H-bridge that are active determines the direction the motor will spin. For on/off motor control with directon reversability, you just make the right H-bridge inputs actuve, but to control speed (rather than just on or off), you can PWM these inputs which will translate into a PWM signal for the motor voltage and will control motor speed. The PIC cannot drive the motor directly from it's pins since they cannot handle enough power so you need an H-bridge.

You could just always go out and buy an H-bridge from a online robotics store where it is controlled either by direct PWM signal from the PIC or by a serial signal.
 
Last edited:
if you Google H-bridges, you find out that at their simplest, they are just 4 transistors (with a diodes and a few other parts). You can buy them premade for pretty cheap (like the online robotics stores), or really expensive (from motor manufacturers), or you can build your own.
 
dknguyen is right for the most part. On the off chance that you have a bipolar power supply (+ and - terminals as well as ground), you could get away with two transistors per motor. Might be worth it since you want to control so many motors. However I would protect the PIC with optoisolators and be sure to use protection diodes on the transistors. A commercial H-bridge already has the diodes. (In one of my projects I'm using an H-bridge from www.tecel.com/d200/ . Not cheap but good!)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top