1 / 14

Lab 8 Introduction

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.

gay
Download Presentation

Lab 8 Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab 8Introduction

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

  3. DIODES • 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.

  4. Light Emitting Diode (LED) 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. 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. Cathode (-) Anode (+) Anode (+) Cathode (-) No Current Flows Current Flows

  5. 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.

  6. 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

  7. Photocells • 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.

  8. PHOTOCELLS Voltage Divider Rule: In Bright Light: In Complete Darkness: _ + VR

  9. Analog Discovery DAQ Analog 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. Theorangewires will be placed across the 10 kΩ resistor to measure the voltage. A smaller voltage reading for VR means it is darker around the photocell so we should make the LED brighter.

  10. Analog Discovery DAQ MATLAB Command to Read Voltage: VoltageLevel = DAQ.inputSingleScan % Reads Voltage

  11. Analog Discovery DAQ To 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');

  12. W1 V+ 1+ 1-  LED Complete Circuit Photocell 10kΩ resistor 1kΩ resistor Measured voltage • 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 Output voltage

  13. 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.

  14. 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!

More Related