:Problem with controlling 2 3V DC Motors with L298N
hi! trying power set of wheels rc car bought, attached below. each of motors requires 3v.
i'm powering arduino , l298n 9v battery , connector, attached below.
i have wire going 5v on l298n 5v on arduino , ground ground. have pins in3 , 4 on l298n going digital pins 7 , 8 on arduino , enb going pin 9 pwm.
i plugged wires coming motors out 3 , 4 , plugged in 9v battery arduino test power , seemed work fine.
i uploaded code:
my motor makes whining sound assume means isn't receiving enough power or rate set pwm @ high. tried going down 50 didn't anything.
i tried switch wire going 5v 5v (l298n arduino) 12v vin didn't fix problem either.
i'm powering arduino , l298n 9v battery , connector, attached below.
i have wire going 5v on l298n 5v on arduino , ground ground. have pins in3 , 4 on l298n going digital pins 7 , 8 on arduino , enb going pin 9 pwm.
i plugged wires coming motors out 3 , 4 , plugged in 9v battery arduino test power , seemed work fine.
i uploaded code:
code: [select]
void setup(){
pinmode(7, output);
pinmode(8, output);
pinmode(9, output);
}
void loop(){
digitalwrite(8, low);
digitalwrite(7, high);
analogwrite(9, 100);
delay(1000);
digitalwrite(8, high);
digitalwrite(7, low);
}
my motor makes whining sound assume means isn't receiving enough power or rate set pwm @ high. tried going down 50 didn't anything.
i tried switch wire going 5v 5v (l298n arduino) 12v vin didn't fix problem either.
my motor makes whining sound assume means isn't receiving enough power or rate set pwm @ high. tried going down 50 didn't anything.hmm, if want giving more power should setting number higher. starting @ 0 duty cycle 100 percent duty cycle @ analogwrite(pin,255).
if didn't move analogwrite(9,100) sure beans won't move analogwrite(9,50). try higher duty cycle.
the whine hearing pwm frequency (500hz). frequency same regardless of duty cycle, fact hear whine means switching working.
those 9v square batteries pretty useless powering motors. make sure have power source can handle current.
Arduino Forum > Using Arduino > Motors, Mechanics, and Power (Moderator: fabioc84) > :Problem with controlling 2 3V DC Motors with L298N
arduino
Comments
Post a Comment