Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
Ibrahim Yassine
Published

Mobile-Controlled Water Bot

Build an amazing water bot that can be controlled through your mobile phone.

IntermediateFull instructions provided3,001
Mobile-Controlled Water Bot

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Urduino UNO shield
×1
motor driver
×1
Female/Female Jumper Wires
Female/Female Jumper Wires
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
DC Motor, Miniature
DC Motor, Miniature
×2

Hand tools and fabrication machines

plastic water bottles
woody sticks
milk bottle
Multitool, Screwdriver
Multitool, Screwdriver
motor fans

Story

Read more

Schematics

Building the frame

The frame is build by connecting two plastic water bottles by two woody ice cream sticks. The sticks are attached to both the bottles on each side by using a glue. On the top of the sticks, an empty milk bottle is placed (green in the fig).This bottle will host all the electronic staff of the boat.

Connections

This figure shows how the components of the robot are connected. First of all attach the arduino UNO board to its shield then connect the board to a 9V battery. and use the jumper wires for connecting each pin on the UNO shield to its adjacent pin on the mottor driver. The scheme also shows how the two motors are connected to the motor drive. and how the Bluetooth chip is finally connected to the UNO board.

Connections 2

Housing the electronics

In this figure, all the electronic components (including boards, wires and motors) are inserted into the previously prepared "house" which is the opening on the top of the milk bottle of the frame. Note that the motor is emerging from the round rim of the bottle.

Directional motor and fan

This figure shows how the directional motor (the one in the back of the milk bottle) is attached in its place and a special woody shaft (shown by the black arrow) was designed in order to fit with the white fan. As a result, the white fan (shown at the bottom of the figure) will be able to rotate inside water. This rotation will decide the left-right direction of the robot.

Code

Water robot code

Arduino
#include <SoftwareSerial.h>
SoftwareSerial BlueTooth(11, 12);    // (TXD, RXD) of HC-06
char BT_input;                    // to store input character received via BT.
int speedpin=3;
int MotorRight1 = 5;                
int MotorRight2 = 6;                
int speedpin1=8;
int MotorLeft1 = 9;               
int MotorLeft2 = 10;               

void setup()  
{
  BlueTooth.begin(9600);  
  Serial.begin(9600);
  pinMode(speedpin,OUTPUT);
  pinMode(MotorRight1, OUTPUT);
  pinMode(MotorRight2, OUTPUT);
  pinMode(MotorLeft1, OUTPUT);
  pinMode(MotorLeft2, OUTPUT);
  pinMode(speedpin1,OUTPUT);
}

void loop() 
{
  if (BlueTooth.available())
  {
   BT_input=BlueTooth.read();
    if (BT_input=='U')
  {
    analogWrite(speedpin,100);
   analogWrite(speedpin1,100);   
digitalWrite(MotorRight1,HIGH);
digitalWrite(MotorRight2,LOW);
digitalWrite(MotorLeft1,LOW);
digitalWrite(MotorLeft2,LOW);
}
    else if (BT_input=='L')
  {
    analogWrite(speedpin,100);
   analogWrite(speedpin1,100);  
digitalWrite(MotorRight1,HIGH);
digitalWrite(MotorRight2,LOW);
digitalWrite(MotorLeft1,LOW);
digitalWrite(MotorLeft2,HIGH);
}


    else if (BT_input=='R')
 {
analogWrite(speedpin,100);
 analogWrite(speedpin1,100);  
digitalWrite(MotorRight1,HIGH);
digitalWrite(MotorRight2,LOW);
digitalWrite(MotorLeft1,HIGH);
digitalWrite(MotorLeft2,LOW);
}
  else if (BT_input=='D')
 {
analogWrite(speedpin,100);
 analogWrite(speedpin1,100);  
digitalWrite(MotorRight1,LOW);
digitalWrite(MotorRight2,HIGH);
digitalWrite(MotorLeft1,LOW);
digitalWrite(MotorLeft2,LOW);
}







   else if (BT_input=='X')
{
analogWrite(speedpin,100);
analogWrite(speedpin1,100);    
digitalWrite(MotorRight1,LOW);
digitalWrite(MotorRight2,LOW);
digitalWrite(MotorLeft1,LOW);
digitalWrite(MotorLeft2,LOW);
}
 
  } 
}

Credits

Ibrahim Yassine
4 projects • 7 followers

Comments