user77997: I've got a circuit with Arduino UNO Rev3, DC motor, button to switch direction of rotation and potentiometer to regulate revs. The problem is that usually when I increase voltage using potentiometer, motor doesn't want to start rotating by itself and it does only when I move its shaft with finger or when I press the button again. I would undrestand that it can be due to friction and that's why moving shaft with finger helps, but why does motor start rotating when I press the button changing direction?
Here is my circuit:

And here is my code:


user4143: Firstly, you need a motor driver to drive a motor from an Arduino. You cannot drive it directly from IO pins.
Secondly by using a potentiometer like that for controlling the speed you are massively starving the motor of power (not that the Arduino can provide such power, and if it could then the potentiometer would smoke).
Your design should be:

Potentiometer into an analog input to control the speed using PWM
Outputs from the Arduino to control the direction (GPIO x 2) and speed (PWM) to a motor driver (L293 is commonly available)
Motor connected to the motor driver
Power supply suitable for your motor connected to the motor driver

There are many many examples on the web that show you this kind of circuit. Follow one.

77997: <p>I've got a circuit with Arduino UNO Rev3, DC motor, button to switch direction of rotation and potentiometer to regulate revs. The problem is that usually when I increase voltage using potentiometer, motor doesn't want to start rotating by itself and it does only when I move its shaft with finger or when I press the button again. I would undrestand that it can be due to friction and that's why moving shaft with finger helps, but why does motor start rotating when I press the button changing direction?</p>
<p>Here is my circuit:
<a href="https://i.stack.imgur.com/0mnws.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0mnws.png" alt="enter image description here" /></a></p>
<p>And here is my code:<br />
<a href="https://i.stack.imgur.com/2jnre.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2jnre.png" alt="enter image description here" /></a></p>
 4143: <p>Firstly, you need a motor driver to drive a motor from an Arduino. You cannot drive it directly from IO pins.</p>
<p>Secondly by using a potentiometer like that for controlling the speed you are massively starving the motor of power (not that the Arduino <em>can</em> provide such power, and if it could then the potentiometer would smoke).</p>
<p>Your design should be:</p>
<ul>
<li>Potentiometer into an analog input to control the speed using PWM</li>
<li>Outputs from the Arduino to control the direction (GPIO x 2) and speed (PWM) to a motor driver (L293 is commonly available)</li>
<li>Motor connected to the motor driver</li>
<li>Power supply suitable for your motor connected to the motor driver</li>
</ul>
<p>There are many many examples on the web that show you this kind of circuit. Follow one.</p>
