Help on ROV project *urgent*

Greetings veterans, I’m doing a Seaperch ROV based with Arduino for my final year project. I’m using 2 12v DC motor for forward, reverse and turning, all wired to an IC l293d. For the submerge and resurface I’m using a 12v DC motor connected to a relay shield. The ROV will be controlled via bluetooth hc-06.

I was able to do the coding and manage to move the 2 thrusters except the one connected to the relay.

Therefore, my question is how can I increase the power for the motors as I’m using motorcycle battery (12v) but the power output on the motor are not powerful, and how to make the motor connected to the relay spin?

Thank you!

Note: I’m new to arduino and robotics

ROV.ino (3.52 KB)

I saw the words "submerge" and "Bluetooth" in your post and got very confused.

AWOL: I saw the words "submerge" and "Bluetooth" in your post and got very confused.

:sweat_smile: :sweat_smile: :sweat_smile:

(I can't see your code, and I can't see your schematic, so I hope this isn't too "urgent")

AWOL: (I can't see your code, and I can't see your schematic, so I hope this isn't too "urgent")

I have attached the code, but here :

//int for back thrusters const int leftForward = 2; const int leftBackward = 3; const int rightForward = 4; const int rightBackward = 5; //int for submerge and resurface thruster const int CW = 7; const int CCW = 8;

int state; int flag=0;

void setup() {

pinMode(leftForward, OUTPUT); pinMode(leftBackward, OUTPUT); pinMode(rightForward, OUTPUT); pinMode(rightBackward, OUTPUT); pinMode(CW, OUTPUT); pinMode(CCW, OUTPUT);

Serial.begin(9600); }

void loop() {

if(Serial.available() > 0){ state = Serial.read(); flag=0; } // if the state is '0' the DC motor will turn off if (state == '0') { digitalWrite(leftForward, LOW); digitalWrite(leftBackward, LOW); digitalWrite(rightForward, LOW); digitalWrite(rightBackward, LOW); digitalWrite(CW, LOW); digitalWrite(CCW, LOW); if(flag == 0){ Serial.println("Motor: off"); flag=1; } } // if the state is '1' the motor will Submerge else if (state == '1') { digitalWrite(leftForward, LOW); digitalWrite(leftBackward, LOW); digitalWrite(rightForward, LOW); digitalWrite(rightBackward, LOW); digitalWrite(CW, LOW); digitalWrite(CCW, HIGH); if(flag == 0){ Serial.println("Motor: down"); flag=1; } } // if the state is '2' the motor will Resurface else if (state == '2') { digitalWrite(leftForward, LOW); digitalWrite(leftBackward, LOW); digitalWrite(rightForward, LOW); digitalWrite(rightBackward, LOW); digitalWrite(CW, HIGH); digitalWrite(CCW, LOW); if(flag == 0){ Serial.println("Motor: surface"); flag=1; } } // if the state is '3' the motor will move forward else if (state == '3') { digitalWrite(leftForward, HIGH); digitalWrite(leftBackward, LOW); digitalWrite(rightForward, HIGH); digitalWrite(rightBackward, LOW); digitalWrite(CW, LOW); digitalWrite(CCW, LOW); if(flag == 0){ Serial.println("Motor: forward"); flag=1; } } // if the state is '4' the motor will move backward else if (state == '4') { digitalWrite(leftForward, LOW); digitalWrite(leftBackward, HIGH); digitalWrite(rightForward, LOW); digitalWrite(rightBackward, HIGH); digitalWrite(CW, LOW); digitalWrite(CCW, LOW); if(flag == 0){ Serial.println("Motor: backward"); flag=1; } } // if the state is '5' the motor will move right else if (state == '5') { digitalWrite(leftForward, LOW); digitalWrite(leftBackward, HIGH); digitalWrite(rightForward, HIGH); digitalWrite(rightBackward, LOW); digitalWrite(CW, LOW); digitalWrite(CCW, LOW); if(flag == 0){ Serial.println("Motor: right"); flag=1; } } // if the state is '6' the motor will move left else if (state == '6') { digitalWrite(leftForward, HIGH); digitalWrite(leftBackward, LOW); digitalWrite(rightForward, LOW); digitalWrite(rightBackward, HIGH); digitalWrite(CW, LOW); digitalWrite(CCW, LOW); if(flag == 0){ Serial.println("Motor: left"); flag=1; } } }

Hi, Welcome to the forum.

Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :)

AmirulAkeem: Therefore, my question is how can I increase the power for the motors as I'm using motorcycle battery (12v) but the power output on the motor are not powerful, and how to make the motor connected to the relay spin?

To make the motor on the relay spin you wire it up correctly and write a small test program which just turns the relay on.

To increase power, you replace the L293 drivers with better ones. I like the Monster Moto driver from Sparkfun. That can drive relatively large motors very efficiently.

How has the Bluetooth worked in your underwater tests so far?

Next time use code tags to post code. The forum software eats some of your code if you don't.

An L293D will only drive small not-powerful motors and loses about 2-3V from the voltage you feed into it.

What are your motor specifications? How much current do they require? My guess is that you will need a better more modern motor driver.

And as Tom says we need to see EXACTLY how you have everything connected,particularly the relay and motor if that's what is not working.

Steve

TomGeorge:
Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks… Tom… :slight_smile:

Update :

//int for back thrusters
const int leftForward = 2;
const int leftBackward = 3;
const int rightForward = 4;
const int rightBackward = 5;
//int for submerge and resurface thruster
const int CW = 7;
const int CCW = 8;

int state;
int flag=0;       

void setup() {

   pinMode(leftForward, OUTPUT);
   pinMode(leftBackward, OUTPUT);
   pinMode(rightForward, OUTPUT);
   pinMode(rightBackward, OUTPUT);
   pinMode(CW, OUTPUT);
   pinMode(CCW, OUTPUT);


   Serial.begin(9600);
}

void loop() {

   if(Serial.available() > 0){     
     state = Serial.read();   
     flag=0;
   }   
   // if the state is '0' the DC motor will turn off
   if (state == '0') {
       digitalWrite(leftForward, LOW); 
       digitalWrite(leftBackward, LOW);
       digitalWrite(rightForward, LOW);
       digitalWrite(rightBackward, LOW);
       digitalWrite(CW, LOW);
       digitalWrite(CCW, LOW);
       if(flag == 0){
         Serial.println("Motor: off");
         flag=1;
       }
   }
   // if the state is '1' the motor will Submerge
   else if (state == '1') {
       digitalWrite(leftForward, LOW); 
       digitalWrite(leftBackward, LOW);
       digitalWrite(rightForward, LOW);
       digitalWrite(rightBackward, LOW);
       digitalWrite(CW, LOW);
       digitalWrite(CCW, HIGH);
       if(flag == 0){
         Serial.println("Motor: down");
         flag=1;
       }
   }
   // if the state is '2' the motor will Resurface
   else if (state == '2') {
       digitalWrite(leftForward, LOW); 
       digitalWrite(leftBackward, LOW);
       digitalWrite(rightForward, LOW);
       digitalWrite(rightBackward, LOW);
       digitalWrite(CW, HIGH);
       digitalWrite(CCW, LOW);
       if(flag == 0){
         Serial.println("Motor: surface");
         flag=1;
       }
   }
       // if the state is '3' the motor will move forward
     else if (state == '3') {
       digitalWrite(leftForward, HIGH); 
       digitalWrite(leftBackward, LOW);
       digitalWrite(rightForward, HIGH);
       digitalWrite(rightBackward, LOW);
       digitalWrite(CW, LOW);
       digitalWrite(CCW, LOW);
       if(flag == 0){
         Serial.println("Motor: forward");
         flag=1;
       }
   }
           // if the state is '4' the motor will move backward
     else if (state == '4') {
       digitalWrite(leftForward, LOW); 
       digitalWrite(leftBackward, HIGH);
       digitalWrite(rightForward, LOW);
       digitalWrite(rightBackward, HIGH);
       digitalWrite(CW, LOW);
       digitalWrite(CCW, LOW);
       if(flag == 0){
         Serial.println("Motor: backward");
         flag=1;
       }
   }
           // if the state is '5' the motor will move right
     else if (state == '5') {
       digitalWrite(leftForward, LOW); 
       digitalWrite(leftBackward, HIGH);
       digitalWrite(rightForward, HIGH);
       digitalWrite(rightBackward, LOW);
       digitalWrite(CW, LOW);
       digitalWrite(CCW, LOW);
       if(flag == 0){
         Serial.println("Motor: right");
         flag=1;
       }
   }
           // if the state is '6' the motor will move left
     else if (state == '6') {
       digitalWrite(leftForward, HIGH); 
       digitalWrite(leftBackward, LOW);
       digitalWrite(rightForward, LOW);
       digitalWrite(rightBackward, HIGH);
       digitalWrite(CW, LOW);
       digitalWrite(CCW, LOW);
       if(flag == 0){
         Serial.println("Motor: left");
         flag=1;
       }
   }        
}

I'd be inclined to putting a timeout into your loop, so that if nothing is received for a certain amount of time (like the the time the device is submerged), then the device automatically surfaces.

AmirulAkeem:
I'm doing a Seaperch ROV based with Arduino for my final year project.

Did you get taught to draw schematics?
What course are you finishing.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Not this.


This does not label pins, components, it does not use standard engineering symbols.
Tom.. :slight_smile:

TomGeorge:
Did you get taught to draw schematics?
What course are you finishing.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Not this.


This does not label pins, components, it does not use standard engineering symbols.
Tom.. :slight_smile:

I don't actually. I'm doing aircraft mechanics. I was forced by my group mate to do the programming part on this project. So my knowledge in this are limited. Sorry for the inconvenience. :blush: :sweat_smile:

Hi, Well who ever is in charge in your group for the electronics assembly should have a circuit diagram.

Thanks.. Tom.. :)

Hi, Why have you got relays, when you are using a motor controller IC that can provide direction control as well as speed? Why wasn't your relay in the fritzy you supplied?

Tom... :o :o

slipstick:
An L293D will only drive small not-powerful motors and loses about 2-3V from the voltage you feed into it.

What are your motor specifications? How much current do they require? My guess is that you will need a better more modern motor driver.

And as Tom says we need to see EXACTLY how you have everything connected,particularly the relay and motor if that’s what is not working.

Steve

I see, So I’ll have to change the motor driver. As for the relay and motor, I’m following this website: http://www.instructables.com/id/DIY-Relay-switch-motor-controller-Arduino/

I followed the steps correctly, tho the only prob is that the motor isn’t spinning.

I’ve attached a pic of the relay I’m using

TomGeorge:
Hi,
Well who ever is in charge in your group for the electronics assembly should have a circuit diagram.

Thanks… Tom… :slight_smile:

Apparently there’s only the two of us. So the project are a bit spontaneous. I did this by combining 2 tutorials from this two websites

TomGeorge:
Hi,
Why have you got relays, when you are using a motor controller IC that can provide direction control as well as speed?
Why wasn’t your relay in the fritzy you supplied?

Tom… :o :o

As i was told that the IC I’m using can only control 2 motors?
I couldn’t find the relay in fritzy.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Done properly, and this is not a bad example, Fritzing layouts can show exactly how things are connected, but there seems to be an automatic reaction against them on this forum which I have never understood.

In this case I really don't see what

a picture of a hand drawn circuit in jpg, png

would add to the information available. It will, after all, consist of a series of boxes connected by lines, probably all of the same colour.

Hi,

In this case I really don't see what Quote

a picture of a hand drawn circuit in jpg, png

would add to the information available. It will, after all, consist of a series of boxes connected by lines, probably all of the same colour.

The relay that the OP can't find in fritzy for a start. Fritzy is okay for component layout, but not for signal flow and component and pin identification.

Tom... :)

