Purpose:

Learning to use the Arduino is sort of like walking into a large manufacturing factory and trying to learn how it works. There are so many options and possiblities that it is a little overwhelming. There are many way to start and the skills you learn for one task often apply in unexpected ways to other tasks. A common place to start is with hooking up and controlling an external LED. This embeds concepts from PH212 and courses you haven't taken yet. It gives you an introduction to some of the ways in which you can overstress your Arduino and it teaches you about some important hardware concepts.

Parts of this lab require demonstration of your ability to make your circuit perform particular tasks. I will keep a checklist of these demonstrations. Either show me or have two students initial my checklist as witnesses.

Procedure:  

It seems crazy to write whole new curriculum for this class when there are so many great reasources available online. It is likely that the links embedded in this lab and others will expire at inconvenient times so be prepared to chase down similar links if I haven't been able to keep them updated.

1) Here are the three (3) Adafruit lessons I want you to complete this week. Most of Lesson 1 and 2 you have already done so it's less than it looks. I am adding a performance detail to the external LED circuit (#2) that you need to control the brightness of the LED using PWM via the analogwrite() function.

https://learn.adafruit.com/adafruit-arduino-lesson-1-blink

https://learn.adafruit.com/adafruit-arduino-lesson-2-leds

https://learn.adafruit.com/adafruit-arduino-lesson-3-rgb-leds

2) To complete these lessons you will need to understand a number of things which are linked on the Adafruit lessons. These include how a breadboard is interconnected, how to determine what resistance a resistor has (I'm not expecting you to memorize the color codes) and what they look like, what LED's are and why polarity is important (which leg is positive), what the role of the resistor is in these LED circuits (see next section). Most of this will be a review of what you did with the Blinky sketch the first week.

3) Start by looking at the tech specs for the Arduino Uno (linked here). Now open these links to typical data describing how LED's behave. These are referred to as the I/V curves and the brightness vrs current curve. Understanding what these curves tell us is an important engineering skill. Here are some questions to consider:

Increasing the voltage drop across an LED by 10% increases the current by how much?

Increasing the current by 50% increases the luminosity (brightness) by how much?

What is the maximum current the I/O pin on the Arduino can safely provide?

4) Knowing that the Arduino provides 5 V to the output of a digital pin what is the minimum resistance that you must provide to protect the Arduino from damage (just a resistor)?. How does this change if the LED is providing a 1.8 V drop? Does this depend on the specific LED? What resistor is needed to provide 10 mA of current through the LED described by this tech spec? Be aware that this will feel a lot like guess and check - why is that?

LAB Deliverables:

1) Demo: Demonstrate that you can control to brightness of a single LED using the analogwrite() function. Demonstrate that you can choose the order of the colors of your LED's that are cycling. Turn on more than one simultaneously as requested.

2) Document/Turnitin: Explain why 300 Ω is a reasonable value for the current limiting resistor for a standard LED both to protect the Arduino outputs and make the LED reasonably bright. Show your calculations which will, of course, reference the maximum current for output pins indicated in the tech spec for your Arduino board.

3) Document/Turnitin: What is the difference between the digital and analog output pins on the Arduino? You may need to google this or it may be buried in the Adafruit tutorials somewhere. Which pins on your Arduino are dedicated digital or analog pins?

4)Document/Turnitin: Include your commented code for the RGB LED. Is your RGB LED a common cathode or common anode LED? How do you know?

LAB Resource Page:

This link (above) provides a central location for documents and links specifically relevant to this lab.

More general resources for this course and the lab are accessible from the Web Resources page.