Assignments

Lab Assignments

There are lab assignments for many weeks of the semester. These are practical exercises that will help you to learn the technical material of the class. Each week you should review the topic notes or videos explaining that week’s materials, then do the labs, and write about your progress, your failures, and your questions. Class time most weeks will start with your questions and progress from the labs.

Project Assignments

Following are several suggestions for the project assignments. They are marked according to which skills they require, and therefore which project they are most appropriate for.

Project 1

This project should demonstrate the following technical skills:

Suggestions for Project 1:

Combination Lock

A combination lock responds after the user performs a specific sequence of actions, like pressing buttons in a sequence, or turning a knob to a series of pre-determined positions in a sequence. For example, think about the typical hotel room safe. When it’s open, you close the door, enter a code, press the enter button, and the safe locks. When you enter the code a second time, the safe unlocks. Closing the door and entering a new code resets the lock. On some safes, you can simply press enter again to use the same code.

The simplest of combination locks typically use a sequence of four or five buttons. To make it work, you have to detect when the button changes its state from pressed to released, or vice versa.

Your combination lock doesn’t have to open a lock. It could turn on a light when the sequence is entered successfully, or play a tune on a speaker. It should be possible to reset the device once it’s done its task, however, like the example above. Your device doesn’t have to just use buttons, either. You can use any sequence of physical actions that you know know how to sense in order to activate your lock.

Musical Instrument (Tone)

Make a simple musical instrument. Your instrument should be able to control pitch and to start and stop a pitch. It does not have to control more than one pitch at a time.

Consider a few things in designing your instrument:

  • Do you want to play discrete notes (like a piano), or sliding pitches (like a theremin)? How do you program to achieve these effects?
  • Do you want to control the tempo and duration of a note?
  • Do you want the same physical action to set both the pitch and the velocity (volume) of a note?
  • Do you want to be able to play more than one note at a time (e.g. chords)?

All of these questions, and many more, will affect what sensors you use, how you read them, and how you design both the physical interface and the software.


Project 2

Project 2 will depend on you already having learned the skills from project 1. It should also demonstrate the following skills:

Suggestions for Project 2:

Media Controller (Serial)

Make a music or video playback controller. Your controller should be able to start, stop, and pause the playback of a media file, to fast-forward, to rewind, and to control the volume.

You can make this controller and the media player in p5.js and control it using asynchronous serial communication, or you can control it using Keyboard and Mouse controls.

This is a good project to get comfortable with asynchronous serial communication.

Game Controller (Serial)

Make a game controller. The most minimal controllers have very few controls. Consider WASD controllers, for example, in which the keys W, A S, and D control 2-dimensional movement on a screen. Or joystick controllers, where a 2-axis joystick and a pushbutton support all the action onscreen. The fun of a good controller is when you can perform complex behaviors with a limited amount of control.

Make a game in p5.je. or use an existing game like Pong.

Your controls should be arranged so that the player can watch the screen, not concentrate on the controls.


Project 3

Project 3 will depend on you already having learned the skills from project 1 and 2. It should also demonstrate the following skills:

  • Microcontroller-to-PC communication, through one of the following:
  • Physical interaction design principles
    • Is the interface understandable to the participant with minimal instruction? Do they know what to do by looking at, listening to, or touching the interface?
    • Can someone besides you use it?
    • Can it be started, stopped, and reset without your intervention
    • Make the interaction iterative. In other words, it’s not just one action by the participant, but they read the interface, take action, read the device’s response, and take another action, in a continued loop.
  • Construction principles
    • Does it have a housing so that the controls, not the electronics, are exposed?

You can improve on one of your previous projects for this project, or you can start a new project. Don’t make the project larger in scope than the previous two, though, as you won’t have time to complete it if it’s too large or complex a project.

SUGGESTIONS FOR PROJECT 3:

Any of the project 1 or 2 suggestions would also be good ideas for project 3, and here are a few other ideas.

Game Controller (USB HID)

Make a game controller. The most minimal controllers have very few controls. Consider WASD controllers, for example, in which the keys W, A S, and D control 2-dimensional movement on a screen. Or joystick controllers, where a 2-axis joystick and a pushbutton support all the action onscreen. The fun of a good controller is when you can perform complex behaviors with a limited amount of control.

You do not have to make the game. You can use any pre-existing game that can be controlled by Mouse or Keyboard, since your microcontroller (Nano 33 IoT) can be programmed to operate as a mouse or keyboard. Consider browser-based games, like Lunar Lander. Here’s a different version of Lunar Lander. Consider controlling Zoom.

Your controls should be arranged so that the player can watch the screen, not concentrate on the controls.

This project will most likely rely on USB HID communication using the Keyboard or Mouse libraries. Take a look at the USB HID labs for ways to do it.

Musical Instrument (MIDI)

Make a MIDI musical instrument. Your instrument should be able to control pitch and volume and to start and stop a pitch. It should also be able to play chords; that is, to play multiple notes at the same time.

This project requires some understanding of music, and MIDI. Take a look at the MIDI labs for ways to do it.

Sensor Datalogger and Visualizer (SPI, I2C SD Card)

Capture a time lapse with sensors and create a visualization or sonification that represents the changes over time.

There are many changes that are too slow for us to observe without lots of patience, but which give us good insights when we see their patterns played back in a time-lapse. For example, a graph of changes in the light in a space can tell us about the seasonal changes, or the human activity. Temperature changes can tell us how crowded a place is at different times of days. Air quality sensor readings over time can give us a picture of when production activities happen in a shop. Motion sensors graphed over time can show us traffic patterns of a space over the course of a day.

Pick a sensor that can measure changes in an environment and write a program that will take readings on a set interval and record them. Then find a way to present the readings in order to show the patterns of change over time. That might be as simple as a graph of the change over time generated by a spreadsheet, or it might be a sound program that converts the changes to pitches and plays the changes musically over time. Pick a way to represent the data that lets the viewer read and understand the changes that they can’t see in real-time.

You could capture the data by :

  • Sending sensor data from an Arduino to your laptop over a few hours, and leaving the laptop alone (but secured).
  • Sending the sensor data as USB keystrokes to your laptop over time and saving them to a file (command-S is also a keystroke)
  • Recording data to a file on an SD card from an Arduino, then reading that data in p5.js

This project is a good project to combine asynchronous serial communication and data visualization in p5.js. Alternatively, it can be a good way to learn about reading and writing from files on an Arduino and in p5.js.

Gesture Controller (Bluetooth LE)

Make a controller that is controlled by large physical gestures. Examples:

  • a media control device that responds to swiping your hand left and right.
  • a game controller that responds to swordplay movements of your arm.
  • a musical controller that responds to particular hand signals.

Your controller should be able to start and stop a particular output repeatably and reliably. For example, if you’re making the media controller mentioned above, it should be able to play, pause, fast forward, rewind, and stop with distinct gestures.

Since you’re using large physical gestures, this project is most likely best done using Bluetooth LE communication to the personal computer, to avoid wires.

This is a more advanced version of the media controller or musical instrument projects, in that it requires you to read sensor data, understand the patterns of the changes in that data, and write a program to send control messages when those patterns are detected.