This project will build a boat connected to WIFI that you can control through a web-browser. When you add a camera to the car you will be able to sit at your computer and pilot the boat anywhere within range of WIFI.
BE VERY CAREFUL when working with electronics and MAKE SURE YOU HAVE AN IN-LINE FUSE directly from your power supply with a 2A or 3A fuse installed. Failure to do this could result in components to heat and even catch fire. REMEMBER - THIS IS NOT A TOY - SAFETY FIRST
OBJECTIVES To build a boat that can be controlled from your computer, connect to wifi and be operated anywhere on the network whilst you sit at your computer and view the boats position from the on board camera.
EXPECTED EXPREIENCE GAINED
Gain an understanding of electrical components such as: LEDs, Resistors, Jumper wires, Diodes, Relays, Motor shields, capacitors, breadboard, power supplies.
Gain experience and develop techniques of using tools such as: Spanners, Ratchets, Soldering Iron, Screwdrivers, Cable Strippers, Cutters
Gain knowledge and experience of using a multi meter to measure voltage and continuity.
Gain practical experience of using the Raspberry pi including using the GPIOs, remote access networking, using the external camera port.
Develop your programming skills using Python programming language to program keyboard – keypress control of your vehicle.
This project should be fun and is expected to take a minimum of 12 hours to complete, however more time is recommended to deepen understanding of robotics engineering, electronics and programming.
COMPONENTS NEEDED
RASPBERRY PI - For the control of the boat, the Pi needs wi-fi capability. MOTOR SHIELDS - To power your motors and separate the circuit from the Raspberry Pi POWER PACK - To power your motors and other components IN-LINE FUSE - To protect yourself and your circuit from damage POWER BANK - To power Raspberry Pi WIRES - To connect components together DC MOTORS, SERVO MOTORS, PROPELLERS AND BASE - The boat structure NUTS AND BOLTS - A selection of nuts and bolts to connect everything together
TOOLS REQUIRED
SCREWDRIVERS - Various size screwdrivers for the motor shield and build screws SIDE CUTTERS - A small set of side cutters to cut and strip wires SOLDERING IRON - A small soldering iron to solder wires
OTHER USEFUL TOOLS WIRE STRIPPERS - To make it easy for you to strip wires MULTI-METER - To test and problem shoot your circuit
COMPONENTS WE USED IN THIS EXAMPLE
The components we used in the project are fairly cheap and easily obtained. The components with image are listed below, all components can be found on Amazon, Lazada and AliExpress.
MOTOR SHIELDS We used LN298N motor shields from Amazon. You will need 1 of these. When you fit then on your car remember that you will need access to connect the cables to the blue terminals.
POWER PACK Two battery packs or equivalent could be used for this project. You can either wire the power in series or parallel (See Circuits). In this guidance we have wired in series. Remember to fit a fuse to prevent damage. You should be looking to supply between 5v - 10v. We are using 8AAA batteries 2 x 4 in series and then wired in parallel.
IN-LINE FUSE To reduce the risk of damage, burning or possibly fire. Make sure you use a fuse and ensure the fuse is fitted close to the power supply. In this project we used a mini blade fuse and fuse holder. From Amazon.
CONNECTING THE MOTOR SHIELD
NOTE: Each Motor shield in the diagram is using a separate power supply, you can wire the power supplies in serial or parallel.
IMAGE THE PI OPERATING SYSTEM
WRITING THE CODE
Please feel free to copy the code from below: IMPORTANT: Please note that if you run this code and your configuration is different from that described above it is possible to damage your components, and it is possible for your project to catch fire. BE VERY CAREFUL when working with electronics and MAKE SURE YOU HAVE AN IN-LINE FUSE directly from your power supply with a 2A or 3A fuse installed.
BOARD MODE
The raspberry pi has two modes for the board setup, one is BCM and the other is BOARD. This project uses BOARD mode, this follows the pin numbering as can be seen in the centre of the image below where the pins are numbered 1 - 40.
LEARN HOW TO CONTROL THE SERVO MOTOR
LEARN HOW TO CONTROL THE MOTORS
VNC REMOTE CONNECTION
EXTENDED TASKS
Options for extensions on this task are fairly limitless however, here are a few ideas on how to expand on this project.
Add a servo motor to control where the camera points
Add ultrasonic distance sensors
Add light dependent automatic lights
Add a tilt and motion sensor
Add a camera to remotely drive your car from anywhere
Define a route and program your car to automatically drive the route.