Help with figuring out power supply required!


As seen in the diagram above I am trying to make an automatic irrigation robot that works the same way as a standard 3 wheel Arduino robot but with powerful motors to carry more load. I am using an 11.1v 5A lipo battery with l293d to drive 2 12C DC motors. Now I am just confused as to is the power supply too much for the requirement because l293d cannot handle more than 1A of current and most of the 12v DC motors need around 4A of current at max efficiency. So do I just simply add a potentiometer between the power supply and l293d such that not more than 1A of current is supplied?

First things first, the motor power supply GND is connected to the Arduino 5v.

This is wrong, connect it to the Arduino GND.


What is the resistance of the motors ?

Do you have a link to them ?

I'll fix that nw
https://www.jaycar.com.au/12v-6-500-rpm-dc-electric-motor/p/YM2718
that's the link to the motor I am planning to buy.

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".

Can you please tell us your electronics, programming, arduino, hardware experience?

You will need a much better motor controller for those motors, the L293D is a BJT dinosaur, you need a MOSFET type driver with twice the capacity of your motors for reliability.

Here is a good place to start.

If you are using a Lipo, PLEASE put a fuse in the positive line to protect your project.

Tom... :grinning: :+1: :coffee: :australia:

1 Like

Hi, I am in high school, therefore, I have a brief knowledge about circuits electronics etc. For the fuse how many amps should it be? The battery I am using is 5mAh.

I very much doubt that! :roll_eyes:

Sorry it is 5000mAh

hi there again if i were to replace the l293d with Pololu Dual VNH5019 would i need to change the code or can i use the same code as below and also as for the schematic of this new motor driver i am confused about what is the use of M1 and M2PWM pin on the motor driver?
image

#include <IRremote.h>

/*
   Left Motor
*/
// IN 1
#define LM_IN1    2
// IN 2
#define LM_IN2    4
/*
   Right Motor
*/
// IN 3
#define RM_IN3    5
// IN 4
#define RM_IN4    7


// IR receiver
# define RECV_PIN 10

IRrecv irrecv(RECV_PIN);

decode_results results;

//HEX codes for buttons
#define FWD       0xFD8877 // go forward
#define LFT       0xFD28D7 // go left
#define RGT       0xFD6897 // go right
#define BWD       0xFD9867 // go backward
#define STOP      0xFD30CF // stop
#define RESET     0xFD00FF // Resets the Arduino Board(RED)

unsigned long int value=0;

/*
 ************Arduino Reset Pin**************
 */
#define RESET_PIN A0

void setup() {
  
  // set mode of the pins as output
  for (int i = 2; i <= 7; i++) {
    pinMode(i, OUTPUT);
  }


  // start serial communication
  Serial.begin(9600);
  // In case the interrupt driver crashes on setup, give a clue
  // to the user what's going on.
  Serial.println("Enabling IRin");
  irrecv.enableIRIn(); // Start the receiver
  Serial.println("Enabled IRin");

}

void loop() {
  if (irrecv.decode(&results)) {
    value = results.value;
    Serial.println(value, HEX);
    irrecv.resume(); // Receive the next value
    delay(200);
  }

  delay(100);
  check_Inst(value);
  value=0;
}

void check_Inst(long int value) {

  switch (value) {
    case FWD:
      go_Forward();
      break;
    case LFT:
      go_Left();
      break;
    case RGT:
      go_Right();
      break;
    case BWD:
      go_Backward();
      break;
    case STOP:
      go_Stop();
      break;
    case RESET:
      pinMode(RESET_PIN,OUTPUT);
      digitalWrite(RESET_PIN,HIGH);   
      break;  

    default:
      value = 0;
  }
}

void go_Forward() {
 
  movement_Inst_Fwd();
  delay(10);
}

void go_Left() {
   
  movement_Inst_Lft();
  delay(10);
}

void go_Right() {
  
  movement_Inst_Rgt();
  delay(10);
}

void go_Backward(){

  movement_Inst_Bwd();
  delay(10);
}  

void go_Stop(){
  
  movement_Inst_Stp();
  delay(10);
}  

/*
 * These movement instruction are repeated several times in the code
 */
void movement_Inst_Fwd(void){
  Serial.println("Going_Forward");
  
  // forward movement instructions
  digitalWrite(LM_IN1,HIGH);
  digitalWrite(LM_IN2,LOW);
  digitalWrite(RM_IN3,HIGH);
  digitalWrite(RM_IN4,LOW);   
  } 
  
void movement_Inst_Lft(void){
  Serial.println("Going_Left");
  
  // Left movement instructions
  digitalWrite(LM_IN1,LOW);
  digitalWrite(LM_IN2,LOW);
  digitalWrite(RM_IN3,HIGH);
  digitalWrite(RM_IN4,LOW);  
  delay(500);
  digitalWrite(LM_IN1,LOW);
  digitalWrite(LM_IN2,LOW);
  digitalWrite(RM_IN3,LOW);
  digitalWrite(RM_IN4,LOW);    
  delay(500);
  }
  
void movement_Inst_Rgt(void){
  Serial.println("Going_Right");  
  
  // Rgt movement instructions
  digitalWrite(LM_IN1,HIGH);
  digitalWrite(LM_IN2,LOW);
  digitalWrite(RM_IN3,LOW);
  digitalWrite(RM_IN4,LOW); 
  delay(500);
  digitalWrite(LM_IN1,LOW);
  digitalWrite(LM_IN2,LOW);
  digitalWrite(RM_IN3,LOW);
  digitalWrite(RM_IN4,LOW); 
  delay(500);
    
  }
  
void movement_Inst_Bwd(void){
  Serial.println("Going_Backward"); 
    
  // Bwd movement instructions
  digitalWrite(LM_IN1,LOW);
  digitalWrite(LM_IN2,HIGH);
  digitalWrite(RM_IN3,LOW);
  digitalWrite(RM_IN4,HIGH);   
  }
  
void movement_Inst_Stp(void){  
  Serial.println("Stopping");    
  
  // Stp movement instructions
  digitalWrite(LM_IN1,LOW);
  digitalWrite(LM_IN2,LOW);
  digitalWrite(RM_IN3,LOW);
  digitalWrite(RM_IN4,LOW);  
  }

Hi,
Is this project associated with this?

Tom... :grinning: :+1: :australia:

a part of it is yes...but this was created in order to figure out the power supply while the other one is related to coding and schematic

what is the use of M1 and M2PWM pin on the motor driver

they are the signal that tells the motor driver what to do, and in which direction. it is a square wave, and the duty cycle - the ratio of positive to zero volts pulse duration - is the method used to command the motor