AmirulAkeem: Apparently there's only the two of us. So the project are a bit spontaneous. I did this by combining 2 tutorials from this two websites http://www.instructables.com/id/Arduino-How-to-Control-DC-Motors-With-L293D-Motor-/ http://www.instructables.com/id/DIY-Relay-switch-motor-controller-Arduino/

Did you understand those instructables well enough to know whether it's actually correct? That site has quite some great content but is also notorious for incorrect tutorials (in part because just anyone can post on it, and there's no verification - though often there will be comments if things are particularly bad).

Without complete circuit diagram there's not much to do.

Fritzy doesn't do it. Can't see easily which pins of the controller the motors are connected. Can't see clearly on which pins of the Arduino they're connected.

You'll have to specify the type and power of the motors you intend to use, because those parameters you need to be able to select a suitable driver.

What's the use of the relays if you have such a driver IC already? Normally you'd use one or the other. Most commonly the IC, not the relays.

For the bluetooth part: stick your phone in a proper waterproof bag, take it to the pool, and see how far you get. I'm afraid not very. A few cm should work, if you're lucky you may do over 20 cm of submersion.

UKHeliBob: Done properly, and this is not a bad example, Fritzing layouts can show exactly how things are connected, but there seems to be an automatic reaction against them on this forum which I have never understood.

In this case I really don't see what would add to the information available. It will, after all, consist of a series of boxes connected by lines, probably all of the same colour.

Because 95% of the F**ing diagrams trigger a discussion like "Don't use that battery!" and then the OP comes back 20 posts later to say that they couldn't find the right battery and just put in the first thing that popped up.

You can't use symbols like GND and PWR to reduce the number of "obvious" lines and just show the active information flow.

Everything has to be terminated to the breadboard so 20% of discussions say "Don't use the breadboard for that current/voltage." This also makes it impossible to make logical groups, like putting all the related sensors in one part of the schematic and gathering all the decoupling caps into the power supply area. (That's if there ever are any decoupling caps.)

The worst part is F**ing has a proper schematic view and can even be used to design PCBs but all we ever see are these diagrams that look nice but conceal information.

Because 95% of the F**ing diagrams

sp. "F****ing"