Propeller Boat

Our final CPX design is an operational propeller boat. A CPX is a micro controller that you can program to make a moving part which will be activated by a Servo Motor. The Servo Motor is a motor that can rotate or move parts with high precision and efficiency. Our final product has an attached 3D printed propeller that makes it functional in water. Our boat incorporates a cabin top, to hold our CPX and ensure it stays dry. Our final design features boat lights that illuminate from the cabin top and are accompanied by a boat horn. Our final product has been tested in water to ensure that it floats and keeps the wires and CPX dry.
Supplies







- Adafruit Circuit Playground Express Basekit
- Continuous Rotation Micro Servo
- Propeller Attachment
- 3D Printer
- Soldering iron and Solder
- Heat Shrink Tube and heat gun
- Hot Glue Gun
- Battery Pack
Downloading the 3D Design



Coding

- Follow these instructions to install CircuitPython onto your CPX: https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython
- Connect your CPX to your computer and save code.py onto it
- The provided code will:
- Run the servo if a light is detected
- Play a light pattern if sound is detected
- Stop if a shake is detected
from adafruit_circuitplayground import cp
import time
# Servo control setup
cp.servo1.set_pulse_width_range(min_pulse=500, max_pulse=2500)
# Constants for light and sound thresholds
LIGHT_THRESHOLD = 300 # Adjust this based on sensitivity
SOUND_THRESHOLD = 500 # Adjust this based on sensitivity
while True:
if cp.light > LIGHT_THRESHOLD:
cp.servo1.throttle = 1.0
elif cp.sound_level > SOUND_THRESHOLD:
cp.pixels.fill((255, 0, 0))
time.sleep(0.5)
cp.pixels.fill((0, 0, 0))
elif cp.shake(shake_threshold=20):
cp.servo1.throttle = 0.0
time.sleep(0.1)
Attaching & Connecting the Servo Motor





- Wiring
- Begin by Identifying the wires of the Servo Motor Wires; you'll find a green or black wire, which serves as the ground connection, a red wire for power, and a yellow wire that carries the signal.
- Connect the servo to the CPX:
- Connect the green or black ground wire to the ground pin on the CPX, labeled 'GND'.
- Attach the red power wire to the voltage output pin, denoted as 'VOUT'.
- Hook up the yellow signal wire to the analog input designated 'A1' on the CPX for signal control.
- Heat Shrink
- Select an appropriate size of heat shrink tubing that fits over the electrical connectors.
- Slide the heat shrink over the exposed areas of the wiring where the servo connects to the CPX.
- Use a heat gun or a lighter to carefully shrink the tube around the connectors
- Connect the battery to the servo motor
- Using the appropriate connector plug attach the battery pack
- Then attach the battery to the inside of the Boat using a hot glue gun
Final Assembly of the Boat




- Make sure all parts are printed and ready for assembly
- Grab servo motor and glue to the rear hole in the back from the inside of the boat so the axel is sticking out of the boat
- For a tighter fit, put hot glue on the edges of the opening before inserting servo motor
- Grab a hot glue gun and glue the bottom of the cabin to backside of the boat above the servo motor
- Glue the back of the propeller to the axle of the servo motor
- Take CPX and insert it into the cabin
- Make sure all wires are tightly tucked through the hole in through the front of the cabin
- Hot glue the cover for the boat so that it covers the frontside of the design
- Put battery/wires through the hole in the cover into the boat