I'm doing a project where I'm using 5 12V DC Motor with Arduino Mega. 4 DC Motor will be used to move the platform (vehicle/robot) with the help of L293D motor shield, while 1 DC motor will be used as a water pump. I know that we can use motor shield to control the speed and directions of the DC motor however we dealing with 5 12V DC motor (which is more than the 4 ports in the motor shield). How should I proceed with this matter? Should I combine motor shield and relay? If so, how does one connects the motor shield to the Arduino because we will deal with 2 separate power source (1 power up the arduino, another for DC motor)? If you have other suggestion, do share in the comments. I'm quite new to Arduino btw.
If one or more motors only need to run in one direction then just power it via a transistor switch to turn it off/on , via a digital output pin . If you used a PWM pin you might get some speed control too. Google using a transistor as a switch , and also flywheel diode which you will need.
Hi @hammy, thank you for your suggestion I will look into it. But may I know if its possible to use motor shield and a relay (most probably SPDT) at the same time in a project? Do point out and explain if I made a mistake.
shiba17:
Hi @hammy, thank you for your suggestion I will look into it. But may I know if its possible to use motor shield and a relay (most probably SPDT) at the same time in a project? Do point out and explain if I made a mistake.
Hello,
What exactly do you mean by "at the same time"?
Do you have 2 shields, one with L293 and one with relay? Do you want to put one over the other?
In fact, there are no restrictions as to what can be done, the main question is to have enough outputs or inputs to trigger every thing you need.
But if the issue is to overlap two or more shields, you'll need to know the schematic details of them, so there is no conflict to fire 2 or more shields at the same time, unless this is desired.
Correct me if I'm wrong, if I connect the L293D motor shield to the arduino, the power supply will be from the arduino 5V. So, I'm planning to power up the motor shield with an external power supply which will be triggered by the relay.
The L293 needs two power supplies, one for the logic circuit (VCC pin), with 5V, the other is just to power the outputs (VSS pin), and the voltage must be suitable for the motor, as you can see in the picture, we have 12V, but if your motor was made for 5V, you need to use 5V on the external power connector.
Powering the VCC pin consumes very little current, so it should be safe to leave it with the Arduino's power.
Can be seen in the diagram, the control and power connections:
What is the version of your shield? Is that model below?