+ All Categories
Home > Documents > Lab 8 Introduction

Lab 8 Introduction

Date post: 06-Jan-2016
Category:
Upload: gay
View: 45 times
Download: 1 times
Share this document with a friend
Description:
Lab 8 Introduction. Automatic Night Light. Write a program that will automatically control the brightness of a light based on the surrounding light level. DIODES. - PowerPoint PPT Presentation
14
Lab 8 Introduction
Transcript
Page 1: Lab 8 Introduction

Lab 8Introduction

Page 2: Lab 8 Introduction

Write a program that will automatically control the brightness of a light based on the surrounding light level.

Automatic Night Light

Page 3: Lab 8 Introduction

Diodes are “one-way” devices that only allow current to flow in one direction. An LED is a diode that emits light when sufficient current is flowing through it. Diodes are used in many, many applications such as:

• LED flashlights and light bulbs provide very bright light and use significantly less power than incandescent bulbs, last much longer than incandescent bulbs, and stay cool.

• Diodes are used in circuits to convert AC power to DC power (laptop chargers, phone chargers, appliances that run on dc …)

• LEDs are used in displays, signs, and traffic signals.

DIODES

Page 4: Lab 8 Introduction

When the positive side of a voltage source is applied to the anode (+) side of an LED, current will flow through the circuit and the LED will light up.

Light Emitting Diode (LED)

Anode (+) Anode (+)Cathode (-) Cathode (-)

When the positive side of a voltage source is applied to the cathode (-) side of an LED, current will not flow through the circuit and the LED will not light up.

CurrentFlows

No CurrentFlows

Page 5: Lab 8 Introduction

Analog Discovery DAQ

Analog OUT Channel:

The yellow wire labeled W1 and black ground wire labeled form an Analog OUT channel. OUT means out of the DAQ and applied to the circuit.

This output channel will be used to apply a voltage between 0 and 5V across the LED and 1 kΩ resistor.

Page 6: Lab 8 Introduction

Analog Discovery DAQ

Sample MATLAB Commands to Digilent:

DAQ.outputSingleScan(5)% Provides 5V across LED/Resistor

DAQ.outputSingleScan(2.5)% Provides 2.5V across LED/Resistor

Page 7: Lab 8 Introduction

• Photocells are sensors that detect the surrounding light level.

• The resistance of the photocell decreases as the surrounding light level increases.

• The photocells we will be using have a resistance of about 1 kΩ in bright light and a resistance of about 10 kΩ when it is completely dark.

Photocells

Page 8: Lab 8 Introduction

PHOTOCELLS

+VR_

Voltage Divider Rule:

In Bright Light:

In Complete Darkness:

Page 9: Lab 8 Introduction

Analog Discovery DAQAnalog IN Channels:

The two orange wires labeled 1+ and 1- form an Analog IN channel. IN means into the DAQ from hardware.

This input channel is our replacement for the multi meter. The orange wires will be placed across the 10 kΩ resistor to measure the voltage.

A smaller voltage reading for VR means it is darker around the photocellso we should make the LED brighter.

Page 10: Lab 8 Introduction

Analog Discovery DAQ

MATLAB Command to Read Voltage:

VoltageLevel = DAQ.inputSingleScan% Reads Voltage

Page 11: Lab 8 Introduction

Analog Discovery DAQTo apply a constant 5V supply across the photocell and 10 kΩ resistor, we will use the Red wire (V+) and the Black wire (GND)

MATLAB Command to turn on Power Supply:

DAQ.setPowerSupply('positive','on');

Page 12: Lab 8 Introduction

Complete Circuit

W1

V+

1+

1-

LED

Photocell

10kΩ resistor

1kΩ resistor

How the system works:• As the light level

decreases, the voltage measured between the photocell and the 10kΩ resistor decreases

• Your program will take the measured voltage and determine an appropriate voltage level to send to the LED

• The voltage output to the LED will cause it to illuminate at different levels

Measuredvoltage

Outputvoltage

Page 13: Lab 8 Introduction

Circuit

Pay close attention to the color code on the resistors. The 1 kΩ (Brown-Black-Red) should be connected in series with the LED. The 10 kΩ (Brown-Black-Orange) should be connected in series with the photocell.

Page 14: Lab 8 Introduction

The USB cable should fit very easily into the Digilent DAQ.

If it doesn’t fit easily, you may have it upside down.

Under no circumstances should you attempt to force it – ask a T.A. for assistance if needed!


Recommended