All posts by Allison Lassiter

Lab 2: Sensors

In this lab you will work with four different sensors. You will sense touch (two different ways), then light intensity, then temperature. After, you’ll look around on the internet for other types of sensors — what sensors are you most interested in?

1. Follow the exercise for Circuit 2, Potentiometer, in your Vilros Ultimate Starter Kit Guide.

2. In a few sentences, describe how the potentiometer works. Why is the light intensity changing as you turn the knob? (2 points)

3. This is the first time you’ve used an Analog In pin. In a few sentences, describe the difference between the digital and analog pins. (2 points)

4. Follow the exercise for Circuit 5, Push Button.

5. In a few sentences, describe how the buttons work.  Why does the light go off when you depress both buttons? (2 points)

6. Take a quick (< 15 sec video) of Circuit 5, showing what happens as you push the buttons. (2 points)

7. Follow the exercise for Circuit 6, Photo Resistor.

8. In a couple sentences, describe how the photo resistor works. Is it more similar to the potentiometer or push buttons? (1 point)

9. Take a photograph of your completed Circuit 6. (2 points)

10. Follow the exercise for Circuit 7, Temperature.

11. Take a photo or screen grab of your serial monitor showing temperature readings. (2 points)

12. What is a serial monitor? (1 point)

13. Search the internet for more Arduino sensors. You may want to start by scrolling through this page. Find 2 sensors that you would be interested in using.

14. For each sensor, submit (6 points):

    • The name of the sensor
    • A link to where you can buy the sensor
    • A link to some sample code/tutorial that helps you figure out how to use the sensor.
    • What does the sensor do? (2-3 sentences)
    • In looking at the sample code, do you understand what’s going on? If you bought the sensor, what would you need to learn in order to get it going? (1 paragraph)

Note: finding sample code will take some digging around. You may want to start saving links to code that you find helpful. I use Evernote for this sort of stuff.

15. Post answers to the questions + videos on bSpace under Assignments > Lab 2. Be sure to hit the submit button.

 

Lab 1: LEDs

You’ll start this lab by reading about some basics of the Arduino board. Then you’ll dive into LEDs. You’ll use an RGB LED and you’ll look at the multiple LED sketch again (the same one we used in class). Finally, you’ll combine an RGB with multiple LEDs.

1. Get to know your Arduino better. Read the excerpt from Chapter 1 and 2 of Arduino for Dummies posted on bSpace under Resources.

2. Skim the the beginning of the instruction book that comes with your starter kit.

3. Download the code on www.vilros.com/uskcode, as described by the instruction book. (You have to register, but the good news is that they don’t seem to send spam email.)

4. Follow the exercise for Circuit 3, RGB LED. Look at the two function calls inside of void loop() — you’ll see mainColors() and showSpectrum().

Comment out (i.e., insert two forward slashes, //) before mainColors(). Upload the code again. How does the display change?

Replace showSpectrum() with showRGB(0).  What happens? Change the number inside the parentheses — what does showRGB(200) look like? showRGB(500)? showRGB(767)?

5. Revisit Circuit 4, Multiple LEDs. (Note: the Vilros code is identical to the code I provided on bSpace.) Carefully read the code, including all of the comments. Do you understand how it works? How can you change the pattern of the blinking lights?

6. Combine the RGB LED and at least two additional simple LEDs . Write a new sketch that makes the lights blink sequentially.  Any blinking pattern is fine. You may re-use code from the from the Circuit 3 and Circuit 4 examples.

7. Write a short paragraph stating what your project does. (3 pts)

8. Save your Arduino sketch. Be sure to annotate your code with comments, like you saw in both the RGB and Multiple LED sketches. What do the different pieces of your sketch do? (10 points)

9. Create a short (< 30 sec) video of your project. (7 points)

10. Please submit your work on bSpace under Assignments, Lab 1. You will turn in a total of 3 files, as described in steps 7, 8, and 9. Be sure to click the “submit” button when you are done uploading your work. After, you will receive a confirmation email from bSpace.

Resources

The sky’s the limit! Just like it is for this Arduino-equipped weather balloon. Source: http://maxdarham.com/images/IMG_0551_lightbox.jpg

As you start getting into Arduino, you may want to expand beyond the class.  Here’s some ideas on where to go.  Feel free to add to this list in the comments.

Learn:

Hack:

Shop:

Get inspired:

Getting Started

  1. Buy the Arduino Uno Ultimate Starter Kit ($55 on Amazon, or purchase elsewhere)
  2. Install the Arduino IDE (Arduino 1.0.5) on your laptop
  3. Read this short, prescient article written by Mark Weiser in 1996 on ubiquitous computing: Weiser_OpenHouse
  4. Reflect on lecture and the Weiser article. Is there value in a digital, electronically-enabled landscape? What opportunities do you see? What cautions? Be prepared to discuss in Week 2 (9/5).
  5. Bring your laptop to class on 9/5