Submersible Vehicle
**************** THIS INSTRUCTABLE IS STILL A WORK IN-PROGRESS ****************
This Instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com).
This Instructable will be a brief over view of the creation of the submersible vehicle that I designed and built for my Makecourse class at the University of South Florida. In this Instructable I will provide a bill of materials, the control code I created for the Arduino Uno I used, and an overview of how to assemble the submersible.
Materials
The electronics used where:
1x Arduino Uno
1x mobius action camera
1x mobius action camera usb-b to A/V cable
1x field view 777 display screen
1x turnigy marine 50A ESC (electronic speed control)
1x turnigy marine programming card
1x T-Motor Navigator 400kv
1x YEP 20A BEC (battery elimination circuit)
6x hobby king HK15139 waterproof servos
2x parallel T-connector y harnesses
2x 18 inch servo extension wires
6x 6 inch servo extension wires
2x 1300mah 3s Lipo batteries
2x 2500mah 4s Lipo batteries
1x power distribution board with both 5v and 12v fixed outputs
The build materials where:
1x 3/16 inch sheet of plywood
1x 6 inch ID ABS shipping tube
1x silicone tube
1x can of flex seal
4x spools of ABS 3D printer filament
1x 24 inch drawer slide
Heat shrink tube
1x 10 feet of scotch brand duraloc velcro
1x JB Weld plastic epoxy
1x 6.2 inch diameter acrylic security camera dome
2x IP68 ethernet passthroughs
2x 24 inch cat6 ethernet cable
1x 200 foot cat6 ethernet cable
The hardware used was:
24x 1/2 inch brass wood screws
24x ------ screws (included with servos)
The tools used:
Philip's and Flat head screw drivers
Allen key set
Soldering iron
Heat gun
3D printer (I used a Monoprice Maker Select Plus)
Programming
Below is the code that was created to control the submersible. I have also attatched the .ino file so that it can be downloaded.
This code was created for the Arduino Uno using the Arduino compiler.
/**********************************************************************************************************************************************************************
Author: Jonah Powers Date: 11/9/2018 Purpose: Control Code for Remotely Operated Submersible Vehicle **********************************************************************************************************************************************************************/ #include //Including Servo Library Servo roll1; //Declaring roll1 to be a servo Servo roll2; //Declaring roll2 to be a servo Servo elev1; //Declaring elev1 to be a servo Servo elev2; //Declaring elev2 to be a servo Servo yaw1; //Declaring yaw1 to be a servo Servo yaw2; //Declaring yaw2 to be a servo Servo esc; //Declaring esc to be a servo
int pot1 = 0; //Intitializing variable pot1 as an integer and setting it equal to 0 int pot2 = 1; //Intitializing variable pot2 as an integer and setting it equal to 2 int pot3 = 2; //Intitializing variable pot3 as an integer and setting it equal to 4 int pot4 = 3; //Intitializing variable pot4 as an integer and setting it equal to 5 int val1; //Intitializing variable val1 as an integer int val2; //Intitializing variable val2 as an integer int val3; //Intitializing variable val3 as an integer int val4; //Intitializing variable val4 as an integer int val5; //Intitializing variable val5 as an integer int val6; //Intitializing variable val6 as an integer int val7; //Intitializing variable val7 as an integer int val8; //Intitializing variable val8 as an integer int mspeed; //Intitializing variable mspeed as an integer
void setup() { //Arduino initialization stage Serial.begin(9600); //Initializing the serial moniter roll1.attach(2); //Attaching servo roll1 to digital pin 2 roll2.attach(3); //Attaching servo roll2 to digital pin 3 elev1.attach(5); //Attaching servo elev1 to digital pin 5 elev2.attach(6); //Attaching servo elev2 to digital pin 6 yaw1.attach(8); //Attaching servo yaw1 to digital pin 8 yaw2.attach(9); //Attaching servo yaw2 to digital pin 9 esc.attach(11); //Attaching servo esc to digital pin 11 roll1.write(90); //Writing servo roll1 to its centered position roll2.write(90); //Writing servo roll2 to its centered position elev1.write(90); //Writing servo elev1 to its centered position elev2.write(90); //Writing servo elev2 to its centered position yaw1.write(90); //Writing servo yaw1 to its centered position yaw2.write(90); //Writing servo yaw2 to its centered position esc.write(180); //Writing servo esc to its centered position delay(2500); //Waiting 2 second esc.write(90); delay(5000); }
void loop() { //Main Code to loop infinitely if(analogRead(pot1)<1 && analogRead(pot2)<1 && analogRead(pot3)<1 && analogRead(pot4)<1){ //Checking to see if controller is powered roll1.write(90); //Writing servo roll1 to its centered position roll2.write(90); //Writing servo roll2 to its centered position elev1.write(90); //Writing servo elev1 to its centered position elev2.write(90); //Writing servo elev2 to its centered position yaw1.write(90); //Writing servo yaw1 to its centered position yaw2.write(90); //Writing servo yaw2 to its centered position esc.write(110); //Writing servo esc to its centered position } else{ val1 = analogRead(pot1); //Reading "pot1" (analog pin 0) and save value as val1 if(val1>= 485 && val1<= 540){ //Checking to see if "Joystick" (potentiometer) is centered roll1.write(90); //Writing servo roll1 to center position roll2.write(90); //Writing servo roll2 to center position } else{ //What to do if "Joystick" is not centered val1 = map(val1, 0, 1023, 10, 170); //Mapping val1 from 10 to 170 and assigning to val1 roll1.write(val1); //Writing servo roll1 to positon defined by val1 roll2.write(val1); //Writing servo roll2 to positon defined by val1 }
val2 = analogRead(pot2); //Reading pot2 (analog pin 2) and save value as val2 if(val2>= 485 && val2<= 540){ //Checking to see if "Joystick" (potentiometer) is centered elev1.write(90); //Writing servo elev1 to center position elev2.write(90); //Writing servo elev2 to center position } else{ //What to do if "Joystick" is not centered val3 = map(val2, 0, 1023, 10, 170); //Mapping val2 from 10 to 170 and assigning to val3 val4 = map(val2, 0, 1023, 170, 10); //Mapping val2 from 170 to 10 and assigning to val4 elev1.write(val3); //Writing servo elev1 to positon defined by val3 elev2.write(val4); //Writing servo elev2 to positon defined by val4 }
val5 = analogRead(pot3); //Reading pot3 (analog pin 4) and save value as val5 if(val5>= 485 && val5<= 540){ //Checking to see if "Joystick" (potentiometer) is centered yaw1.write(90); //Writing servo yaw1 to center position yaw2.write(90); //Writing servo yaw2 to center position } else{ //What to do if "Joystick" is not centered val6 = map(val5, 0, 1023, 10, 170); //Mapping val5 from 10 to 170 and assigning to val6 val7 = map(val5, 0, 1023, 170, 10); //Mapping val5 from 10 to 170 and assigning to val7 yaw1.write(val6); //Writing servo yaw1 to positon defined by val6 yaw2.write(val7); //Writing servo yaw2 to positon defined by val7 }
val8 = analogRead(pot4); //Reading pot4 (analog pin 5) and save value as val8 if(val8 > 470 && val8 < 554){ //Checking to see if "Joystick" (potentiometer) is centered esc.write(80); //Writing servo esc to 0 speed mspeed = val8; //Storing current speed as mspeed } else{ //What to do if "Joystick" is not centered val8 = map(val8, 0, 1023, 10, 150); //Mapping val8 from 50 to 170 and assigning to val8 if((mspeed>80 && val8<80)||(mspeed<80 && val8>80)){ //Checking to see if motor is about to change direction esc.write(80); delay(1000); //Waiting 1000 milliseconds } esc.write(val8); //Writing servo esc to speed defined by val8 mspeed=val8; //Storing current speed for comparison } } Serial.print("throttle "); //Using Serial Print to show the word "Throttle" Serial.println(val8); //Using Serial Print to show the value that throttle is set to Serial.print("roll "); //Using Serial Print to show the word "Roll" Serial.println(val1); //Using Serial Print to show the value that roll is set to Serial.print("pitch "); //Using Serial Print to show the word "Pitch" Serial.println(val3); //Using Serial Print to show the value that pitch1 is set to Serial.println(val4); //Using Serial Print to show the value that pitch2 is set to Serial.print("yaw "); //Using Serial Print to show the word "Yaw" Serial.println(val6 ); //Using Serial Print to show the value that yaw1 is set to Serial.println(val7); //Using Serial Print to show the value that yaw2 is set to }
Downloads
Circuitry
Attached is a photo of the circuit on-board the submersible.
I created a custom shield for the Arduino to simplify my wiring. I have uploaded the Eagle Schematic & Board files for the shield. I used a LPKF S63 to mill the board. the Servos at the front that control roll will be plugged into Arduino
attached is a photo of the circuit inside the controller.
3D Printed Parts
I Printed all of these Files on my Monoprice Maker Select Plus. I used Esun ABS 1.75mm Filament. My print settings were 105 degree C for the print bed temp and and 255 degrees C for the extruder temperature. Only 1 of each part is needed except that you will need 6 copies of front wing. Note these parts were printed with wall thickness set to 1000mm. This was done so that the parts would be printed with 100% infill so they would be negatively buoyant.
Assembly
********************************* COMING SOON **********************************