Autonomous Hovercraft
The objective of this project was to create a hovercraft. For this design, either a singular fan or multiple fans can be used. If the hovercraft is to only be used in water then a singular motor can be used. If the hovercraft is to be used on land then a lift fan will be required.
Materials
Battery: https://www.amazon.com/gp/product/B07DNYV4C6/ref=p...
Motors: the motors I chose are no longer available, you will need 2 quad copter motors with ESC and propeller.
Arduino Uno
9V Battery
JB Weld or some other epoxy (will be used to mount components)
You will need access to a 3D Printer
Design and Printing
For the design of the hovercraft it was made to generate an air pocket below the hull as opposed to using an air bag. A main flotation system is needed, for this case since i was making something to be used in a pool I used a pool noodle.
I have provided a base thruster mount and rudder that can be used. All of these parts were 3D printed and epoxied together at each others center.
Assembling
As mentioned before, all of the components were epoxied together, including the motors. Then the wiring was run to the arduino board.
Code
#include //calls in servo library to allow easy programming
#define echoPin 7 //echo pin for proximity sensor
#define triggerPin 10 // defines pin for receiver of proximity sensor
Servo ESC; // creates a servo variable to allow control of Electronic Speed Controller
Servo Rudder; //creates a servo variablr to allow control of rudder
void setup() {
pinMode(echoPin, INPUT); // sets echopin as input
pinMode(triggerPin, OUTPUT); //sets triggerpin as output
ESC.attach(9,1000,2000); //attaches ESC to pin 9 and sets maximum and minimum pulse times Rudder.attach(8); //attaches rudder to pin 9
Rudder.write(53); //sets rudder position as straight
ESC.write(0); //sets motor speed to 0
}
void loop() {
digitalWrite(triggerPin, HIGH); //turns trigger pin on
delayMicroseconds(10);
digitalWrite(triggerPin, LOW); //turns trigger pin off
int distance = pulseIn(echoPin,HIGH); // reads input from echopin (distance to wall)
distance=distance/148; //changes distance reading to inches
Serial.print(distance);
// the following if statement says that if the distance read by the proximity // sensor is greater than 10 inches move forward
if (distance > 10){
Rudder.write(53); //rudder is straight
ESC.write(140); //speed set to 125 of 180
delay(1000);
}
// the following if statement says that if the distance read by the proximity // sensor is less than 10 inches turn to avoid obstacle
if (distance <= 10){
Rudder.write(25); // rudder set to 28 degrees from center
ESC.write(180); // full speed to turn faster
delay(500);
Rudder.write(53);//rudder set to straight after turn
ESC.write(125); // regular speed for going straight
}
}