Pages: [1]   Go Down
Author Topic: DC Motor Speed Variation  (Read 1247 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
This is my first post on the forum. I am currently building a self balancing robot. I am new to robotics and have brought a USB arduino clone. I am still to go to the sensors stage but I am working out the basics. Using the arduino I have managed to run 2 dc Motors using an L293D HBridge IC and have managed to reverse the direction of rotation using a switch. Can somebody guide me on how to proceed to control the speed of the DC motors using my arduino (the motors are 12V and around 100rpm). My initial guess is that this will be done by PWM but I am not sure how to proceed with the hardware circuitry and the programming of the code. I want to control the speed of the motor and not just forward, reverse, and stop. How can it be done using a breadboard and a setup similar to the one used in making them run with an L293D?    http://itp.nyu.edu/physcomp/Labs/DCMotorControl

I tried learning from the fading led sketch but was unsuccessful since the led simply lit up and lit off at a particular potentiometer value. Any one know why this is happening?
Logged

UK
Offline Offline
Faraday Member
**
Karma: 17
Posts: 2884
Gorm deficient
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I tried learning from the fading led sketch but was unsuccessful since the led simply lit up and lit off at a particular potentiometer value
Maybe your pot had a dirty track.
Debug prints are useful in situations like these.
Logged

Per Arduino ad Astra

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks i will try that !!!! any idea about how i can control a dc motor speed with a pot?
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 5610
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks i will try that !!!! any idea about how i can control a dc motor speed with a pot?

Feed the PWM output of the Arduino to the enable pin for the motor on the L293:

http://www.kmitl.ac.th/~kswichit/c52robot/c52robot.htm
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Pages: [1]   Go Up
Jump to: