Blog

Object - Lab 2

 

Lab 2: Overview

In object this weeks lab, we are focusing more on the fundamentals of circuits while incorporating the the basic of programing our circuits to have certain functions. By learning how to construct a simple circuit to connect to an Arduino prototyping environment, we are working our way up to creating more complex physical computing programs.

Part 1: Building the Circuit

In part 1, we were tasked with creating the basic circuit on a breadboard then hooking up the necessary components to the Arduino board.  This exercise was intended to get us more practice in setting up circuits. We will be using two LED's and momentary button (Mom Butt) to create a flow of energy that allows the LED's to be turned on and off by the push of a button - this is considered an automatic user response (i.e. we know something happened when we pressed down on the momentary button).

Below is the circuit we will be constructing for the lab. The circuit is showing a direct relation between the 10K resistor and connection to an input pin (pin 2). We connect these at the same point of the button because we want our flow of energy to go through the 10k resistor down to ground while the 'switch' is closed; we would not want to go larger or smaller in resistance (to be explained). When the switch is open, the path of least resistance is through the momentary button allowing the flow of energy to switch its path. By doing so, the LED's will turn on in response to the energy taking the path of least resistance - this is why we would not want to go smaller with the resistor because it would take that path to ground instead. 

lab2-02.png

Furthermore the two LED's are connected to output pin's 2 and 3, this is to ensure we can properly program the circuit to switch between the turning the two light on and off, alternatively.

Below are the soldered elements:

IMG_7292.jpeg
IMG_7295.jpeg

Part 2: Program the Microcontroller

In part 2, we learned about programing a basic Arduino Uno microcontroller. The past couple weeks we learned a couple basic syntax and functions used within the Arduino prototyping environment. Followed are a couple of the functions we learned: 

  • pinMode - sets a specific pin to input/output
  • digitalRead - Reads the value from a specified digital pin, either HIGH or LOW.
  • digitalWrite - Write a HIGH or a LOW value to a digital pin that is set for output

Below is the program for lab 2 that switches between turing the two LED's to opposite values of HIGH or LOW by the push of the momentary button. Furthermore, we set the momButt to an input because that is what the program is listening for to tell the outputs to start their function (either turn on or off).

Screen Shot 2018-02-11 at 9.38.17 PM.png

Part 3: Laser Cut Enclosure

In part 3, we learned how to use the laser cutter to create our enclosures. The laser cutter can be managed by creating an .ai or PDF file in Illustrator or directly creating it in Rhino. I prefer using Illustrator. For the enclosure, I decided to create a 3in x 3in acrylic box that would showcase a pattern that I made that gave me access to press my Mom Butt and let my LED's illuminate. I call my enclosure the magic box. 

IMG_7307.jpeg
IMG_7301.jpeg
IMG_7303.jpeg
IMG_7302.jpeg

The final product: working video of the circuit and program within its enclosure: