Lab 0: Tutorial and Skills Review

Team size: 4

Submission Sheet: Submit your Matlab on-ramp assignment on the E80 Canvas page

Prelab Help Sheet: No prelab required this week

Writing: No writing this week, just the kickoff lecture

Introduction

This lab is an opportunity for refreshing your skills and getting software and hardware setup for Labs 1 through 6 and the project Jump Start.

By the end of this lab you should have:

Ask your instructor for any guidance including where to find tools. Don’t forget to clean up afterwards.

This lab is a little different than most E80 labs because we want each team member to individially practice most of the skills. In future labs, it will be imperative to get into the habit of distributing work across team members and working in parallel. Deciding how to break up that work is a great pre-lab exercise, and you’ll be hearing more about prelab soon.

Every member of the team should complete the following sections:

  • Breadboarding
  • Oscilloscope
  • Soldering (though only one person can solder the Teensy, everyone should practice)
  • Github Desktop and Arduino IDE Setup
  • Arduino Practice
  • SD Card Reading
  • MATLAB Access
  • MATLAB On-ramp

The remaining sections can be broken into parallel tasks

  • Frame Assembly (it makes sense to break up frame assembly and motor construction)
  • Battery

And, of course, every team member should participate in the team forming activity

Team Forming

Welcome to your new E80 team! Working well together is important to your success. Do this introduction game, even if it seems silly, to lay the foundation for your future teamwork!

Team Proverb

Compose a proverb one word at a time by following these instructions:

  1. Everyone in the team stands in a circle.
  2. Someone begins a proverb by saying one word.
  3. The person next to them continues the proverb with another word.
  4. Keep moving around the cirle until the proverb feels complete.
  5. Celebrate the proverb by having everyone in the circle tap their fingers together saying “yesyesyesyes…”
  6. Repeat 1-2 more times.

To get you started, here are some example proverbs:

  • A real one: “A bird in the hand is worth two in the bush.”
  • One from the E80 teaching team: “A dog says ‘woof’ if happy or sad … yesyesyesyes…”

Get to Know Your Teammates

Next, please take turns sharing the following. The person whose birthday is soonest goes first!

  1. Your name and where you live on campus
  2. Your favorite breakfast cereal
  3. One thing that makes you excited about E80
  4. One thing that makes you nervous about E80
  5. What you most hope to learn from E80

Kick Off the Semester

Celebrate your team formation with some gesture before diving in to the work. Options include:

  • Putting hands together and yelling, “go team!”
  • One clap in unison
  • Steely eyed stares and nods for ~5 seconds
  • Solemnly swearing to support one another’s learning
  • Some other token you invent

Frame Assembly

We will be reusing the frames from the ROV’s you constructed during E79, but a minor modification will need to be made in order to change your ROV (Remotely Controlled Vehicle) into an AUV (Autonomous Underwater Vehicle). Specifically, you will need to increase the width of the frame to fit the waterproof box that will house the motherboard, microcontroller, battery, additional sensors, etc.

This image is a helpful reference for the modification:

Figure 1: Modified E79 ROV for use in E80.
  1. Obtain two additional 6.5’’ PVC pieces to replace the 4.5’’ ones.
  2. Drill the mounting holes for your vertical motor. You will be mounting your AUV’s motors in the same manner as the three motor assembly in Practicum 1A Section 4.7.
  3. Construct at least one additional motor from scratch. Reference Practicum 1A Section 4.2 for assembly instructions. Each team will be provided with 2 used motors, but needs to make a third, and may make more to have backups.
  4. Test that all three of your motors pull less than 500 mA. To do this, supply 6 V to the motor using a power supply.
  5. Mount the motors on the new frame.

Battery

Your AUV will need power, and we provide that with a battery pack. The battery pack used in E80 is a 3000 mAh to 3500 mAh, 30 C, 11.1 V LiPo battery pack. To charge the batteries, we will use a HiTec x1 Mini charger or a UP60AC multi charger. Here are some helpful images showing a correct charging setup.

  1. Read the manual on how to use the chargers.
  2. Determine how many cells are in the battery pack, and the maximum, minimum and nominal voltage outputs of these battery packs.
  3. Request a battery and a LiPo safe bag from an instructor and set up your battery for charging.
  4. Important! Ask an instructor or proctor to check your recharging setup before you begin charging!
  5. Charge the battery up to its maximum voltage.
Warning

Make sure you plug the balancer cable into the balance lead socket (the black wire should align with the minus sign). Failure to do this may cause the battery to explode! Always use a LiPo-safe bag while charging. Never charge above 12.6 V or allow your battery to discharbe below 11.1V.

Breadboarding

We do a lot of electronics prototyping in E80 because most experimental measurements are electrical. A breadboard is a crucial tool for electronics prototyping. The videos below explain how a breadboard works and how to use one. Watch the first two videos and follow along with them. Give the third one a try if you have time.

  1. Simple LED Lesson: The tutorial shows an LED circuit without a current limiting resistor, which can make the LED burn up. Sometimes literally. So please place a resistor in series with your LED, and calculate an appropriate resistance value using this formula:

    \[R=\frac{(V_s-V_F)}{I_F}\]

    where \(V_S\) is the supply voltage, and \(V_F\) and \(I_F\) are the foward voltage and current of the diode respectively. \(V_F\) and \(I_F\) can be found on LED datasheet.

  2. Breadboard Internals.

  3. How to build a 555 Timer circuit. Here is a link with a circuit diagram. Here is a video on how the 555 works.

Note

Note: one super tricky failure mode in breadboards is that internal connections of breadboards can break. You can always trace connectivity with a multimeter if you’re stumped with a failing circuit.

Oscilloscope

You will be using an oscilloscope for most E80 labs. If you need a refresher on how to use an oscilloscope, refer to Practicum 2B from E79.

Soldering

You will need to solder printed circuit boards and wire connections in E80, so it’s worthwhile to practice if you’re rusty. Your team also needs to solder pins onto a Teensy today and make sure the soldering job worked.

  1. Review a helpful video on how to solder, found here.
  2. Find a practice solder board and solder a few joints.
  3. One team member should check out a Teensy from an instructor. Note that Teensys are in limited supply, so practice soldering before checking this out.
  4. One team member should solder header pins to the Teensy. Use the reference images below as a guide, and make sure your pins are oriented as indicated in the references before you solder.

Remember to:

  1. Never leave your soldering iron unattended.
  2. Turn the iron off any time it isn’t used for more than 30 seconds. A good rule of thumb is “The iron is off unless you are holding it right now.”
  3. Use recently soaked sponge. Use a spray bottle to moisten. Never use the sink or water fountain.
  4. Use fume extractor: fumes from rosin in solder is a respiratory irritant.
  5. Wash hands after handling solder – solder is 40% lead. Skin contact is harmless, but ingestion can occur with unwashed hands when eating, drinking, or smoking.
  6. Always tin the tip of your iron before turning it off.
(a) Unsoldered Teensy and strip of header pins.
(b) Soldered Teensy 4.0.
Figure 2: Reference diagrams for Teensy assembly.

Github Desktop and Arduino IDE Setup

Robot behavior is specified in software, so we need to set up two tools for working with software on your machine. First, we need the Arduino integrated development environment (IDE). An integrated development environment (IDE) is a program that makes writing software easier, and we’ll use the Arduino IDE to program our Teensys. Second, we need version control software so we can keep your code up to date. Git is a distributed version control system that allows you to download a local copy of all the E80 software. It also allows you to easily track the changes that you make to your code. While we won’t be using all the features of git in E80, we will introduce you to the main features that will enable you to interact with the code base for your robot.

Follow the setup instructions at bottom of the E80 Github page. After completing these instructions you should have a folder on your computer with all the E80 starter source code for the semester and have the Arduino IDE set up to easily access and load the provided sketchbooks.

Arduino Practice

Once you have the Arduino IDE installed, Github Desktop set up, and pins soldered on your Teensy, share the Teensy among your teammates to run through a few more Arduino tutorials:

Test your connection to the Teensy by compiling and uploading the RGB LED example in the Arduino IDE. Then ensure you can compile and uplaod the E80 code.

  1. Plug your Teensy into your laptop
  2. Open the RGB LED example by navigating to File -> Examples -> 0.1 Basics -> Blink.
  3. Follow the instructions here to compile and upload to the Teensy
  4. Change the Arduino IDE Sketchbook location to the E80 Gitlab folder, which you downloaded earlier in the section, by using File->Preferences.
  5. Open E80_Lab_01.ino.
  6. Confirm that you can compile and upload the starter code to your Teensy. Since your Teensy is not plugged into your motherboard here, this code will do little. It is fully tested in Lab 1.
Note

You must use a micro USB cable (see image here) to connect the Teensy to your computer before you can upload sketches.

Warning

When connecting and disconnecting the USB cable from your Teensy be sure to only apply force horizontally and not vertically. Failing to follow this may result in accidentally pulling the USB connector off your Teensy board, thus destroying it.

Note

You will not have a Teensy for pre-labs, but downloading the necessary software and trying to modify and compile your lab code in the IDE is great Prelab practice.

Then try these tutorials if you have time.

  1. Blinking lights on the Arduino board:
  2. Hooking up an external LED

SD Card Reading

Find a micro-SD card. Make sure your computer can read it.

MATLAB Access

You will be using MATLAB to help analyze and interact with data throughout this course, so you need to install MATLAB. You will first need to Visit the MATLAB Portal and log in using your Mathworks account. If you do not have an account, create one using your username@hmc.edu credentials.

Then, do the following to install MATLAB on your computer:

  1. Visit the MATLAB Portal.
  2. Choose to download the installer and select your operating system.
  3. Run the installer and log into your Mathworks account again.
  4. Select “Individual” license and complete the installation process.

It is also possible to use an online copy of MATLAB here, but we discourage doing so in this course.

MATLAB On-ramp

If you have extra time during Lab 0 you may work on the MATLAB on-ramp tutorial. You can find the assignment here.