25.108 Intro To Engineering II for ECE: Erin Webster and Jay Weitzen, c 2012 all rights reserved
Lab 1: Lights On – Lights Off Objectives of Lab 1: ‐ ‐ ‐ ‐ ‐
To learn how to perform basic functions such as measure voltage and observe waveforms on the ADI discovery module. To learn to use the basic stamp editor and debugger to write a simple program to flash LED’s on and off To learn about the function of Light Emitting Diodes (LED), and current limiting resistors To learn to read resistor color codes To begin to translate schematic diagrams into actual hardware
Before You Come to Lab: ‐ ‐
Download and read chapter 1 in “What’s a micro‐controller” (WAM) Attend Microcontroller Lecture 1 and watch the introductory video’s on using the ADI module and the Basic Stamp microcontroller
Important Things to Remember: ‐ ‐ ‐ ‐
Do all wiring with the power to the Basic Stamp shut off Never connect a wire directly between Vdd and Vss Positive: Vdd = 5V Negative: Vss = 0V (ground)
Section 1: Wiring a Light Emitting Diode Build Circuit 2‐6 shown below, and on p.43 in the WAM book:
A
B
C
Student Name:
Date:
TA Initials:
25.108 Intro To Engineering II for ECE: Erin Webster and Jay Weitzen, c 2012 all rights reserved
LED polarity http://blog.makezine.com/2012/02/22/ask‐make‐modding‐vacuum‐tubes‐with‐leds/
Using the ADI Discovery Module, make the following measurements:
Plug the Discovery into the computer’s USB Port and open WaveForms Make sure the software sees a Module and is not running in demo mode and select the Oscilloscope under Analog > Scope:
Make the following time and voltage division selection in the right pane of the scope
Student Name:
Date:
TA Initials:
25.108 Intro To Engineering II for ECE: Erin Webster and Jay Weitzen, c 2012 all rights reserved
To measure the voltage, VAC, connect the positive lead (1+) lead into Point A and the negative lead (1‐) lead into Point C Choose the single run button in the scope page Draw the result on the graph below and label it VAC Repeat with the positive lead at Point B and the negative lead at Point C, label it VBC Repeat with the positive lead at Point A and the negative lead at Point B, label it VAB Repeat with the positive lead at Point C and the negative lead at Point A, label it VCA
The oscilloscope graphs voltage vs. time, a flat line means the voltage at the point is steady (DC). VAC
VBC V
VAB V
VCA V
V
Note: Voltage is abbreviated to the unit symbol V
Compare VAC, VAB, and VBC: What do you notice about their relationship? Compare VAC and VCA: What do you notice about their relationship?
Student Name:
Date:
TA Initials:
25.108 Intro To Engineering II for ECE: Erin Webster and Jay Weitzen, c 2012 all rights reserved
Section 2: LED Off Build Circuit 2‐9 shown below, and on p.46 in the textbook:
A
B
C Using the ADI Discovery Module, make the following measurements:
Using the Discovery’s Oscilloscope 1, record VAC, VBC and VAB:
VAC
VBC V
VAB V
V
Explain these results:
Student Name:
Date:
TA Initials:
25.108 Intro To Engineering II for ECE: Erin Webster and Jay Weitzen, c 2012 all rights reserved
Section 3: Basic Stamp Controlled LED Build Circuit 2‐11 shown below, and on p.48 in the textbook:
A
B
C Program the Basic Stamp, reference p. 48‐49: Connect the Basic Stamp Board to the computer’s USB port Open the Basic Stamp Editor Select the BS2 Basic Stamp and the PBasic version 2.5
Enter the code shown below and save the program as LedOnOff.bs2
Basic Stamp Board should be on and connected to the computer: to check select: Run > Identify
To program and run the Basic Stamp select: Run > Run
Student Name:
Date:
TA Initials:
25.108 Intro To Engineering II for ECE: Erin Webster and Jay Weitzen, c 2012 all rights reserved Using the ADI Discovery Module, make the following measurements: Using the Discovery’s Oscilloscope 1, record VAC(t) on the graph below (be sure to label
both the time axis and voltage axis)
Be sure to adjust your time division in order to be able to see the complete signal
The Discovery Module has two oscilloscope channels and for these measurements we will be using both Oscilloscope Channel 1 and Channel 2. Using two channels allows you to see 2 different signals at the same time and graphed on the same time domain. Measure VBC(t), with the Discovery Oscilloscope 2: use the positive lead (2+) and negative lead (2‐) and make the following changes in the voltage division pane:
Student Name:
Date:
TA Initials:
25.108 Intro To Engineering II for ECE: Erin Webster and Jay Weitzen, c 2012 all rights reserved
This is a signal that will vary periodically with time, the amount of time it takes to complete a single full repetition is called the period and is represented by the symbol T and is measured in seconds. Frequency, represented by f, is the number of cycles per second and is the inverse of the period:
TAC
TBC s
fAC s
fBC Hz
Hz
Compare VAC(t) and VBC(t):
Compare these results to VAC and VBC from Section 1:
Student Name:
Date:
TA Initials:
25.108 Intro To Engineering II for ECE: Erin Webster and Jay Weitzen, c 2012 all rights reserved
Section 4: Blink the LED 10 Times Program the Basic Stamp, reference p. 54: Keep the circuit from Section 3 Enter the code shown below and save the program as LedOnOffTenTimes.bs2
Using the Discovery’s Oscilloscope 1, record VAC(t) o o o o
Adjust the time division of your scope to 2 seconds per division Select the continuous run on the scope Run the program on the Basic Stamp Stop the Scope after the 10 cycles are completed
Student Name:
Date:
TA Initials:
25.108 Intro To Engineering II for ECE: Erin Webster and Jay Weitzen, c 2012 all rights reserved
Section 5: Two LEDs with the Basic Stamp Build Circuit 2‐14 shown below, and on p.58 in the textbook:
A
B
C Program the Basic Stamp, reference p. 59: Enter the code shown below and save the program as FlashBothLeds.bs2
Using the ADI Discovery Module, make the following measurements: Use Oscilloscope 1 to measure VAC(t), and Oscilloscope 2 to measure VBC(t), then record both in the graph below
Student Name:
Date:
TA Initials:
25.108 Intro To Engineering II for ECE: Erin Webster and Jay Weitzen, c 2012 all rights reserved
Modify the body of the DO LOOP, reference p.60:
Using the ADI Discovery Module, make the following measurements: Use Oscilloscope 1 for VAC(t), and Oscilloscope 2 for VBC(t), then record both in the graph below
Student Name:
Date:
TA Initials:
25.108 Intro To Engineering II for ECE: Erin Webster and Jay Weitzen, c 2012 all rights reserved Compare the two graphs of VAC(t) and VBC(t): Explain the how the oscilloscope signals relate to the how the LEDs light up:
Student Name:
Date:
TA Initials: