Cornell University: ECE 4960

Return to main page

Lab 1 (a): The Artemis board

Objective

The purpose of this lab is for you to setup and become familiar with the Arduino IDE and the Artemis board. After this lab, you should be able to program your board, blink the LED, read/write serial messages over USB, display the output from the onboard temperature sensor, measure the loudest frequency recorded by the Pulse Density Microphone, and run the board using a battery instead of your computer.

Parts Required

  • 1 x SparkFun RedBoard Artemis Nano
  • 1 x USB A-to-C cable
  • 1 x Li-Ion 3.7V 500mAh battery

Prelab

Check out the Artemis description, features, and helpful forums here:

  1. SparkFun RedBoard Artemis Nano. Note that this is a 3V board, NOT 5V, but 3V. Please. Remember. 3V. Inputs. Only.
  2. Setup instructions
  3. Artemis forums

Instructions

  1. Download and install the Arduino IDE. Install version 1.1.2 of the Sparkfun Apollo3 board support pack. Version 1.2.0 currently fails to include an important mbed WSF library needed for our Bluetooth example.
  2. Hook the Artemis board up to your computer, and follow the instructions from the second link above (“Introduction” and “Arduino Installation”).
    1. Note that the USB-A-to-C cable needs to be pushed in farther than you would expect, because of the way the data pins connect.
    2. If you are running Windows and the first compilation takes a long time, try adding “C:\Program Files\Arduino” (or the particular project folder) to the antivirus exclusions.
  3. Also from the second link above, follow the instructions in “Example: Blink it Up”
    1. Record a brief video, documenting that it works. Note: you may need to slow the baud rate down for it to work.
  4. In File->Examples->Artemis Examples, run Example2_Serial.
    1. Record a brief video documenting that your Serial port works. Note: to view the output and provide input open the serial monitor in the upper right hand corner of the script window.
  5. In File->Examples->Artemis Examples, run Example4_analogRead.
    1. Try blowing on or touching the chip to change its temperature. It may take a while to transfer your heat.
  6. In File->Examples->PDM, run Example1_MicrophoneOutput.
    1. Try whistling or speaking to change the highest frequency.
  7. Hook up the battery (Li-Ion, 3.7V 400mAh) to the Artemis board. The yellow LED should light up, indicating that the battery is being charged. Program the board to turn on the LED when you whistle, and off otherwise. Show that it continues to do so without being plugged into the computer.

Write-up

To demonstrate that you’ve successfully completed the lab, please upload a brief lab report (<800 words), with code snippets (not included in the word count), photos, and/or videos documenting that steps 3-7 work and what you did to make it happen.




Lab 1 (b): Virtual Machine Setup

Objective

The purpose of this lab section is to install a virtual linux desktop enviroment, capable of running robot simulations for future exercises in the course. Please be aware that there is no write-up for this portion of the lab.

Background

A virtual machine (VM) is an emulation of a computer system. It is a virtual environment that functions as a virtual computer system with its own CPU, memory, network interface, and storage, created on a physical hardware system.

In this course, we will be using VirtualBox, a virtualization software for running the virtual machine. It is a general-purpose full virtualizer and allows to run a virtual machine. We will be installing Ubuntu, a linux operating system, in our VM. Ubuntu (Robotics <3 FOSS) provides all the software dependencies required to run the robot simulator and the bluetooth module.

Terminologies

  • VM: Virtual Machine
  • OS: Operating System
  • HOST OS: The OS installed on your system
  • Guest OS: The OS that runs in a VM. In our case, we installed the Ubuntu OS as the Guest OS
  • FOSS: Full Option Science System
  • VirtualBox Menubar: The menubar in VirtualBox to configure the VM. [Ref]
  • OVA: An OVA file is an Open Virtualization Appliance that contains a compressed, “installable” version of a virtual machine. When you open/import an OVA file it extracts the VM and imports it into whatever virtualization software you have installed on your computer.

