Before exposing the problem, I'll quickly explain how this mechanism works :
There is a dc motor and a servomotor controlled by a button and a potentiometer.
Each time the button is pressed, it launches a cycle :
the servomotor moves to a specific angle
the motor starts running (its speed depends on the value of the potentiometer)
a timer is launched
When the timer is over, the motor speed decreases until it stops running, and the servo slowly goes back to its initial position.
I plugged the components together accordingly to the fritzing sketch that I attached to this post. I used a 12v alimentation though, not a 9v. I also attached an image with the arduino code.
Now, the problem is :
Everything runs fine when I use a Arduino Uno card, but when I switch to Arduino Nano, the motor won't run.
the servo works properly just like it should, but no response at all from the dc motor.
I used the same pins, and I didn't change any pluggings.
Do you know how to solve this?
Besides, the servo makes a strange buzzing time when it moves, and for a small time afterwards, I don't know where it comes from.
Are you powering the servo from the Arduino 5v pin ? - I can't make sense of the Fritzing diagram.
Servos (and motors generally) should not draw power from the Arduino - it cannot provide enough current. The Uno may have been marginally more capable than the nano.
A photo of a simple pencil drawing showing the connections would be much better than a Fritzing diagram - even if you are not good at drawing.
yes, the servo is powered by the 5v pin. But the dc motor is powered by an external 12v power supply, separated from the card by a L293D
Yeah you're right, we can't see clearly the pins of the nano card on the diagram.
Analog pin A0 goes to the potentiometer
Digital pin 3 goes to the servo
Digital pin 7 goes to the button
Digital pins 9,10,11 go to the L293D
Vin pin go to the power supply
Robin2:
Are you powering the servo from the Arduino 5v pin ? - I can't make sense of the Fritzing diagram.
Servos (and motors generally) should not draw power from the Arduino - it cannot provide enough current. The Uno may have been marginally more capable than the nano.
A photo of a simple pencil drawing showing the connections would be much better than a Fritzing diagram - even if you are not good at drawing.
...R
But actually neither the Uno or the Nano are powering the motor, it's an external 12v power supply, so I guess that the problem is in the signal transmission to the L293D. There must be something about the Nano card that i'm missing, maybe about the capacity of the pins?