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);
}
}
}

 

Arduino Sailboat

To build the sailboat we used

  • Arduino Uno [1]
  • Prototype shield with bread board ($5)
  • Wireless RF module and remote ($6)
  • Small servo ($6)
  • 6x AA batteries with case and plug
  • K’Nex building pieces
  • 4 plastic bottles
  • 1 small plastic container with a lid
  • String, Duct tape, and a garbage bag (white if you have it)

The boat construction used the 4 bottles for flotation and a K’Nex frame.

structure

Mounting the rudder will probably require some trial and error, our design used some Lego pieces, duct tape and wire to hold it in place.

servo1

For the electronics we had some good success with a wireless RF (Radio Frequency) module. The wireless RF modules are relatively low cost ($6), and they do not require any fancy programming. remote1

wiring

The final Arduino code is :

//
// sailboat1.ino - use a wireless RF motor to move a servo on a sailboat
// RF buttons:
// A = straight (90deg), B = turn left (10deg), C = turn right (10deg)
// Limit rudder turning from 60-120 degrees
//
#include <Servo.h> 
 
Servo myservo; 
int pos;

void setup() {
 pinMode(5, INPUT); // A button - D0 pin on RF module
 pinMode(6, INPUT); // B button - D1 pin on RF module 
 pinMode(7, INPUT); // C button - D2 pin on RF module 
 pinMode(8, INPUT); // D button - D3 pin on RF module 


void loop(){

if (digitalRead(5) == HIGH) { 
 Serial.println("Button A");
 pos = pos + 10;
 if (pos > 120) { pos = 120;} 
 myservo.write(pos); 
 delay(250);
 } 
 if (digitalRead(6) == HIGH) { 
 Serial.println("Button B"); 
 pos = 90;
 myservo.write(pos); 
 delay(250);
 } 
 if (digitalRead(7) == HIGH) { 
 Serial.println("Button C");
 pos = pos - 10;
 if (pos < 60) { pos = 60;} 
 myservo.write(pos); 
 delay(250); 
 } 
 if (digitalRead(8) == HIGH) { 
 Serial.println("Button D"); 
 delay(250);
 }

}

littleBits Motor Boat

To create the wireless remote for the a motor boat we needed to control the left and right motors , for this we used the following components:

  •  1- littleBits mounting plate (comes with base set)
  • 1 – littleBits fork module ($12)
  • 2 – littleBits dimmer($8) or slide switches ($10)
  • 1 – littleBits wireless transmitter
  • 1-  littleBits power module with battery ($6)

We connected the power module to a fork module and then the fork module powered our dimmer modules. We mounted all the components on a littleBits mounting plate, and we taped the battery to the back.

To build the boat we used 2 empty water bottles for flotation. We built a frame with K’Nex (and a little duct tape). The motors we held in place by feeding the motor shafts through a K’Nex support and then we used elastic bands to secure the motors to the frame.

The basic circuit for that boat is shown below. To keep things dry we put all the boat’s littleBits components into a Tupperware container.

motor1