Setup Virtual Machine

  1. Download and install VirtualBox. (~ 150 MB)

    For MacOS users: If your installation fails, your OS might have blocked it. Check out this guide for a fix.

  2. Download the OVA file. (~ 3.8 GB)

    MD5 Checksum: bda9dcf71744302d4903038f69e9420c

  3. Start Virtualbox and click on “File -> Import Appliance”.
  4. Select the downloaded ECE4960.ova file and Click on “Next”.
  5. Select the “Base Folder” where you want to extract and store your VM disk.
  6. Set the “MAC Address Policy” as “Generate new MAC addresses for all network adapters”.
  7. Click on Import.

Note: If you already have Virtualbox installed in your system, please make sure the version >= 6.1.12. If it is an older version, you will need to update it.

Start your Virtual Machine

Click on “ECE4960” in the left pane and click on “Start” in the right pane.

Note: If you have issues starting up virtualbox or the VM, you may need to enable Virtualization in your PC BIOS. Here is a good guide to help you with that.

Ubuntu Login Credentials

  • Username: artemis
  • Password: artemis

VirtualBox Guest Additions

This step installs device drivers and system applications that optimize the guest operating system for better performance and usability. Before proceeding to other sections, it is recommended that you finish this step successfully.

  1. Once the VM is running, from the VirtualBox menubar select “Devices -> Insert Guest Additions CD Image”.

    NOTE: If you don’t see the menu bar, press the “Right Control/Command + Home” keys together on keyboard. Check out this page for reference.

  2. Click on “Run” in the dialog box in the VM.
  3. The guest additions install process is completed when the window displays “Guest Additions: “Press return to close the window…”. Now, press the Return key.
  4. Restart your VM. You can do this by clicking on the power button on the top right corner in the VM.

Change VirtualBox display settings

  1. Once rebooted, you may change the resolution of the virtual machine to match your computer screen accordingly.
  2. Click on the Settings icon in the ubuntu dock on the left of the desktop.
  3. Now click on “Devices” on the left pane in the Settings window and now you can change the resolution to match your computer screen settings under the “Displays” pane.
  4. You can also switch to full-screen mode by clicking on “View-> Full-screen mode” from the VirtualBox menubar. You can experiment with the other two modes available in the View menu and figure out a workflow that works best for you.

NOTE: If you don’t see the menu bar, press the Right Control/Command + Home button together on your keyboard. Check out this page for reference.

Setup a shared folder between the Guest OS and Host OS

You can set up a shared folder to share files/folders within it between your Host OS and VM.

  1. From the menubar, click on “Machine -> Settings”.
  2. Select “Shared Folders” in the dialog box. Click on the button.
  3. Select a “Folder path” in the host OS that you want to share with your VM.
  4. Select “Auto Mount” and “Permanent” and click on “Ok”.

You should now see a folder appear that on the desktop.

Tune your VirtualMachine

The VM is allotted a portion of your system resources (CPU, RAM, GPU, etc). You can tune these parameters to improve the VM performance. The VM is already configured with the minimum recommended settings. This step is to ONLY increase the system resource allocations if needed.

  1. Make sure your VM is shutdown.
  2. In VirtualBox, right click on “ECE4960” and click on Settings.
  3. Click on “System” in the left pane.
  4. In the “Motherboard” pane, increase the “Base Memory” slider to increase the alloted RAM.
  5. In the Processor pane, increase the number of alloted processors. You cannot allot more processors than what your system has.
  6. Select the “Display” option in the left pane.
  7. In the “Screen” pane, increase the “Video Memory” and select “Enable 3D Acceleration”.
  8. Make sure to press “OK” after making your changes.

NOTE: If your VM still feels a bit choppy, contact Vivek.

Free-up Disk Space

Once your VM is up and running, you may delete the ECE4960.ova if you need to free-up some disk space in your system.

References:

  1. More VM Info
  2. Enable Viirtualization in your PC Bios
  3. Guest Additions
  4. Shared folders
  5. What is Ubuntu?
  6. More Virtualization Terms
  7. Where is the VirtualBox menu bar?