Bluetooth Controlled Arduino Airboat

By using plastic bottles, K’Nex and some duct tape we built a boat frame. The fans on the Arduino module are controlled with Bluetooth from a phone.

OLYMPUS DIGITAL CAMERA
Airboat making a Left Turn

For this project the electrical parts that you need are:

– Arduino Uno
– 3x Fan Modules for Arduino ($6 each)
– 6x AA Battery Case w/ Power Plug ($4)
– Prototype Shield w/ Breadboard ($5)
JY-MCU Bluetooth Module ($7)

The fans are powered directly from the Arduino 5V pins, so no extra batteries are needed. With 3 fan modules the airboat moves quite well, 2 fans will also work. The fans will spin in either direction depending on the inputs used (INA or INB).

For flotation we used two medium sized plastic bottles, and for the frame we use K’Nex pieces. To connect the K’Nex frame to the bottles duct tape works well. The fans can be attached to the frame with wire, string or bolts and screws. To protect the Arduino some Tupperware can be taped to the middle of the frame.

boat_frame2

For the JY-MCU Bluetooth Module, you need to cross the TX and RX pins. TX on the module goes to RX on the Arduino, and RX on the module goes to TX on Arduino.

arduino-bluetooth

To connect your phone to the Arduino project your phone will need a Bluetooth Terminal program. For our Android phone we use the “Bluetooth Terminal” from Qwerty it’s free and easy to use.

You will also need to pair your phone with the JY-MCU Bluetooth Module. When you scan for Bluetooth devices the Arduino Bluetooth module will probably be called HC-06 .The pairing code will be: 1234 .

To control the airboat we use the following letters:
g – go forward
s – stop
l – left turn
r – right turn

phone_test

For the wiring of the fans we use pins 6 to 11. The Arduino and the battery pack will need to be balanced in the tupperware, otherwise the fans might touch the water.

The final code that we used is below.

// Airboat with 3 fans controlled by a bluetooth phone

int INA1 = 6; // back fan
int INB1 = 7; // back fan
int INA2 = 8; // right side fan
int INB2 = 9; // right side fan
int INA3 = 10; // left side fan
int INB3 = 11; // left side fan

char thekey; // input from Bluetooth phone

void setup()
{
// initialize the serial communication:
Serial.begin(9600); //baud rate of Bluetooth Module
// define the pins of the 3 fans as outputs
pinMode(INA1,OUTPUT);
pinMode(INB1,OUTPUT);
pinMode(INA2,OUTPUT);
pinMode(INB2,OUTPUT);
pinMode(INA3,OUTPUT);
pinMode(INB3,OUTPUT);
// start with all fans turned off
digitalWrite(INA1,LOW);
digitalWrite(INB1,LOW);
digitalWrite(INA2,LOW);
digitalWrite(INB2,LOW);
digitalWrite(INA3,LOW);
digitalWrite(INB3,LOW);
}

void loop() {

if (Serial.available() > 0) {
thekey = Serial.read(); // get the key from the phone

// "s" stops all fans
if (thekey == 's') {
Serial.println("Fans are stopped");
digitalWrite(INB1,LOW);
digitalWrite(INB2,LOW);
digitalWrite(INB3,LOW);
delay(1500);
}
// "g" runs all fans
if (thekey == 'g') {
Serial.println("Fans are going");
digitalWrite(INB1,HIGH);
digitalWrite(INB2,HIGH);
digitalWrite(INB3,HIGH);
}
// "l" only run right fan, turn left
if (thekey == 'l') {
Serial.println("Turn left");
digitalWrite(INB1,LOW);
digitalWrite(INB2,HIGH);
digitalWrite(INB3,LOW);
}
// "r" only run left fan, turn right
if (thekey == 'r') {
Serial.println("Turn right");
digitalWrite(INB1,LOW);
digitalWrite(INB2,LOW);
digitalWrite(INB3,HIGH);
}
}
}

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s