user60656: i am a complete newbie in electronics but i'm a bit familiar with C.
i am building a machine that requires 5 little engines (12V 2.5in brushed CIM motors) & motor drivers (i need to adjust each motor's speed).
i've got an arduino UNO which i think is too small to control that many motors.
i would like to know if the setup i want was feasible to your opinion and which ardunio would i need to do that ?
i guess an Arduino Mega ?
also, i came accross this tutorial : https://howtomechatronics.com/tutorials/arduino/arduino-dc-motor-control-tutorial-l298n-pwm-h-bridge/
it explains how to configure an arduino with a driver & two motors.
in fact i want to prepare the same kind of thing but with 5 motors that i can control independently.
which hardware would you recommend to do such a thing please ?
many thanks !
regards

user43025: You should have just enough I/O with UNO, so long as you don't want to connect any other hardware/sensors.  Since this is unlikely, it would be better to use another board like Mega, but I'll provide solutions anyway in case you want to try them out:

Option 1:  For 5 motors controlled with L298N boards you'll need 15 output pins, 5 of which should be PWM.  Fortunately, there are 5 PWM outputs on the Arduino UNO on PORTB and PORTD.  The remaining 10 outputs need only be digital (PORTB has 1 and PORTD has 5).  You can use DDRC and PORTC commands to change function of the analog inputs labeled A0-A5, making them digital output, thereby gaining 6 more digital output pins for a total of 12 (more than the minimum 10 needed).
Option 2:  It is possible to use other PWM motor drivers that reduce number of pins required.  Examples are DRV8838 (link to supplier) and DRV8833 (link to supplier) where 2 wires are needed per motor channel.  As a bonus, these drivers are also significantly more compact than L298N.


60656: <p>i am a complete newbie in electronics but i'm a bit familiar with C.
i am building a machine that requires 5 little engines (12V 2.5in brushed CIM motors) &amp; motor drivers (i need to adjust each motor's speed).
i've got an arduino UNO which i think is too small to control that many motors.
i would like to know if the setup i want was feasible to your opinion and which ardunio would i need to do that ?
i guess an Arduino Mega ?</p>

<p>also, i came accross this tutorial : <a href="https://howtomechatronics.com/tutorials/arduino/arduino-dc-motor-control-tutorial-l298n-pwm-h-bridge/" rel="nofollow noreferrer">https://howtomechatronics.com/tutorials/arduino/arduino-dc-motor-control-tutorial-l298n-pwm-h-bridge/</a>
it explains how to configure an arduino with a driver &amp; two motors.</p>

<p>in fact i want to prepare the same kind of thing but with 5 motors that i can control independently.</p>

<p>which hardware would you recommend to do such a thing please ?</p>

<p>many thanks !
regards</p>
 43025: <p>You should have just enough I/O with UNO, so long as you don't want to connect any other hardware/sensors.  Since this is unlikely, it would be better to use another board like Mega, but I'll provide solutions anyway in case you want to try them out:</p>

<ul>
<li><strong>Option 1</strong>:  For 5 motors controlled with L298N boards you'll need 15 output pins, 5 of which should be PWM.  Fortunately, there are 5 PWM outputs on the Arduino UNO on <code>PORTB</code> and <code>PORTD</code>.  The remaining 10 outputs need only be digital (<code>PORTB</code> has 1 and <code>PORTD</code> has 5).  You can use <code>DDRC</code> and <code>PORTC</code> commands to change function of the analog inputs labeled A0-A5, making them digital output, thereby gaining 6 more digital output pins for a total of 12 (more than the minimum 10 needed).</li>
<li><strong>Option 2</strong>:  It is possible to use other PWM motor drivers that reduce number of pins required.  Examples are DRV8838 (<a href="https://www.pololu.com/product/2990" rel="nofollow noreferrer">link to supplier</a>) and DRV8833 (<a href="https://www.pololu.com/product/2130" rel="nofollow noreferrer">link to supplier</a>) where 2 wires are needed per motor channel.  As a bonus, these drivers are also significantly more compact than L298N.</li>
</ul>
