0% found this document useful (1 vote)
101 views4 pages

ME 115 - Instrumentation and Measurement Laboratory Fall 2013

This document provides instructions for Experiment 1 of an instrumentation and measurement laboratory course. The objectives are to become familiar with the Arduino microcontroller board and write simple programs. Students will connect an Arduino board to their computer and write programs to light LEDs using different digital pins in various patterns. They will also connect a photocell in a voltage divider circuit to read light levels with an analog input pin and adjust an LED brightness accordingly.

Uploaded by

Raúl Cipriano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
101 views4 pages

ME 115 - Instrumentation and Measurement Laboratory Fall 2013

This document provides instructions for Experiment 1 of an instrumentation and measurement laboratory course. The objectives are to become familiar with the Arduino microcontroller board and write simple programs. Students will connect an Arduino board to their computer and write programs to light LEDs using different digital pins in various patterns. They will also connect a photocell in a voltage divider circuit to read light levels with an analog input pin and adjust an LED brightness accordingly.

Uploaded by

Raúl Cipriano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

ME 115 Instrumentation and Measurement Laboratory

Fall 2013

Experiment #1: Simple LED


Objective: Become familiar with the Arduino microcontroller board and related components.
The student should be able to write, load, and execute simple Arduino programs.
Background: The Arduino microcontroller board will be the hardware foundation for the
majority of experiments performed in this class. Become familiar with the major components of
the board including the USB connection, reset button, LED, digital I/O ports pins (0-13), Analog
inputs (0-5), GND (ground), Vin (unregulated voltage), and 5V and 3.3V power pins. For those
of you not familiar with the breadboard layout, horizontal rows are electrically connected on
either side of the vertical centerline of the breadboard.
The student should connect the Arduino board to the computer via the USB connection. The
Arduino programming environment should be opened. From the pull-down menu select the
proper board and proper serial port. You should now be prepared to load and run programs using
the serial monitor as your display window.
After the experiment description is a pictorial guide of all the components that you need to
perform this experiment. Please note that the pictures may not be identical to the items supplied
in your kits due to supplier/manufacturer variations. Please refer to these descriptions for any
specifications needed.
Experiment 1a: Identify and pull a green LED. From your lecture notes, sketch below the
schematic symbol for the LED and indicate the cathode and anode.

The polarity of the LED is indicated with lead length and/or a flat on the case. What polarity
does the short lead (flat) indicate?

Because the diode when forward biased essentially has no resistance, a current limiting resistor is
placed in series with the LED to limit the current through the device to a safe level. A nominal
current rating for many LEDs is 20 ma. Using Ohms law, E=IR, solve for the minimum
resistance value to use, assuming the supply voltage is 5 volts. Remember to account for the
voltage drop across the LED (refer to the table at the end of the hand-out).
R = E/I;

R=_______Ohms

Select the closest resistance value that exceeds the minimum. Color code of the
resistor:__________________________________________

Using the P8 port, draw the schematic of the circuit including the GND connection and the
polarity of the diode. Does the resistor need to be placed in any particular position? Explain.

Write a program to alternately turn on/off (3 seconds on/1 second off) the P6 port (LED) for 5
cycles.
Modify the program and the circuit to now include a red LED utilizing P9 for control. The green
LED should go on for 4 seconds and then turn off, the red LED then instantly (no pause) lights
up for 2 seconds and then turns off. Repeat for three cycles. Sketch the schematic below.
Demonstrate both programs to the instructor.

Program___/5

Circuit___/5

In order to measure variable quantities, the Arduino board utilizes the analog inputs in
conjunction with the AnalogRead( ) command. Many electrical sensors/transducers change
resistance in response to an external stimulus. You will be introduced to these types of devices
which include thermistors, RTDs (resistive temperature device), strain gages, and photocells in
future experiments. In this case we can put the variable resistance device in series with a fixed
resistor to create a voltage-divider between 5V and GND, and read the voltage between the fixed
and variable resistor into n analog input.

Experiment 1b: Identify and select the Cadmium-Sulfide (CdS) photocell. The specifications
indicate that the dark resistance is approximately 20 Mwhile the light resistance is less than
1kPlace the photocell in series with a 10 kresistor between 5V and GND, as seen in the
circuit digram below Using the AnalogRead( ) command, write a short program to read the
output from the photocell and then output the value to the serial monitor to read. Once program
is running, cover the photocell with your hand and note the change in the display value.

5V
+V
Sensor

10k

Demonstrate the operation of the program and circuitry to the instructor.


Program___/5

Circuit___/5

Combine the programs from Experiments 1a and 1b to construct an LED light-meter. A single
LED should shine brightly when the room is dark and dimly when the room is bright, and vary
linearly and continuously between the two states. Review the AnalogWrite ( ) command to
achieve this. Be sure the LED is attached to a pin labeled with PWM.
Display the new program and demonstrate to the instructor.
Program___/5

Order

Circuit___/5

Part Number

Fig.

Retail

Emit-

Epoxy

Chip M

Vf

Full

Price
(Volume
Discount
Available)

Mark

ted
LED
Color

Lens
Color

A
Material
X

(mA)
typ

(mcd)
typ

(V)
typ/
max

(nm)

(nm)

Viewing
Angle
(2 )

High-Efficiency LEDs
L200TR6B

UL Red

Red Dif

GaAlAs

20

200

1.7/2.6

660

20

55

L200TR5B

HE Red

Red Dif

GaAsP/GaP

20

60

2.0/2.6

635

45

55

L200TO4B

Orange

Orng Dif

GaAsP/GaP

20

80

2.0/2.6

610

35

55

L200TY5B

Yellow

Yel Dif

GaAsP/GaP

20

135

2.1/2.6

585

35

55

L200TG5B

HE Green

Grn Dif

GaP/GaP

20

68

2.2/2.6

568

35

55

L200TPG5B

Pure Grn

Grn Dif

GaP

20

30

55

L200TUB500-3.8V

UL Blue

Blue Dif

InGaN/Sic

20

65

55

430

Large high resistance CDS cell with surface dipped in clean epoxy to help keep out moisture.
Actual Size

Size of cell is 1" x .85". Dark resistance over 25Mohm- Light resistance less than 1Kohm.

Large High Resistance CDS Cell

Figure A.
L200T (Diffused
Dome)

You might also like