Labs

The labs are step-by-step exercises to demonstrate the techniques covered in the Lessons. There are also videos that go along with these labs. The videos and topic pages related to each lab are linked within each lab page for further reading or viewing.

There is a lab activity for nearly every class in the first half of the semester.  The labs contain the basic steps you need to go through to understand the technical concepts covered in class that week. You should complete the steps outlined in the lab activity before class each week, so that you understand practically what it is we’re talking about.  Document your lab work on your blog. Include any insights or problems, and details not covered in the class or the lab that you think will be useful for your fellow students and future students in this class.

There are also many labs for topics not covered in the syllabus. Think of all the labs as recipes for techniques that you might need in your projects.

Electronics

  • Lab: Components
    In this lab you will learn about some of the components you’ll use frequently when making electronic circuits.
  • Lab: Electronics
    This lab will introduce you to a few basic electronic principles by trying them in action. You’ll learn how to measure voltage, amperage, and resistance using a multimeter. You will also learn about components in series vs. parallel and be introduced to Ohm’s Law in practice.
  • Lab: Setting Up A Breadboard
    This lab shows how to set up a breadboard with an independent power supply (9-12V) through a 5V Voltage Regulator (7805).
  • Lab: Soldering
    In this tutorial you’ll learn the basics of soldering for electronics.
  • Lab: Switches and Pushbuttons
    In this lab you will learn about different types of switches and their terminology
  • Lab: Level Shifting
    In this lab you’ll learn about converting voltage levels to make components communicate better.

Arduino Fundamentals

  • Labs: Arduino Digital and Analog
    The following labs introduce Digital and Analog Inputs and Outputs to and from the Arduino.
  • Lab: Digital Input and Output with an Arduino
    In this lab, you’ll connect a digital input circuit and a digital output circuit to a microcontroller. Though this is written for the Arduino microcontroller module, the principles apply to any microcontroller.
  • Lab: Analog In with an Arduino
    In this lab, you’ll learn how to connect a variable resistor to a microcontroller and read it as an analog input. You’ll be able to read changing conditions from the physical world and convert them to changing variables in a program.
  • Lab: Tone Output Using An Arduino
    In this tutorial you’ll learn how to generate simple tones on an Arduino
  • Lab: Servo Motor Control with an Arduino
    In this tutorial, you’ll learn how to control a servomotor’s position from a microcontroller using the value returned from an analog sensor.
  • Lab: Sensor Change Detection
    In this lab you’ll learn some methods for determining when a sensor’s reading changes significantly.

Arduino not-so-Fundamentals

  • Lab: OLED Screen Display using I2C
    Many common electronic devices feature small screens for status updates, control feedback, and so forth. These displays feature many different technologies. Lately, one of the most common is the OLED display. These displays are matrices of organic LEDs, each pixel being comprised of one to three LEDS. Small displays typically use either the SPI ...
  • Lab: Controlling a Stepper Motor With a Step and Direction Driver
    Introduction In the stepper motor and H-bridge lab, you learned how to control a stepper motor with a dual H-bridge driver, specifically the TB6612FNG. This is not the only driver for controlling a stepper. Step & direction stepper drivers offer a simpler approach, from the microcontroller side. They have just two control pins, one for step ...
  • Lab: Using a Real-Time Clock
    In this lab, you’ll learn how to use a real-time clock on a microcontroller.

Sensors

  • Lab: Components
    In this lab you will learn about some of the components you’ll use frequently when making electronic circuits.
  • Lab: Analog In with an Arduino
    In this lab, you’ll learn how to connect a variable resistor to a microcontroller and read it as an analog input. You’ll be able to read changing conditions from the physical world and convert them to changing variables in a program.
  • Lab: Sensor Change Detection
    In this lab you’ll learn some methods for determining when a sensor’s reading changes significantly.
  • Lab: I2C Communication With An Infrared Temperature Sensor
    In this lab, you’ll see synchronous serial communication in action using the Inter-integrated Circuit (I2C) protocol. You’ll communicate with an infrared temperature sensor chip from a microcontroller in order to read the temperature of an object in front of the sensor.
  • Lab: I2C Communication With a Color, Gesture, and Proximity sensor
    In this lab, you’ll see synchronous serial communication in action using the Inter-integrated Circuit (I2C) protocol. You’ll communicate with a color, gesture, and proximity sensor from a microcontroller.
  • Lab: I2C Communication with a Time-of-Flight Distance Sensor
    Introduction In this lab, you’ll see synchronous serial communication in action using the Inter-integrated Circuit (I2C) protocol with a time-of-flight distance sensor and a microcontroller. Many different sensors on the market use the I2C protocol to communicate with microcontrollers. It is the most common way to connect to advanced sensors these days. The VL53L0X used in this lab ...
  • Lab: Serial IMU Output to p5.js Using p5.webserial
    In this exercise you’ll read the built-in Inertial Motion Unit on the Arduino Nano 33 IoT, then feed its output into a Madgwick filter to determine heading, pitch, and roll of the board. Then you’ll send the output of that serially to p5.js and use it to move a virtual version of the Nano onscreen.
  • Lab: Ultrasonic Distance Sensor
    The HC-SR04 distance sensor is an inexpensive and ubiquitous distance sensor that gives reasonably reliable distance readings in the 2cm – 4m range. In this lab, you’ll learn how to use this sensor with an Arduino microcontroller.
  • Lab: Using a Rotary Encoder
    In this lab, you’ll learn how to use a rotary encoder as an input to a microcontroller.

Serial Communication

Asynchronous Serial

  • Labs: Serial Communication
    The following labs are about communicating serially between your Arduino and other devices. Fundamentals p5.js webserial library p5.js serialport library
  • Lab: Intro to Asynchronous Serial Communications
    In this lab, you’ll get to know serial communication from a microcontroller to your personal computer a bit more in depth, so that you’re ready to start writing programs in other languages on your computer to interact with our microcontroller.

p5.js webserial library

  • Lab: Serial Input to p5.js Using the p5.webserial Library
    This lab uses a p5.js library called p5.WebSerial to make it easy in p5.js. In this lab, you’ll generate an analog output value from a potentiometer, then send that value via asynchronous serial communication to P5.js. You’ll use that value in P5.js to draw a graph. Web browsers have traditionally been designed to be separate from the ...
  • Lab: Serial Output From p5.js Using the p5.webserial Library
    In this lab you’ll learn how to send data from p5.js to a microcontroller using asynchronous serial communication. Overview When you use the p5.webserial library for P5.js, it uses the W3C’s WebSerial API to allow your browser to communicate with serial ports on your computer. This lab shows you how to use P5 to control ...
  • Lab: Two-Way (Duplex) Serial Communication Using An Arduino and the p5.webserial Library
    Introduction In the Introduction to Asynchronous Serial Communication lab, you learned about various methods for managing the communications between computers via asynchronous serial communication. These included formatting your data as ASCII-encoded strings or raw serial bytes and managing the flow of data using handshaking. In the P5.js WebSerial Input Lab, you sent data from one sensor to ...
  • Lab: Serial IMU Output to p5.js Using p5.webserial
    In this exercise you’ll read the built-in Inertial Motion Unit on the Arduino Nano 33 IoT, then feed its output into a Madgwick filter to determine heading, pitch, and roll of the board. Then you’ll send the output of that serially to p5.js and use it to move a virtual version of the Nano onscreen.

p5.js serialport library

Processing

node.js

  • Lab: Serial Input to an Arduino from Node.js
    In this lab, you’ll send asynchronous serial data from your personal computer to an Arduino microcontroller in order to control a digital output of the microcontroller. Once you’ve done that, you’ll also learn how to interpret ASCII-encoded numeric strings on the Arduino.
  • Lab: Serial Communication with Node.js
    In this lab you’ll connect a microcontroller to a web browser using the node.js programming environment, HTML, and JavaScript.
  • Lab: Arduino and p5.js using a Raspberry Pi
    For some applications, you only need a computer with an operating system in order to connect a serial device like an Arduino or other microcontroller with a browser-based multimedia application like p5.js. This page introduces how to do it using node.js, p5.serialserver, and a Raspberry Pi.

Synchronous Serial

I2C

  • Lab: I2C Communication With An Infrared Temperature Sensor
    In this lab, you’ll see synchronous serial communication in action using the Inter-integrated Circuit (I2C) protocol. You’ll communicate with an infrared temperature sensor chip from a microcontroller in order to read the temperature of an object in front of the sensor.
  • Lab: I2C Communication With a Color, Gesture, and Proximity sensor
    In this lab, you’ll see synchronous serial communication in action using the Inter-integrated Circuit (I2C) protocol. You’ll communicate with a color, gesture, and proximity sensor from a microcontroller.
  • Lab: I2C Communication with a Time-of-Flight Distance Sensor
    Introduction In this lab, you’ll see synchronous serial communication in action using the Inter-integrated Circuit (I2C) protocol with a time-of-flight distance sensor and a microcontroller. Many different sensors on the market use the I2C protocol to communicate with microcontrollers. It is the most common way to connect to advanced sensors these days. The VL53L0X used in this lab ...
  • Lab: OLED Screen Display using I2C
    Many common electronic devices feature small screens for status updates, control feedback, and so forth. These displays feature many different technologies. Lately, one of the most common is the OLED display. These displays are matrices of organic LEDs, each pixel being comprised of one to three LEDS. Small displays typically use either the SPI ...

SPI

MIDI

Motors

USB

Mouse

  • Lab: Mouse Control
    In this lab, you’ll build an alternative computer mouse using any of the USB-native boards. You’ll also learn some techniques for determining when a user takes a physical action.
  • Lab: Mouse Control With Pushbuttons
    In this lab, you’ll build an alternative computer mouse using an Arduino Leonardo using pushbuttons to move the mouse left, right, up and down. You’ll see the difference between reading a digital input continually and reading for a change of state.
  • Lab: Mouse Control With Joystick
    In this lab, you’ll build an alternative computer mouse using an Arduino Leonardo using a joystick to move the mouse left, right, up and down. You’ll use the joystick’s select button to replace the mouse button as well.

Keyboard

  • Lab: Keyboard Control
    In this lab, you’ll build an alternative computer keyboard using any of the USB-native boards

Bluetooth

  • Lab: Bluetooth LE and p5.ble
    This exercise introduces you to how to communicate between a Bluetooth LE-equipped microcontroller and p5.js using the p5.ble library.