Society of Robots - Robot Forum

Software => Software => Topic started by: clone on January 27, 2009, 10:07:10 AM

Title: Help with PWM on ATMega168!
Post by: clone on January 27, 2009, 10:07:10 AM
OK so I'm using the arduino board with atmega168, and i basically just want to adjust the speed of a DC motor using a potentiometer and PWM.

How do i do this???!!
thanks
Title: Re: Help with PWM on ATMega168!
Post by: yerbie on January 27, 2009, 11:39:37 AM
Member Tutorials:
PWM on ATmega168: http://www.societyofrobots.com/member_tutorials/node/226
PWM Overview: http://www.societyofrobots.com/member_tutorials/node/228

Not sure how you would do it using a pot, but you can adjust the speed with just pwm
Title: Re: Help with PWM on ATMega168!
Post by: Webbot on January 28, 2009, 03:09:06 PM
Connect the pot to an ADC to give you a value from 0 to 255 and then use this to adjust the duty cycle of the PWM.
Title: Re: Help with PWM on ATMega168!
Post by: clone on January 29, 2009, 10:32:04 PM
im under the understanding that you cant have a DC motor hooked up directly to the arduino or it will have disasterous affects.. and also i watn to run the DC motor at 12 volts.. so what should i use as a 'motor driver'??
Title: Re: Help with PWM on ATMega168!
Post by: Webbot on January 29, 2009, 10:50:20 PM
You need to find the maximum (stall) current for your motor and then find a motor controller that can supply it. Hard to recommend any driver without knowing the current requirement.