Autonomous Sailing Boat

by robindehullu in Circuits > Raspberry Pi

309 Views, 3 Favorites, 0 Comments

Autonomous Sailing Boat

IMG_20230619_173935c.jpg

Welcome to my guide on building an automated wooden sailboat using Raspberry Pi! In this project, we'll combine traditional craftsmanship with modern technology to create a miniature vessel that sails autonomously and adjusts its sails with precision.

Supplies

1. Electrical Materials

  • Raspberry Pi model 4
  • 28BYJ-48 Stepper motor
  • 28BYJ-48 Driver module
  • 5V Servo motor
  • Low voltage DC motor
  • MCP3008 analog to digital converter
  • Diode
  • 2x QMC5883L
  • Push button
  • 74HC595 Shift register
  • 16x2 LCD-Display
  • Jump wires
  • 1k Ohm resistor

2. Hardware Materials

  • Wooden plank
  • Metal (stainless) or PVC tube
  • Aluminum rod
  • Slide bolt lock (stainless)
  • Hinge (stainless)
  • Wooden stick (diameter +- 5cm)
  • Thin rope
  • Plastic/cloth sheet
  • Metal rings
  • Cable holder (stainless)

3. Hardware tools

  • Saw
  • Sander
  • Drill
  • Solder iron

4. Software

  • Visual Studio Code
  • Fritzing
  • MySQL
  • Postman

Connect Electronics

breadboard_schema_final.png
elektronica_schema_final.png
  1. Connect two QMC5883L magnetometers to the Raspberry Pi's two I2C buses.
  2. Make sure to activate I2C bus 0 before using it.
  3. Add two pull-up resistors on both channels of I2C bus 0 since they are not built-in for these pins.
  4. Connect the GPS module to the RX and TX pins of the Raspberry Pi, and power it using the 5V output.
  5. Connect the 74HC595 shift register to the GPIO pins of the Raspberry Pi, and power it by connecting it to the 3.3V output.
  6. Connect the 16x2 LCD display to the shift register channels and power it using the 5V output.
  7. Connect the servo motor to an available GPIO pin on the Raspberry Pi and power it using 5V.
  8. Plug the 28BYJ-48 stepper motor into the 28BYJ-48 driver module and connect it to four GPIO pins on the Raspberry Pi. Power it using 5V.
  9. Connect the MCP3008 to the RPI's GPIO pins.
  10. Connect the DC-motor to ground to the MCP3008. Make sure to add a diode because a negative voltage can ruin your MCP3008.

Make the Hardware

IMG_20230618_154536.jpg
IMG_20230605_213419.jpg
IMG_20230612_141923.jpg
IMG_20230618_154701.jpg
IMG_20230618_154746.jpg
IMG_20230618_154753.jpg
IMG_20230618_154847.jpg
IMG_20230618_154855.jpg
IMG_20230618_154941.jpg
IMG_20230618_155053.jpg
IMG_20230618_155104.jpg
IMG_20230618_155144.jpg
IMG_20230618_155341.jpg
IMG_20230618_155353_Bokeh.jpg
IMG_20230618_155419_Bokeh.jpg
IMG_20230618_155534_Bokeh.jpg
IMG_20230618_155639_Bokeh.jpg
IMG_20230618_155657_Bokeh.jpg
  1. Take a round wooden stick, preferably with a diameter similar to that of a broomstick.
  2. Saw it to a length of approximately 5cm.
  3. File down the middle section of the stick to create a groove for the rope to rest in.
  4. Drill a small hole on one side of the stick to slide it onto the motor. If the hole is too big, you can use wood filler to make it smaller and fit the motor snugly.
  5. Drill a small hole through the filed-down section diagonally to allow the end of the rope to pass through. This will serve as the spool.
  6. Attach the rope to the spool and wind it up.
  7. Saw the wooden planks to your desired dimensions for the boat.
  8. Cut them at an angle where you want to attach them.
  9. Prepare the first plank by inserting nails on its side.
  10. Cut and file the blunt ends of the nails to make them sharper if needed.
  11. Place the second plank onto the sharpened side of the nails and add wood glue just before the two planks meet.
  12. Install a hinge and a slide bolt lock on the plank that will act as the cover for the closed compartment.
  13. Once all the planks are in place, drill holes in the bottom for the mast and cable holder. The mast hole should be in the center of the width of the boat and relatively far forward towards the tip.
  14. Insert the mast into the hole and secure it in place using a glue gun.
  15. Drill additional holes to add the cable holder between the closed compartment and the mast, aligning it with the mast. Attach the cable holder securely.
  16. Drill a hole in the closed compartment to allow the sail rope to pass through.
  17. Cut an aluminum rod to the desired length for the boom and the gaff. Drill holes at both ends of the rods.
  18. Cut the sail to the desired dimensions from a plastic or cloth sheet.
  19. Make small holes along the upper and lower edges of the sail
  20. attach it to the rods using ropes.
  21. Drill three holes in the mast to attach the sail. One hole is for the boom at the bottom, while the upper two are for the end of the gaff and to secure the gaff in an upright position.
  22. Attach the sail
  23. Make holes in the sail where you want to attach the sail to the boom and the gaff
  24. Secure the holes with metal rings
  25. Run rope through the metal rings and attach to the boat.
  26. Attach the boom and the gaff to the mast so that the sail can pivot.
  27. Drill a hole in the back of the closed compartment to accommodate the servo motor. Attach the rudder to the back.
  28. Drill a hole in the cover of the top compartment for the LCD display.

Install the Electronics

IMG_20230618_155906.jpg
IMG_20230618_155854_Bokeh.jpg
IMG_20230618_155844_Bokeh.jpg
IMG_20230618_155835_Bokeh.jpg
IMG_20230618_155802_Bokeh.jpg
IMG_20230618_162300.jpg
IMG_20230618_162256.jpg
  1. Place as many of the electronics as possible inside the closed compartment for a cleaner appearance and better protection. Secure them using your preferred method.
  2. Ensure that the stepper motor with the spool is aligned with the drilled hole intended for it. Position the servo motor at the designated spot for the rudder at the back of the boat.
  3. Make sure the GPS module's antenna has an unobstructed view of the sky. If needed, drill a hole in the closed compartment to accommodate the antenna.
  4. Run wires from the closed compartment to the mast and thread them through the mast to connect the DC motor and one of the magnetometers.
  5. At the top of the mast, install the DC motor along with a windspeed module. You can either 3D print a suitable module or create one using sticks and half-cut ping pong balls.
  6. Attach your magnetometer to a windvane and position it on top of the mast.

Write the Code

  1. Start by making an appropriate database using MySQL.
  2. Write code to read out the sensors and control the motors.
  3. Design your website (for example, using XD)
  4. Make your website using html and scss
  5. Write javascript code to make your website interactive to make it communicate with the database.

All of the necessary code can be found on this project's github.