4
Compass This sensor measures Earth’s
magnetic fields to tell the boat which direction its
pointing. A critical thing to know when trying to
navigate at sea! Once again, Adafruits part has
excellent starter code and wiring.
Triple-axis accelerometer / magnetometer
Adafruit 1120
TIP: Don’t mount the compass anywhere near the
motor, motor cables, or big pieces of metal! They
can cause interfering magnetic fields that mess up
your boat’s navigation.
5
Controller A brain of sorts is needed to read
the input sensors and, based on commands
programmed into its software, direct output
signals to the motor and steering servo. Arduinos
of all kinds are an excellent option for a low-cost,
easy-to-use, controller.
Arduino microcontroller boards arduino.cc
6
Battery You’ll want to let your boat go free
and wander about in the water, so you’ll need
a battery to power it. For convenience, choose
something with a similar voltage to your
controller, motor, and servo to cut down on the
number of voltage regulators you’ll need.
7
Hull You need your boat to float! This can
be a wonderful place for creativity and fun. Use
whatever you can get your hands on: a boogie
board, a plastic box, soda bottles, your choice.
OK, so with those core components you have
all the necessary parts for your very own DIY
autonomous boat. Maybe you’ll add LEDs (always
an awesome decision) or a solar panel to charge
your battery. But aside from those fun bits, how
do you get your boat to actually start doing things
on its own? That’s where software comes in.
Figure
C
shows a basic loop with the steps
needed for an autonomous boat to drive to
a waypoint. Seems simple? Well, there are
steps left out, but a helpful lesson for software
is to keep things in small, testable chunks. If
you follow the general steps below and work
on making each line work on its own with the
necessary sensors and motors then you’ll be well
on your way to a working boat, minimizing the
amount of frustration driven by heaps of code that
doesn’t work. For software the time-old maker
rule is still king: KISS — Keep It Simple, Stupid!
That’s one way to get to a functional
autonomous boat. Another way we would highly
recommend is to look into the fantastic open-
source community project ArduPilot and, even
better, its ArduBoat section at discuss.ardupilot.
org/c/ardurover/arduboat. The community has
detailed instructions, components, and software
to get you up and running
err floating, fast!
OCEAN SCIENCE Autonomous Boats
waypoint_latitude = 41.726931
waypoint_longitude = 49.948253
Repeat these steps until boat reaches the waypoint
boat_latitude, boat_longitude = read_gps()
direction_to_waypoint = calculate_from_boat_and_waypoint_coor
dinates()
boat_heading = read_compass()
steering_angle = calculate_rudder_direction_correction()
move_rudder(steering_angle)
turn_motor_on(100%)
Pseudo code for autonomous waypoint navigation
X
N
W
S
E
Basic code and
autonomy overview.
C
42 makezine.com
M78_036-43_SeaSats_F1.indd 42M78_036-43_SeaSats_F1.indd 42 7/12/21 4:08 PM7/12/21 4:08 PM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
44.223.94.103