Building a Semi Smart, DIY Boat With Arduino and Some Other Sensors




Introduction: Building a Semi Smart, DIY Boat With Arduino and Some Other Sensors

I based this off of this really nice post for building a water bottle boat, with some additions for obstacle avoidance and light-guided control. I used Arduino as a microcontroller, an ultrasonic sensor in the front, a few simple switches on the side of the boat, and a few light sensors on either side.  See here for a few more photos or here for a pdf step by step.

This simple little floating boat bounces off walls, can be steered with a flashlight, and won't hit something head-on. 


hot glue + glue gun (silicon optional)
two small DC motors
two water bottles
two small propellors
arduino + USB cable + computer
wire strippers
a plastic box 
a 9V battery + a connector
a power diode (like 1n4004)
some resistors
 a soldering iron + solder
a MOSFET transistor or TIP 120
2 few switches + 2 photocells

Step 2: Put the Motor in the Cap

1. Take off the top of both water bottles
2. Poke a hole in each cap
3. Apply hot glue to the inside of the cap, but not on the hole. Slip the motor shaft through the hole. When dry, the shaft should spin freely. 

Do this with both bottle caps and motors. 

Step 3: Tape the Water Bottles Together

Use two or three strips of tape to tape the water bottles together, sort of like a raft. 

Step 4: Solder Leads to the Dc Motors If There Are None

The motors are now attached to the bottle caps.

Solder on long (about 10") leads to the motors, if there aren't any.

Step 5: Cut a Slit in the Water Bottle

Cut a small slit in each water bottle. 
This is the hole through which the wires from the motors will poke through. 

Step 6: Put on the Cap and Feed Through the Wires

Put the cap on the bottle and feed the wires into the bottle opening, then out the slit that you just made. If you have trouble screwing on the cap, use some hot glue to secure it. 

Step 7: Make the Electronics House

Glue a plastic box to the top of your two bottles. You can bring the wires from the motors around the back, or poke a small hole in the side of the box to feed them into.
Now, put a bit of hot glue on the holes you made in the bottles to make sure the bottles are watertight.

Step 8: Build the Circuit

This circuit uses a TIP 120 (or similar Darlington or MOSFET) transistor, which is an electronic switch. 
It uses it to power a high current load because Arduino does not output enough amperage to turn the motors. 

Follow this schematic for the first motor. Then, build the SAME circuit for the second motor, on the breadboard. 

(You do not need a 9V battery second power source)

Step 9: Add Some Sensors

Get creative! you don't need all these sensors. but add them as you like. 

Ping Ultrasonic Rangefinder by Parallax works nicely on the front of the boat so it knows if something is in its path. 

Photocells can act like antennas if you want a boat that steers towards light (for example).

I'm a fan of two simple switches, mounted on the sides of the boat, acting as obstacle detectors. 

You can also modify the code and use some Infrared proximity sensors to detect short range obstacles

Step 10: Circuits for the Various Sensorsirc

See images for a circuit for a simple button with a 1K resistor. Do this for two buttons, so you can mount them on both sides of the boat so that if it hits something on either side it can adjust its steering accordingly. More information for this circuit and sample code can be found at

See image for a circuit with a photocell with a 1K resistor: Do this twice, also, so that you can include a photocell on both sides of the boat. For more information and sample code, see the analog input example at .

Step 11: Write Some Code or Download It

You can download some super simple premade code I wrote to give the boat basic functionality. There is code for a light-following boat and a boat with an ultrasonic rangefinder, with two buttons as obstacle sensors.

Here is my code for a boat with an ultrasonic sensor, two photocells, and two switches for obstacle avoidance

The way I have it operating is that if the boat approaches an obstacle ahead, it turns to avoid it. If the boat hits something from the side, it turns away from the barrier.

But here you can find various codes for the boat if you dont want to use all of the sensors, but just some of them

Or write your own.

Step 12: Box Everything

Put your circuit, arduino, and battery in the box. 

Step 13: Upload the Sketch

Open Arduino

Select the correct board and correct port. 
Compile and upload the sketch. 

Step 14: Waterproof and Get Ready for Testing

Put the top of the box on. Seal up all the holes or potential leak spotswith hot glue (or silicon). Glue any stray wires with hotglue (like the photocells or the buttons so they dont short in the water. 

Glue on the propellers to the motor shaft sticking out the cap. 

test it out on the water! 

Be the First to Share


    • Stone Concrete Cement Contest

      Stone Concrete Cement Contest
    • Remote Control Contest

      Remote Control Contest
    • Build a Tool Contest

      Build a Tool Contest



    3 years ago

    Hello, very nice project and good idea to use the simple bottles. Do you have a video of this robot in moving?


    6 years ago

    very nice solutions you brought... I was wondering how I could seal my motors... I think I'll try to use the inside bottle caps. But I think i'll try to seal with silicone glue...
    If I manage to make something decent I'll post here as a "I made it" in reference to you. Thanks for sharing!


    7 years ago on Introduction

    I tried to do this project with two 3V DC motors and used a 9V battery to power the Arduino. However, the 9V battery drained fast in about 10 minutes when the Arduino is running the 3V DC motors through the 3.3V pin, how can I solve this problem?


    9 years ago on Step 12

    Haha, I hate this kind of spaghetti! Good job on this creation and your SNEEL! Love them both.


    9 years ago on Introduction

    I'm a bit fan of the simplicity. I'm surprised the hot glue trick works for the motor-shaft. Definitively a tip I'll be trying to store away and remember.


    10 years ago on Introduction

    Nice project.

    You have a picture when its floating? I'm trying to picture it floating and wonder if the water leaks through the motor shaft holes, unless the shafts remain above water. How do the bottles remain air/water tight with said shaft holes?

    I would like to see a video showing how it moves under its own control.


    Reply 9 years ago on Introduction

    I race fast electric R/C boats. We put lube in the stuffing box (the tube the prop shaft goes through). I don't know of anyone who has had a problem with water entry through the stuffing box if the lube was applied properly.


    10 years ago on Step 8

    I'm sorry for asking a petty question: but how did you create the nice design of the arduino with the wires and other misc. components. I've seen other authors add these to their "ables". I would like to know so I could create my own.
    Great instructable by the way!


    10 years ago on Introduction

    Very nice project! And very good recycling of materials.